<html>
<head>
<title>ANISEED - Wild type expression study (Ciona intestinalis, Halocynthia roretzi)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="This page lists evidences for Ciona intestinalis gene with  a description of Wild Type Expression for a given article. For more information, contact dauga@ibdm.univ-mrs.fr">
<meta name="keywords" content="Evidences, gene expression, Ciona gene, experiment data, Ciona intestinalis expression data, Ciona intestinalis, Halocynthia roretzi, ascidian database, ciona intestinalis database, expression data, in situ data">
<meta name = "robots" content = "index, follow, all">
<META HTTP-EQUIV="Content-Language" CONTENT="EN">
<style type="text/css">
</style>
</head>

<?
include ("connection.php");
include ("frames_header.php");


$id=$_GET["id"];
$gene=$_GET["gene"];


?>
<?

if ($gene{0}=="c") ////Cas JGI
{
$requete="
select \"IN_SITU_ID\" from \"IN_SITU\" where \"IN_SITU_ID\" in 
(

select \"BIO_ID\" from \"REFERENCE\" where \"PUBMED_ID\"=(select \"PUBMED_ID\" from \"ARTICLE\" where \"ARTICLE_ID\"='$id')
INTERSECT

select \"IN_SITU_ID\" from \"IN_SITU\" where \"IN_SITU_ID\" in 
	(
	select \"IN_SITU_ID\" from \"TARGET\" where \"TARGET_ID\" in
		(
		select \"MOL_ID\" from \"MOL_ENTITY\" where \"MOL_ID\" in 
			(
			SELECT \"GENE_ID\" from \"GENE\" where \"NAME\"='$gene'
			UNION 
			SELECT \"CLONE_SEQ_ID\" from \"CLONE_SEQ\" where \"ANISEED_CLUSTER_ID\"=
				(
				select \"GENE_ID\" from \"GENE\" where \"NAME\"='$gene'
				) 
			UNION 
			SELECT \"CLONE_ID\" from \"CLONE\" where \"CLONE_NAME\" in 
				(
				select \"CLONE_NAME\" from \"CLONE_SEQ\" where \"ANISEED_CLUSTER_ID\"=
					(
					select \"GENE_ID\" from \"GENE\" where \"NAME\"='$gene'
					)
				)
			)
		)
	)
) and \"WILD_TYPE\"='y' and \"PRIVATE\"='n' and \"CHECKED\"='y' order by \"DEV_STAGE_ID\"
";
//print $requete;
}
if ($gene{0}=="E")
{
$requete="
select \"IN_SITU_ID\" from \"IN_SITU\" where \"IN_SITU_ID\" in 
(

select \"BIO_ID\" from \"REFERENCE\" where \"PUBMED_ID\"=(select \"PUBMED_ID\" from \"ARTICLE\" where \"ARTICLE_ID\"='$id')
INTERSECT

select \"IN_SITU_ID\" from \"IN_SITU\" where \"IN_SITU_ID\" in 
	(
	select \"IN_SITU_ID\" from \"TARGET\" where \"TARGET_ID\" in
		(
		select \"MOL_ID\" from \"MOL_ENTITY\" where \"MOL_ID\" in 
			(
			SELECT \"GENE_ID\" from \"GENE\" where \"NAME\"='$gene'
			UNION 
			SELECT \"CLONE_SEQ_ID\" from \"CLONE_SEQ\" where \"ANISEED_ENSEMBL_CLUSTER_ID\"=
				(
				select \"ABSTRACT_ID\" from \"TRANSCRIPT\" where \"TRANSCRIPT_ID\"=(
					select \"MOL_ID\" from \"MOL_ENTITY\" where \"NAME\"='$gene'
					)
				) 
			UNION 
			SELECT \"CLONE_ID\" from \"CLONE\" where \"CLONE_NAME\" in 
				(
				select \"CLONE_NAME\" from \"CLONE_SEQ\" where \"ANISEED_ENSEMBL_CLUSTER_ID\"=
					(
					select \"ABSTRACT_ID\" from \"TRANSCRIPT\" where \"TRANSCRIPT_ID\"=(
					select \"MOL_ID\" from \"MOL_ENTITY\" where \"NAME\"='$gene')
					)
				)
			)
		)
	)
) and \"WILD_TYPE\"='y' and \"PRIVATE\"='n' and \"CHECKED\"='y' order by \"DEV_STAGE_ID\"
";
}



