<html>
<head>
<title>ANISEED - Clone information (Ciona intestinalis, Halocynthia roretzi)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="Different features to describe Halocynthia roretzi or Ciona intestinalis clone. You will find the corresponding Ciona trancript models, the clone sequence and a link to the Ciona in situ data.">
<meta name="keywords" content="Ciona intestinalis clone, Halocynthia roretzi clone, clone sequence, transcript model, Ciona intestinalis, Halocynthia roretzi, ascidian database, ciona intestinalis database.">
<meta name = "robots" content = "index, follow, all">
<META HTTP-EQUIV="Content-Language" CONTENT="EN">
<style type="text/css">
</style>
</head>

<?php
/*
    ANISEED, NISEED System and Database
    Copyright (C) 2007 Olivier Tassy, Fabrice Daian, Patrick Lemaire

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/
include("connection.php");

include("frames_header.php");
?>

<?php
	$name = $_GET["name"];
	

	
	$requete="select B.\"SPECIES\", A.* from \"CLONE_SEQ\" A, \"MOL_ENTITY\" B where (A.\"NAME\"='$name' or A.\"GENBANK_ID\"='$name') and (B.\"MOL_ID\"=A.\"CLONE_SEQ_ID\")";
	$stmt = pg_query($c,$requete);
	if( $row=pg_fetch_array($stmt) ){
		
		$id=$row["CLONE_SEQ_ID"];
		$nameClone=$row["CLONE_NAME"];
		$SPECIES=$row["SPECIES"];
		
		print "<font color=\"#D64242\" size=\"3\"><b>".$row["GENBANK_ID"]."&nbsp;&nbsp;&nbsp;&nbsp;".$row["CLONE_NAME"]."</b></font><br><br>";
		
	    print "<u><font color=\"#456898\" size=\"3\"><b>Features</b></font></u><br>";
		print "<table width=\"100%\">";
    	print "<tr><td  width=\"40%\"><font color=\"#656565\" size=\"-1\"><b>Name: </b></font></td><td><font color=\"#656565\" size=\"-1\">".$row["NAME"]."</font></td></tr>";
		print "<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Species: </b></font></td><td><font color=\"#656565\" size=\"-1\">".$row["SPECIES"]."</font></td></tr>";
		print "<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Description: </b></font></td><td><font color=\"#656565\" size=\"-1\">".$row["COMMENTS"]."</font></td></tr>";
		print "<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Sequence type: </b></font></td><td><font color=\"#656565\" size=\"-1\">".$row["TYPE"]."</font></td></tr>";
		print "<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Orientation:</b></font></td><td><font color=\"#656565\" size=\"-1\">".$row["END"]."</font></td></tr>";
		print "<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Genbank ID: </b></font></td><td><a target=\"blank\" href=\"http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=nucleotide&cmd=search&term=".$row["GENBANK_ID"]."\"><font color=\"#000000\" size=\"-1\">".$row["GENBANK_ID"]."</font></a></td></tr>";
		//print "<tr valign=\"top\" align=\"left\"><td><strong>Cluster: </strong></td><td><a href=\"ESTcluster.php?name=".$row["ANISEED_CLUSTER_ID"]."\">".$row["ANISEED_CLUSTER_ID"]."</a></td></tr>";
		
		if ($row["SPECIES"]=="Ciona intestinalis")
		{
		print "<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Cluster JGI: </b></font></td><td><a href=\"ESTcluster.php?name=".$row["ANISEED_CLUSTER_ID"]."\"><font color=\"#000000\" size=\"-1\">".$row["ANISEED_CLUSTER_ID"]."</font></a></td></tr>";
		//kyoto
		print "<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Cluster Kyoto: </b></font></td><td><a href=\"ESTcluster.php?name=".$row["ANISEED_KYOTO_CLUSTER_ID"]."\"><font color=\"#000000\" size=\"-1\">".$row["ANISEED_KYOTO_CLUSTER_ID"]."</font></a></td></tr>";
		//ENSEMBL
		print "<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Cluster ENSEMBL: </b></font></td><td><a href=\"ESTcluster.php?name=".$row["ANISEED_ENSEMBL_CLUSTER_ID"]."\"><font color=\"#000000\" size=\"-1\">".$row["ANISEED_ENSEMBL_CLUSTER_ID"]."</font></a></td></tr>";
		}
		if ($row["SPECIES"]=="Halocynthia roretzi")
		{
		print "<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Aniseed Cluster ID: </b></font></td><td><a href=\"ESTcluster.php?name=".$row["ANISEED_CLUSTER_ID"]."\"><font color=\"#000000\" size=\"-1\">".$row["ANISEED_CLUSTER_ID"]."</font></a></td></tr>";
		}




//UNIGENE//		print "<tr valign=\"top\" align=\"left\"><td><strong>Unigene cluster: </strong></td><td><a href=\"ESTcluster.php?name=".OCIresult($stmt,"CLUSTER_ID")."\">".OCIresult($stmt,"CLUSTER_ID")."</a></td></tr>";
    	print "<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Clone name: </b></font></td><td><a href=\"molecule-clone2.php?name=".$row["CLONE_NAME"]."\"><font color=\"#000000\" size=\"-1\">".$row["CLONE_NAME"]."</font></a></td></tr>";
    //UNIGENE//	$clust=OCIresult($stmt,"CLUSTER_ID");
		$clust=$row["ANISEED_CLUSTER_ID"];
		$clustKyoto=$row["ANISEED_KYOTO_CLUSTER_ID"];//Le kyoto

		$clustENS=$row["ANISEED_ENSEMBL_CLUSTER_ID"]; //ENSEMBl
		$clonename=$row["CLONE_NAME"];
	

	
		//if(! ocicolumnisnull($stmt,"CLONE_NAME")){
			if ($row["CLONE_NAME"]!=null)
			{
		

		    //requete pour les librairies
			$requete="select \"LIBRARY_ID\" from \"CLONE\" where \"CLONE_NAME\"='".$row["CLONE_NAME"]."'";
			$stmt = pg_query($c,$requete);                                                      //on commence par voir s'il existe 1 enregistrement, ensuite on l'affiche
			if($row=pg_fetch_array($stmt)){                                                                  //en passant par 2 requetes separees
			//if(! ocicolumnisnull($stmt,"LIBRARY_ID")){                                        //
			    $requete="select b.\"LIBRARY_ID\", a.\"TITLE\", a.\"TISSUE\", a.\"ORGAN\", a.\"VECTOR\" from \"LIBRARY\" a, \"CLONE\" b where (a.\"LIBRARY_ID\"=b.\"LIBRARY_ID\")and(b.\"CLONE_NAME\"='".$clonename."')";
				$stmt = pg_query($c,$requete);
				//OCIFetch($stmt);
				//if(! ocicolumnisnull($stmt,"LIBRARY_ID")){
				if($row=pg_fetch_array($stmt)){
				    print "<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Library: </b></font></td><td><font color=\"#656565\" size=\"-1\">".$row["TITLE"]."</font></td></tr>";
					print "<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Tissue: </b></font></td><td><font color=\"#656565\" size=\"-1\">".$row["TISSUE"]."</font></td></tr>";
					print "<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Organ: </b></font></td><td><font color=\"#656565\" size=\"-1\">".$row["ORGAN"]."</font></td></tr>";
					print "<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Vector: </b></font></td><td><font color=\"#656565\" size=\"-1\">".$row["VECTOR"]."</font></td></tr>";
				}
			}
		}

        ////nouvelle version pour utiliser le clustering maison
	    ////requete pour gene affect�a ce clone
	$jgi_name="";
	if (strlen($clust)>0)
	{
		$requete="SELECT \"NAME\" FROM \"GENE\" WHERE \"GENE_ID\"='$clust'";
		//print $requete;
		$stmt = pg_query($c,$requete);
		if( $row=pg_fetch_array($stmt) ){
			
			if ($SPECIES=="Ciona intestinalis")
			{
			$jgi_name="<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Corresponding JGI transcript: </b></font></td><td><a href=\"molecule-gene.php?name=".$row["NAME"]."\"><font color=\"#000000\" size=\"-1\">".$row["NAME"]."</font></a></td></tr>";
			}
			if ($SPECIES=="Halocynthia roretzi")
			{
			$jgi_name="<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Corresponding Halocynthia transcript: </b></font></td><td><a href=\"molecule-gene.php?name=".$row["NAME"]."\"><font color=\"#000000\" size=\"-1\">".$row["NAME"]."</font></a></td></tr>";
			}
			
			$requete0="SELECT \"GENE_CLUSTER_NAME\",\"GENE_CLUSTER_ID\" from \"GENE_CONCEPT_NAME\" where \"GENE_CLUSTER_ID\"=(
			select \"GENE_CLUSTER_ID\" from \"GENE_CONCEPT\" where \"GENE_MODEL_ID\"=(
			select \"GENE_ID\" from \"GENE\" where \"NAME\"='".$row["NAME"]."'
			)
			)";
			$stmt0=pg_query($c,$requete0);
			$gene_name_jgi="";
			$gene_cluster_id_jgi="";
			while ($row0=pg_fetch_array($stmt0))
				{
				$gene_cluster_id_jgi=$row0["GENE_CLUSTER_ID"];
				if (strlen($gene_name_jgi)==0) $gene_name_jgi=$row0["GENE_CLUSTER_NAME"];
				else $gene_name_jgi.=" / ".$row0["GENE_CLUSTER_NAME"];
				}

			
	
    	}
	}
	//Rajoute le predicted gene pour le kyotograil

	$kyoto_name="";
	if (strlen($clustKyoto)>0)
	{
		//$requete="SELECT \"NAME\" FROM \"GENE\" WHERE \"GENE_ID\"='$clustKyoto'";
		$requete="SELECT \"NAME\" FROM \"MOL_ENTITY\" WHERE \"MOL_ID\"='$clustKyoto'";
		$stmt = pg_query($c,$requete);
		if( $row=pg_fetch_array($stmt) ){

			$requete="SELECT \"NAME\" from \"MOL_ENTITY\" where \"NAME\" like '".$row["NAME"].".%' AND \"TYPE\" not like 'abstract'";
			$st=pg_query($c,$requete);
			while ($ro=pg_fetch_array($st))
			{
			$kyoto_name.="<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Corresponding KYOTOGRAIL transcript: </b></font></td><td><a href=\"molecule-gene.php?name=".$ro["NAME"]."\"><font color=\"#000000\" size=\"-1\">".$ro["NAME"]."</font></a></td></tr>";

			$requete0="SELECT \"GENE_CLUSTER_NAME\",\"GENE_CLUSTER_ID\" from \"GENE_CONCEPT_NAME\" where \"GENE_CLUSTER_ID\"=(
			select \"GENE_CLUSTER_ID\" from \"GENE_CONCEPT\" where \"GENE_MODEL_ID\"=(
			select \"GENE_ID\" from \"GENE\" where \"NAME\"='".$ro["NAME"]."'
			)
			)";
			$stmt0=pg_query($c,$requete0);
			$gene_name_kyoto="";
			$gene_cluster_id_kyoto="";
			while ($row0=pg_fetch_array($stmt0))
				{
				$gene_cluster_id_kyoto=$row0["GENE_CLUSTER_ID"];
				if (strlen($gene_name_kyoto)==0) $gene_name_kyoto=$row0["GENE_CLUSTER_NAME"];
				else $gene_name_kyoto.=" / ".$row0["GENE_CLUSTER_NAME"];
				}


			}
	}
	}

	//Rajoute le predicted gene pour ENSEMBL
	$ens_name="";
	if (strlen($clustENS)>0)
	{
		$requete="SELECT \"NAME\" from \"MOL_ENTITY\" where \"MOL_ID\" in (select \"TRANSCRIPT_ID\" from \"TRANSCRIPT\" where \"ABSTRACT_ID\"='$clustENS')";	
		$st=pg_query($c,$requete);
		while ($ro=pg_fetch_array($st))
			{
			$ens_name.="<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Corresponding ENSEMBL transcript: </b></font></td><td><a href=\"molecule-gene.php?name=".$ro["NAME"]."\"><font color=\"#000000\" size=\"-1\">".$ro["NAME"]."</font></a></td></tr>";

			$requete0="SELECT \"GENE_CLUSTER_NAME\",\"GENE_CLUSTER_ID\" from \"GENE_CONCEPT_NAME\" where \"GENE_CLUSTER_ID\"=(
			select \"GENE_CLUSTER_ID\" from \"GENE_CONCEPT\" where \"GENE_MODEL_ID\"=(
			select \"GENE_ID\" from \"GENE\" where \"NAME\"='".$ro["NAME"]."'
			)
			)";
			$stmt0=pg_query($c,$requete0);
			$gene_name_ens="";
			$gene_cluster_id_ens="";
			while ($row0=pg_fetch_array($stmt0))
				{
				$gene_cluster_id_ens=$row0["GENE_CLUSTER_ID"];
				if (strlen($gene_name_ens)==0) $gene_name_ens=$row0["GENE_CLUSTER_NAME"];
				else $gene_name_ens.=" / ".$row0["GENE_CLUSTER_NAME"];
				}




			}
	

	
	}


	///// AJOUT //////
	//print $gene_cluster_id_jgi." ".$gene_cluster_id_kyoto." ".$gene_cluster_id_ens."<br>";
	if (strlen($gene_cluster_id_jgi)>0)
	{

	print "<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Corresponding gene: </b></font></td><td><a href=\"gene-card.php?clusterid=$gene_cluster_id_jgi\"><font color=\"#000000\" size=\"-1\">".str_replace("cluster","aniseedV3_",$gene_cluster_id_jgi)." &nbsp;&nbsp;( $gene_name_jgi )</font></a></td></tr>";
	
	}

	else if (strlen($gene_cluster_id_kyoto)>0)
	{
	print "<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Corresponding gene: </b></font></td><td><a href=\"gene-card.php?clusterid=$gene_cluster_id_kyoto\"><font color=\"#000000\" size=\"-1\">".str_replace("cluster","aniseedV3_",$gene_cluster_id_kyoto)." &nbsp;&nbsp;( $gene_name_kyoto )</font></a></td></tr>";
	}
	else if (strlen($gene_cluster_id_ens)>0)
	{
	print "<tr valign=\"top\" align=\"left\"><td><font color=\"#656565\" size=\"-1\"><b>Corresponding gene: </b></font></td><td><a href=\"gene-card.php?clusterid=$gene_cluster_id_ens\"><font color=\"#000000\" size=\"-1\">".str_replace("cluster","aniseedV3_",$gene_cluster_id_ens)." &nbsp;&nbsp;( $gene_name_ens )</font></a></td></tr>";
	}

	print "<tr><td>&nbsp;</td><td>&nbsp;</td>";
	print $jgi_name;
	print $kyoto_name;
	print $ens_name;


		print "</table>";//</tr></table>
        print "<br><br>";

		if(strlen($nameClone)>0)
    	    print "<center><a href=\"insitu-result.php?target=$nameClone\"><img src=\"pictures/button-getPics.jpg\" border=\"0\"></a></center>";
        else
		    print "<center><a href=\"insitu-result.php?target=$name&MOLtype=1&Order=DEV_STAGE_ID\"><img src=\"pictures/button-getPics.jpg\" border=\"0\"></a></center>";
		
//////////////////////////////////////////SEQUENCE/////////////////////////////////////////////
		$requete="select \"SEQUENCE\", \"LENGTH\", \"COMMENTS\" from \"SEQUENCE\" where \"MOL_ID\"=$id";
		$stmt = pg_query($c,$requete);
								
    	if( $row=pg_fetch_array($stmt) ){
	    	$lob = $row["SEQUENCE"];

		/* DEBUT DE L'AFFICHAGE DU CLOB */

		pg_query ($c, "begin");	/*Debut de la transaction*/
		
		$handle_lo = pg_lo_open($c,$lob,"r");
		$seq=pg_lo_read($handle_lo);

		pg_query($c,"end"); /*fin de la Transaction*/

			
			$seq=ereg_replace("<br>","",$seq);
			$seq=ereg_replace("\n","",$seq);
			//$seq = chunk_split($seq, 70, "\n");
			$seq = chunk_split($seq,61,"\n"); //Better because of new pagination for sequence
			
	    	print "<br><u><strong>Sequence</strong></u><br><strong>Length: </strong>".$row["LENGTH"]."<br>".strtoupper($row["COMMENTS"])."<br><br><pre><font face=\"Courier New, Courier, mono\" size=\"2\">$seq</font></pre>";
		}
	
//print "<br><br><a href=\"XMLexport-molecule-clone.php?name=$name\">Display entry in XML format</a><br>";
	print "<a href=\"FLATexport-molecule-clone.php?name=$name\">Display entry in raw text format</a><br>";

	}else{ print "<br><br><center><h2><strong>No match</strong></h2></center><br><br>"; }
?>

<?php
   	include("frames_footer.php");
?> 