/*
A RAJOUTER !!!

INTERSECT
select \"BIO_ID\" from \"REFERENCE\" where \"PUBMED_ID\"=(
select \"PUBMED_ID\" from \"ARTICLE\" where \"ARTICLE_ID\"='$id'
)
*/

$query=pg_query($c,$requete) or die (pg_last_error($c));


print "<center><h3>".pg_num_rows($query)." results</h3></center>";


   // Start of table and column headings (ID and Name)
   print "<center><TABLE CELLSPACING=\"0\" BORDER=\"0\" style=\"border:1px solid black;padding:5px;margin:10px;\" WIDTH=\"99%\">\n";
   
   // Loop through results
   $count=0;

   while( ($row=pg_fetch_array($query)))
//while( $row=pg_fetch_array($query) )
   {  


$requete0="SELECT \"PRIVATE\",\"CHECKED\",\"BEING_CURATED\" from \"IN_SITU\" where \"IN_SITU_ID\"='".$row["IN_SITU_ID"]."'";
$stmt0=pg_query($c,$requete0);
$row0=pg_fetch_array($stmt0);
$PRIVATE=$row0["PRIVATE"];
$CHECKED=$row0["CHECKED"];
$BEING_CURATED=$row0["BEING_CURATED"];




	  if($count++ >= $offset){
   	    print "  <TR><TD>\n";
		
		

		$id=$row["IN_SITU_ID"];
	    	
		
	
		$requete="SELECT A.\"BEING_CURATED\",A.\"WILD_TYPE\", A.\"DEV_STAGE_ID\", A.\"SPECIES\", A.\"EXP_COMMENTS\", A.\"TIME\", A.\"TEMPERATURE\", A.\"IM_COMMENTS\", B.\"NAME\" AS DEV, C.\"NAME\", C.\"SURNAME\", C.\"MAIL\", C.\"LOGO\", D.\"ENTRY_DATE\" FROM \"IN_SITU\" A, \"DEV_STAGE\" B, \"AUTHOR\" C, \"ENTRY_ORIGIN\" D WHERE (A.\"IN_SITU_ID\"=$id) AND (A.\"DEV_STAGE_ID\"=B.\"DEV_STAGE_ID\") AND (D.\"BIO_ID\"=$id) AND (D.\"AUTHOR_ID\"=C.\"AUTHOR_ID\")";
		//print $requete;
		$resultset = pg_query($c,$requete);
				
		$row2=pg_fetch_array($resultset);
		
		//couleur en fonction de wild type ou non
		$wild=$row2["WILD_TYPE"];
		if($wild=='n'){$color='#CCCC99';}else{$color='#FFFFCC';}
		
		//espece & stade de devt. & logo
		print "<TABLE CELLSPACING=\"0\" BORDER=\"0\" bgcolor=\"$color\" WIDTH=\"100%\" style=\"color:black\"><TR>\n";		
		print '<td><table width="100%" border="0" cellspacing="0" cellpadding="0" style="color:black">'
		  .'<tr>'
		  ."<td align=\"left\" >";
		if(strlen($row2["LOGO"])>0)
			print "<img align=\"absmiddle\" src=\"pictures/".$row2["LOGO"]."\">&nbsp;&nbsp;";
		
		print "<a href=\"insitu.php?id=$id\"><img src=\"pictures/button-more.jpg\" border=\"1\"></a>";


/*
if ($PRIVATE=="y") print "&nbsp;&nbsp;This entry is <font size=\"2\" color=\"red\"><b>PRIVATE</b></font></strong>&nbsp;&nbsp;";
if ($PRIVATE=="n") print "&nbsp;&nbsp;This entry is <font size=\"2\" color=\"green\"><b>PUBLIC</b></font></strong>&nbsp;&nbsp;";
if ($BEING_CURATED=="y")
	{
	print "and <font size=\"2\" color=\"orange\"><b>IS BEING CURATED</b></font></strong>&nbsp;&nbsp;";
	}
else
	{
if ($CHECKED=="y") print "and <font size=\"2\" color=\"green\"><b>CURATED</b></font></strong>&nbsp;&nbsp;";
if ($CHECKED=="n") print "and <font size=\"2\" color=\"red\"><b>NOT CURATED</b></font></strong>&nbsp;&nbsp;";
	}
*/

print "</td>";

		print "<td align=\"right\" valign=\"top\"><font color=\"#456898\" size=\"2\"><b>".$row2["SPECIES"]."&nbsp;&nbsp;&nbsp;&nbsp;".$row2[ "dev"]."</b></font></td>"
		  .'</tr></table></td></tr>';

		
		/* ATTENTION   ICI ON TRAITE LES IMAGES DONC MODIFIER LES CHEMINS D'ACCES EN CONSEQUENCE !!!! */

		//picture
		//$requete="SELECT \"PICTURE_ID\", \"PATH\" FROM \"PICTURE\" WHERE \"IN_SITU_ID\" = $id and \"CONTROL\" IS NULL ";
	$requete="SELECT \"PICTURE_ID\", \"PATH\" FROM \"PICTURE\" WHERE \"IN_SITU_ID\" = $id and \"CONTROL\" IS NULL";		

		$stmtpic = pg_query($c,$requete);
		

		print "<TR><TD><TABLE><tr align=\"top\"><td>";
		while($row3=pg_fetch_array($stmtpic)){
			$idpicture=$row3["PICTURE_ID"];
			if(strlen($row3["PATH"])>0)
				{
				if (!preg_match("/mix/",$row3["PATH"]))
			    echo "<a href=\"insitu.php?id=$id\"><img src=\"picturesDB/".$row3["PATH"]."\" border=1 width=\"100\" name=\"pics\"></a> ";
				}
			else
			    echo "<a href=\"insitu.php?id=$id\"><img src=\"picture-mini.php?id=$idpicture\" border=1 width=\"100\" name=\"pics\"></a> ";
		}
		print "</td><td width=\"45%\"><font size=\"-1\" color=\"#000000\">".(str_replace("<br>"," ",$row2[ "IM_COMMENTS"]))."</font></td></tr>";
		print "</TABLE></TD></TR>\n";
		
		
		print "<TABLE cellpadding=\"0\" CELLSPACING=\"0\" BORDER=\"0\" bgcolor=\"$color\" WIDTH=\"100%\" style=\"color:black\">\n";
			//recherche des cibles
			$requete = "SELECT distinct B.\"SURE\", B.\"PART_OF\", A.\"MOL_ID\", A.\"NAME\", A.\"TYPE\", C.\"NAME\" AS \"REGION\", C.\"ANAT_ID\", C.\"DEV_STAGE_ID\" FROM \"MOL_ENTITY\" A, \"TARGET\" B, \"ANAT_ENTITY\" C where (B.\"IN_SITU_ID\"=$id) AND (B.\"TARGET_ID\"=A.\"MOL_ID\") AND (B.\"REGION_ID\"=C.\"ANAT_ID\") ORDER BY C.\"NAME\"";
			
			//print $requete;

			$resultset = pg_query($c, $requete);
			
			$str='';
			$str2='';
			$mol=null; $typemol=null;//sert a retrouver le gene correspondant

			//Le tableau des parties anatomiques a trier + avoid doublons
			$strsort=(array) null;

			while( $row4=pg_fetch_array($resultset )){
				if(substr_count (  $str, $row4["NAME"] )==0){
					if( $row4["TYPE"]=="clone" )
					    $str.="<a href=\"molecule-clone2.php?name=";
					else if( $row4["TYPE"]=="clone_sequence" )
					    $str.="<a href=\"molecule-clone.php?name=";
					else if( $row4["TYPE"]=="gene" )
					    $str.="<a href=\"molecule-gene.php?name=";
					else if( $row4["TYPE"]=="construction" )
					    $str.="<a href=\"molecule-construction.php?name=";
					else
					    $str.="<a href=\"\" name=\"";
					
					$str.=$row4["NAME"]."\">".$row4["NAME"]."</a> - ";
				    
					$mol[$row4["MOL_ID"]]=$row4["NAME"];
					$typemol[$row4["MOL_ID"]]=$row4["TYPE"];
				}
				//anotation sup sur les "stained anatomy part"
				$partof="";$sure="";
				if($row4["PART_OF"]=="X") $partof="Part of ";  else $partof="";
				if($row4["SURE"]=="X") $sure="?"; else $sure="";
			
				//Sort+avoid doublon
				if (!in_array($row4["REGION"],$strsort))
				{		
$str2.="<a href=\"short_hierarchy.php?region=".$row4["ANAT_ID"]."&dev=".$row4["DEV_STAGE_ID"]."\">$partof".$row4["REGION"]."$sure</a> - ";
//$str2.="<a onmouseover=\"return escape('<center><img src=\'embryos/late32c/late32anim.gif\'></center>');\" href=\"short_hierarchy.php?region=".$row4["ANAT_ID"]."&dev=".$row4["DEV_STAGE_ID"]."\">$partof".$row4["REGION"]."$sure</a> - ";

				$strsort[count($strsort)]=$row4["REGION"];
				}
			}
			
			print "<TR valign=\"top\"><TD width=\"250\"><font color=\"#456898\" size=\"2\"><b>Stained molecule: - </b></font><font size=\"-1\" color=\"#000000\">$str</font></TD>\n";
			
			
			//region
			//Classement des régions anatomiques par ordre alphabétique

			/*
			print_r($strsort);
			usort($strsort,"strcasecmp");
			//sort($strsort);
			print_r($strsort);
			*/
			
			print "<TD><font color=\"#456898\" size=\"2\"><b>Stained region: - </b></font><font size=\"-1\" color=\"#000000\">$str2</font></TD></TR>\n";
			
			
			
///////////////////////
            
			
			while (list($key, $value) = each($mol)) {
			      $count2=0;
			      $geneidlist="";
				  if( $typemol[$key]=="clone" ){
					  $requete="SELECT distinct \"ANISEED_CLUSTER_ID\" from \"CLONE_SEQ\" where \"CLONE_NAME\"='$value'";
					    	$resultset=pg_query($c,$requete);
						
						  
					while($row5=pg_fetch_array($resultset)){
						   $geneidlist[$count2++]=$row5["ANISEED_CLUSTER_ID"]; //+ieur genes poss si les est d'un meme clone correspondent a des modeles differents

					  }

					//KYOTO
			  		$requete="select \"NAME\" from \"MOL_ENTITY\" where \"MOL_ID\"=(SELECT distinct \"ANISEED_KYOTO_CLUSTER_ID\" from \"CLONE_SEQ\" where \"CLONE_NAME\"='$value' and \"ANISEED_KYOTO_CLUSTER_ID\" is not null limit 1)"; //tempo
				    	$resultset=pg_query($c,$requete);
					$row5bis=pg_fetch_array($resultset);
					$requete="select \"MOL_ID\" from \"MOL_ENTITY\" where \"NAME\" like '".$row5bis["NAME"].".%' and \"TYPE\" <> 'abstract'";
					$resultset=pg_query($c,$requete);						  
					while($row5=pg_fetch_array($resultset)){
						   $geneidlist[$count2++]=$row5["MOL_ID"];

					  }

					//ENSEMBL
					//$requete="SELECT \"TRANSCRIPT_ID\" from \"TRANSCRIPT\" where \"ABSTRACT_ID\" =(SELECT distinct \"ANISEED_ENSEMBL_CLUSTER_ID\" from \"CLONE_SEQ\" where \"CLONE_NAME\"='$value' and \"ANISEED_ENSEMBL_CLUSTER_ID\" is not null)";//LA VRAI REQUETE
					$requete="SELECT \"TRANSCRIPT_ID\" from \"TRANSCRIPT\" where \"ABSTRACT_ID\" in (SELECT distinct \"ANISEED_ENSEMBL_CLUSTER_ID\" from \"CLONE_SEQ\" where \"CLONE_NAME\"='$value' and \"ANISEED_ENSEMBL_CLUSTER_ID\" is not null) limit 1";//MODIFIE TEMPORAIREMENT
					
					    	$resultset=pg_query($c,$requete);
						//print $requete;
						  
					while($row5=pg_fetch_array($resultset)){
						   $geneidlist[$count2++]=$row5["TRANSCRIPT_ID"]; //+ieur genes poss si les est d'un meme clone correspondent a des modeles differents

					  }




				  }
				  else if( $typemol[$key]=="clone_sequence" ){
					  $requete="SELECT distinct \"ANISEED_CLUSTER_ID\" from \"CLONE_SEQ\" where \"CLONE_SEQ_ID\"=$key";
					  $resultset=pg_query($c,$requete);
					  while($row5=pg_fetch_array($resultset)){
						   $geneidlist[$count2++]=$row5["ANISEED_CLUSTER_ID"];
					  }

					//KYOTO
			  		$requete="select \"NAME\" from \"MOL_ENTITY\" where \"MOL_ID\"=(SELECT distinct \"ANISEED_KYOTO_CLUSTER_ID\" from \"CLONE_SEQ\" where \"CLONE_SEQ_ID\"='$key')";
				    	$resultset=pg_query($c,$requete);
					$row5bis=pg_fetch_array($resultset);
					$requete="select \"MOL_ID\" from \"MOL_ENTITY\" where \"NAME\" like '".$row5bis["NAME"].".%' and \"TYPE\" <> 'abstract'";
					$resultset=pg_query($c,$requete);						  
					while($row5=pg_fetch_array($resultset)){
						   $geneidlist[$count2++]=$row5["MOL_ID"];

					  }

					//ENSEMBL
					$requete="SELECT \"TRANSCRIPT_ID\" from \"TRANSCRIPT\" where \"ABSTRACT_ID\"=(
						SELECT distinct \"ANISEED_ENSEMBL_CLUSTER_ID\" from \"CLONE_SEQ\" where \"CLONE_SEQ_ID\"='$key')";
					    	$resultset=pg_query($c,$requete);
						
						  
					while($row5=pg_fetch_array($resultset)){
						   $geneidlist[$count2++]=$row5["TRANSCRIPT_ID"]; //+ieur genes poss si les est d'un meme clone correspondent a des modeles differents

					  }




				  }
				  else if( $typemol[$key]=="gene" ){
					  $geneidlist[$count2++]=$key;
				  }
				  
				  //recherche des noms possibles pour le gene correspondant				  if(count($geneidlist)>1)
				      $geneidlist=array_unique($geneidlist);


///////// AJOUT POUR LE CONCEPT DE GENE /////////////////////////////////////////
				$GENE=(array) null;
				for ($a=0;$a<count($geneidlist);++$a)
					{
					//print "==>>".$geneidlist[$a];
					if (strlen($geneidlist[$a])==0) continue;
					$requete0="SELECT \"GENE_CLUSTER_ID\" from \"GENE_CONCEPT\" where \"GENE_MODEL_ID\"='".$geneidlist[$a]."'";
					$stmt0=pg_query($c,$requete0);
					$row0=pg_fetch_array($stmt0);
					//print "==>".$row0["GENE_CLUSTER_ID"]."<br>";

					$GENE[count($GENE)]=$row0["GENE_CLUSTER_ID"];
					}
				$GENE=array_unique($GENE);

				//print_r($GENE);

				for ($a=0;$a<count($GENE);$a++)
				{
				$requete0="SELECT \"GENE_CLUSTER_NAME\" from \"GENE_CONCEPT_NAME\" where \"GENE_CLUSTER_ID\"='".$GENE[$a]."'";
				$stmt0=pg_query($c,$requete0);
				$aaa=0;
				$syno="";
				if (pg_num_rows($stmt0)==0)
					{
					$requete0="SELECT \"GENE_CLUSTER_NAME_BLAST\" as \"GENE_CLUSTER_NAME\" from \"GENE_CONCEPT_NAME_BLAST\" where \"GENE_CLUSTER_ID\"='".$GENE[$a]."'";
					$stmt0=pg_query($c,$requete0);
					}
				while ($row0=pg_fetch_array($stmt0))
					{
					
					//$genename=$row0["GENE_CLUSTER_NAME"];
					$genename=$GENE[$a];
					if (++$aaa>1)
						$syno.=' <strong><font color="#990000">/</font></strong> ';
					$syno.=$row0["GENE_CLUSTER_NAME"];
					/*if( strlen($syno)-(($aaa-1)*48) > 100 ){
							  $syno.=" <strong><font color=\"#990000\">/</font></strong>...";
							  break;
						}*/
					}

				print "<tr valign=\"top\"><td><div style=\"border-top:1px solid black;\"/><font size=\"-1\">Predicted Aniseed Gene model for ".$value.": <a href=\"gene-card.php?clusterid=".$genename."\">".(str_replace("cluster","aniseedV3_",$genename))."</a></font></td><td><div style=\"border-top:1px solid black;\"/><font size=\"-1\">".$syno."</font></td></tr>";

				}

////////////////////////////////////////////////////////////////////////////////////

				  /*for($a=0; $a<count($geneidlist); ++$a){
					//print "=>>".$geneidlist[$a]."<br>";
					if( (isset($geneidlist[$a]))and(strlen($geneidlist[$a])>0) ){
					  $requete="SELECT distinct A.\"NAME\", B.\"SYNO\", B.\"ORIGIN\" from \"GENE\" A, \"SYNO\" B where A.\"GENE_ID\"=B.\"GENE_ID\" and B.\"GENE_ID\"=".$geneidlist[$a]."order by B.\"ORIGIN\" DESC";
					  $resultset=pg_query($c,$requete);
					  $syno=""; $aaa=0;
					  while($row6=pg_fetch_array($resultset)){
					      $genename=$row6["NAME"];
						  if($row6["SYNO"]==$row6["NAME"])
							  continue;
						  if(++$aaa>1)
						      $syno.=' <strong><font color="#990000">/</font></strong> ';
						  $syno.=$row6["SYNO"];
						  if($row6["ORIGIN"]=="user-JGI")
							  $syno.="*";
						  
						  if( strlen($syno)-(($aaa-1)*48) > 100 ){
							  $syno.=" <strong><font color=\"#990000\">/</font></strong>...";
							  break;
						  }
					  }
					if($aaa==0){
						$requete="select \"DESCRIPTION\", \"EVALUE\" from \"BLAST\" where \"MOL_ID\"='".$geneidlist[$a]."' and \"SCORE\"=(select max(\"SCORE\") from \"BLAST\" where \"MOL_ID\"='".$geneidlist[$a]."')";
						
						$resultset = pg_query($c,$requete);
						if($row7=pg_fetch_array($resultset)){

							$eval = $row7["EVALUE"];
							if( $eval <= 1e-10)
								$syno.= "HIGHLY ";
							else if( ($eval >= 1e-4) and ($eval <= 1e-3) )
								$syno.= "WEAKLY ";
							if($eval <= 1e-3)
								$syno.= "SIMILAR TO ".$row7["DESCRIPTION"]." (Eval: $eval)";

						}
					}
					
					  
					  
print "<tr valign=\"top\"><td><div style=\"border-top:1px solid black;\"/><font size=\"-1\">Predicted gene model for ".$value.": <a href=\"molecule-gene.php?name=".$genename."\">".$genename."</a></font></td><td><div style=\"border-top:1px solid black;\"/><font size=\"-1\">".$syno."</font></td></tr>";


					////////////////
					//RAJOUT A MOI
					////////////////
					$globalgenelist.=$genename.":";


					}
				  }*/
			}
//////////////////////////////////



            //description des manipulations d'embryon
			if($wild=='n'){
				//recherche des mutants
                $requete = "SELECT distinct \"NAME\", \"BIO_ID\" FROM \"MUTANT\" where \"IN_SITU_ID\"='$id'";
				$resultset = pg_query($c,$requete);
				$str='';
				$a=0; $geneidlist="";//sert ensuite a retouver les noms des genes
				while( $row8=pg_fetch_array($resultset) ){
				    $geneidlist[$a++]=$row8["BIO_ID"];
					$str.="<a href=\"molecule-gene.php?name=".$row8["NAME"]."\">".$row8["FULL_NAME"]." ".$row8["NAME"]."</a> - ";
				}
				print "<TR valign=\"top\"><TD><div style=\"border-top:1px solid black;\"/><font color=\"#456898\" size=\"2\"><b>Deregulated molecule: - </b></font><font color=\"#000000\" size=\"-1\">$str</font></TD>\n";
				
				//recherche des amputations
				$requete = "SELECT A.\"DEV_STAGE_ID\", A.\"ANAT_ID\", A.\"NAME\" FROM \"ANAT_ENTITY\" A, \"EMBRYO_MANIP\" B WHERE (B.\"IN_SITU_ID\"=$id) AND (B.\"STRUCTURE_ID\"=A.\"ANAT_ID\")";
				$resultset = pg_query($c,$requete);
				$str='';
				while( $row9=pg_fetch_array($resultset) ){
					$str.="<a href=\"short_hierarchy.php?region=".$row9["ANAT_ID"]."&dev=".$row9["DEV_STAGE_ID"]."\">".$row9["NAME"]."</a> - ";
				}
			    print "<TD><div style=\"border-top:1px solid black;\"/><font color=\"#456898\" size=\"2\"><b>Embryo manipulation: - </b></font><font color=\"#000000\" size=\"-1\">$str</font></TD></TR>\n";


//On va tenter d'introduire la description des conditions experimentales
if ($wild=='n')
{
//Requete pour recuperer le commentaire 
$r="SELECT \"EXP_COMMENTS\" from \"IN_SITU\" where \"IN_SITU_ID\"='$id'";
$st=pg_query($c,$r);
if (pg_num_rows($st)>0)
{
	$rro=pg_fetch_array($st);
	$comment=$rro["EXP_COMMENTS"];
print "<TR valign=\"top\"><TD><div style=\"border-top:1px solid black;\"/><font color=\"#456898\" size=\"2\"><b>Experimental conditions:</b></font></TD>\n";
	print "<TD><div style=\"border-top:1px solid black;\"/><font size=\"2\"><font color=\"#000000\" size=\"-1\"><em> $comment</em></font></TD></TR>\n";
}

}	

			
			
				//recherche des noms possibles pour le gene correspondant				if(count($geneidlist)>1)
				    $geneidlist=array_unique($geneidlist);
				for($a=0; $a<count($geneidlist); ++$a){
					if( (isset($geneidlist[$a]))and(strlen($geneidlist[$a])>0) ){
						  $requete="SELECT distinct A.\"NAME\", B.\"SYNO\", B.\"ORIGIN\" from \"GENE\" A, \"SYNO\" B where A.\"GENE_ID\"=B.\"GENE_ID\" and B.\"GENE_ID\"=".$geneidlist[$a]."order by B.\"ORIGIN\" DESC";
						  $resultset = pg_query($c,$requete);
						  $syno=""; $aaa=0;
						  while($row10=pg_fetch_array($resultset)){
						      $genename=$row10["NAME"];
							  if($row10["SYNO"]==$row10["NAME"])
								  continue;
							  if(++$aaa>1)
								  $syno.=' <strong><font color="#990000">/</font></strong> ';
							  $syno.=$row10["SYNO"];
							  if($row10["ORIGIN"]=="user-JGI")
								  $syno.="*";
							  if( strlen($syno)-(($aaa-1)*48) > 100 ){
								  $syno.=" <strong><font color=\"#990000\">/</font></strong>...";
								  break;
							  }
						  }
						if($aaa==0){
							$requete="select \"DESCRIPTION\", \"EVALUE\" from \"BLAST\" where \"MOL_ID\"='".$geneidlist[$a]."' and \"SCORE