<!--ARTICLE module
 display informations on an article
-->
<html>
<head>
<title>ANISEED - Ascidian articles present in Aniseed</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="This page describes a Ciona intestinalis article in detail. This is an acces point to the different data present in the ascidian publication.">
<meta name="keywords" content="Aniseed, Ciona intestinalis, Ciona intestinalis articles, Ascidian articles, Ascidian publication, Ciona publication.">
<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");

print "<title>ANISEED V3 - Article Card</title>";

$id=$_GET["id"];

//$requete="SELECT * from \"ARTICLE\" where \"ARTICLE_ID\"='$id' and \"PRIVATE\"='n' and \"CHECKED\"='y'";
$requete="SELECT * from \"ARTICLE\" where \"ARTICLE_ID\"='$id'";
$stmt=pg_query($c,$requete);
$row=pg_fetch_array($stmt);

$pmid=$row["PUBMED_ID"];
$title=$row["TITLE"];
$paper=$row["PAPER"];
$authors=$row["AUTHORS"];
$url=$row["URL"];
$comments=$row["COMMENTS"];

////RECUPERATION DE L'ABSTRACT/////

$web="http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?id=$pmid&db=pubmed&report=xml";

$resource=curl_init($web);
curl_setopt($resource, CURLOPT_RETURNTRANSFER, 1);
$contents=curl_exec($resource);
curl_close($resource);

////Affichage de l'abstract///////


//Nom de l'article
$contents2=str_replace("&lt;ArticleTitle&gt;","§",$contents);
$contents2=str_replace("&lt;/ArticleTitle&gt;","§",$contents2);
$tab=split("§",$contents2);
$title=$tab[1];

//Nom du journal
$contents2=str_replace("&lt;MedlineTA&gt;","§",$contents);
$contents2=str_replace("&lt;/MedlineTA&gt;","§",$contents2);
$tab=split("§",$contents2);
$paper=$tab[1];

//Nom des auteurs
$contents2=str_replace("&lt;LastName&gt;","§",$contents);
$contents2=str_replace("&lt;/LastName&gt;","§",$contents2);
$tab=split("§",$contents2);
$auteurN=(array) null;
$auteurI=(array) null;
for ($i=1;$i<count($tab)-1;$i++)
	if ($i%2!=0) $auteurN[count($auteurN)]=$tab[$i];
$contents2=str_replace("&lt;Initials&gt;","§",$contents);
$contents2=str_replace("&lt;/Initials&gt;","§",$contents2);
$tab=split("§",$contents2);
for ($i=1;$i<count($tab)-1;$i++)
	if ($i%2!=0) $auteurI[count($auteurI)]=$tab[$i];
$auteur="";
for ($i=0;$i<count($auteurN)-1;$i++)
$auteur.=$auteurN[$i]." ".$auteurI[$i].", ";
$auteur.=$auteurN[count($auteurN)-1]." ".$auteurI[count($auteurN)-1];

//Le volume
$contents2=str_replace("&lt;Volume&gt;","§",$contents);
$contents2=str_replace("&lt;/Volume&gt;","§",$contents2);
$tab=split("§",$contents2);
$volume=$tab[1];

//L'issue
$contents2=str_replace("&lt;Issue&gt;","§",$contents);
$contents2=str_replace("&lt;/Issue&gt;","§",$contents2);
$tab=split("§",$contents2);
$issue=$tab[1];

//L'année
$contents2=str_replace("&lt;Year&gt;","§",$contents);
$contents2=str_replace("&lt;/Year&gt;","§",$contents2);
$tab=split("§",$contents2);
$year=$tab[1];

//la page
$contents2=str_replace("&lt;MedlinePgn&gt;","§",$contents);
$contents2=str_replace("&lt;/MedlinePgn&gt;","§",$contents2);
$tab=split("§",$contents2);
$page=$tab[1];


$paper.=". ".$year." ".$month.";".$volume."(".$issue."):".$page;

$contents=trim($contents);
$one=explode("AbstractText",$contents);
$tmp=$one[1];

$tmp=str_replace("&gt;","",$tmp); 
$tmp=str_replace("&lt;","",$tmp);
$tmp=substr($tmp,0,strlen($tmp)-1);

$abstract=$tmp;



print "<center><font color=\"#D64242\" size=\"2\"><b>". $title."</b></font></center><br>";
print "<center><font color=\"#656565\" size=\"1\"><b>".$auteur."</b></font></center><br>
<center><font color=\"#000000\" size=\"1\"><em>$paper</em></font></center><br>";

print "<center><font color=\"#000000\" size=\"1\"><b>PMID: $pmid</b></font></center><br>";


print "<div style=\"border-top:1px solid black;border-bottom:1px solid black;margin:10px;padding:10px;\"><font color=\"#656565\"><b><u>Abstract</u></b></font><br><br><font color=\"#000000\" size=\"1\">$abstract</font></div>";


print "<div style=\"margin:10px;padding:10px;\">";

print "<br><center><font color=\"#D64242\" size=\"2\"><b>Data present in Aniseed database related to this article</b></font></center><br>";


print "<center><input type=\"submit\" value=\"Expand All\" onclick=\"

fate.style.display='block';
gene_fun.style.display='block';
gene_reg.style.display='block';
gene_wild.style.display='block';
morpho.style.display='block';
picture.style.display='block';

img0.src='min-box.gif';
img1.src='min-box.gif';
img2.src='min-box.gif';
img3.src='min-box.gif';
img4.src='min-box.gif';
img5.src='min-box.gif';
img6.src='min-box.gif';

\">
&nbsp;&nbsp;&nbsp;&nbsp;

<input type=\"submit\" value=\"Collapse All\" onclick=\"

fate.style.display='none';
gene_fun.style.display='none';
gene_reg.style.display='none';
gene_wild.style.display='none';
morpho.style.display='none';
picture.style.display='none';

img0.src='plus-box.gif';
img1.src='plus-box.gif';
img2.src='plus-box.gif';
img3.src='plus-box.gif';
img4.src='plus-box.gif';
img5.src='plus-box.gif';
img6.src='plus-box.gif';
\">




</center><br><br>";


//////////////////////////////////
/*
/////////////////////////////////////////////////////////ANATOMY/////////////////////////////////////////////////////////////////////////////////////
//$requete="SELECT * from \"ARTICLE_ANATOMY\" where \"ARTICLE_ID\"='$id' and \"PRIVATE\"='n' and \"CHECKED\"='y'";
$requete="SELECT * from \"ARTICLE_ANATOMY\" where \"ARTICLE_ID\"='$id'";
$stmt=pg_query($c,$requete);

$NUM=pg_num_rows($stmt);

if ($NUM==1)
	{

print "<img id=\"img0\" src=\"plus-box.gif\" onclick=\"
if (process.style.display=='block')
	{
	img0.src='plus-box.gif';
	process.style.display='none';
	}
else
	{
	img0.src='min-box.gif';
	process.style.display='block';
	}

\">&nbsp;";
print "<font color=\"#656565\" size=\"2\"><b>Territorie affected ($NUM result)</b></font><br>";
	}


if ($NUM>1)
	{
print "<img id=\"img0\" src=\"plus-box.gif\" onclick=\"
if (process.style.display=='block')
	{
	img0.src='plus-box.gif';
	process.style.display='none';
	}
else
	{
	img0.src='min-box.gif';
	process.style.display='block';
	}

\">&nbsp;";
print "<font color=\"#656565\" size=\"2\"><b>Territories affected ($NUM results)</b></font><br>";
	}

if ($NUM==0)
	{
	print "<img id=\"img0\" src=\"min-box.gif\">&nbsp;";
	print "<font color=\"#656565\" size=\"2\"><b>Territories affected (No result)</b></font><br><br>";
	}


print "<div id=\"process\" style=\"display:none;\">";


$tanat=(array) null;

print "<table width=\"100%\" style=\"border: 1px dashed black;\">";
print "<tr><td align=\"center\"><font size=\"-1\" color=\"#456898\">Developmental Stage</font></td><td align=\"center\"><font size=\"-1\" color=\"#456898\">Territory name</font></td><td align=\"center\"><font size=\"-1\" color=\"#456898\">Gene involved</font></td></tr>";

$I=0;
while ($row=pg_fetch_array($stmt))
{

$requete0="SELECT \"NAME\",\"DEV_STAGE_ID\" from \"ANAT_ENTITY\" where \"ANAT_ID\"='".$row["ANAT_ID"]."'";
$stmt0=pg_query($c,$requete0);
$row0=pg_fetch_array($stmt0);
$aname=$row0["NAME"];
$adevid=$row0["DEV_STAGE_ID"];

$requete0="SELECT \"NAME\" from \"DEV_STAGE\" where \"DEV_STAGE_ID\"=(
select \"DEV_STAGE_ID\" from \"ANAT_ENTITY\" where \"ANAT_ID\"='".$row["ANAT_ID"]."'
)";
$stmt0=pg_query($c,$requete0);
$row0=pg_fetch_array($stmt0);
$adev=$row0["NAME"];

$requete0="
select \"GENE_CLUSTER_NAME\" as \"NAME\" 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["TRANSCRIPT"]."'
)
)
";
$stmt0=pg_query($c,$requete0);
if (pg_num_rows($stmt0)==0)
	{
	$requete0="
	select \"GENE_CLUSTER_NAME_BLAST\" as \"NAME\" from \"GENE_CONCEPT_NAME_BLAST\" where \"GENE_CLUSTER_ID\"=(
	select \"GENE_CLUSTER_ID\" from \"GENE_CONCEPT\" where \"GENE_MODEL_ID\"=(
	SELECT \"GENE_ID\" from \"GENE\" where \"NAME\"='".$row["TRANSCRIPT"]."'
	)
	)
	";
	$stmt0=pg_query($c,$requete0);
	}

$gname="";
while ($row0=pg_fetch_array($stmt0))
	{
	if (strlen($gname)==0) $gname=$row0["NAME"];
	else $gname.=" / ".$row0["NAME"];
	}


$requete0="SELECT \"GENE_CLUSTER_ID\" from \"GENE_CONCEPT\" where \"GENE_MODEL_ID\"=(
select \"GENE_ID\" from \"GENE\" where \"NAME\"='".$row["TRANSCRIPT"]."'
)";
$stmt0=pg_query($c,$requete0);
$row0=pg_fetch_array($stmt0);
$clustid=$row0["GENE_CLUSTER_ID"];

//print "$aname ( $adev ) : $gname<br>";
if ($I%2==0) {$color="#DDDDDB";$fcolor="black";} else {$color="#AAAAAA";$fcolor="black";}
print "<tr><td style=\"background-color:$color;color:$fcolor;\" align=\"center\"><font size=\"-1\">$adev</font></td><td  style=\"background-color:$color;color:$fcolor;\" align=\"center\"><a target=\"blank\"  href=\"short_hierarchy.php?region=".$row["ANAT_ID"]."&dev=$adevid\"><font size=\"-1\">$aname</font></a></td><td  style=\"background-color:$color;color:$fcolor;\" align=\"center\"><font size=\"-1\"><a target=\"blank\"  href=\"gene-card.php?clusterid=$clustid\">$gname</a></font></td></tr>";

$I++;
}

print "</table>";

print "</div>";

print "<br>";
*/
/////////////////////////////////////////////////////////FATE/////////////////////////////////////////////////////////////////////////////////////

//$requete="SELECT * from \"ARTICLE_FATE\" where \"ARTICLE_ID\"='$id' and \"PRIVATE\"='n' and \"CHECKED\"='y'";
$requete="SELECT * from \"ARTICLE_FATE\" where \"ARTICLE_ID\"='$id'";
$stmt=pg_query($c,$requete);
$NUM=pg_num_rows($stmt);

if ($NUM==1)
	{

print "<img id=\"img1\" src=\"plus-box.gif\" onclick=\"
if (fate.style.display=='block')
	{
	img1.src='plus-box.gif';
	fate.style.display='none';
	}
else
	{
	img1.src='min-box.gif';
	fate.style.display='block';
	}

\">&nbsp;";
print "<font color=\"#656565\" size=\"2\"><b>Fate affected ($NUM result)</b></font><br>";
	}


if ($NUM>1)
	{
print "<img id=\"img1\" src=\"plus-box.gif\" onclick=\"
if (fate.style.display=='block')
	{
	img1.src='plus-box.gif';
	fate.style.display='none';
	}
else
	{
	img1.src='min-box.gif';
	fate.style.display='block';
	}

\">&nbsp;";
print "<font color=\"#656565\" size=\"2\"><b>Fate affected ($NUM results)</b></font><br>";
	}

if ($NUM==0)
	{
	print "<img id=\"img1\" src=\"min-box.gif\">&nbsp;";
	print "<font color=\"#656565\" size=\"2\"><b>Fate affected (No result)</b></font><br><br>";
	}

print "<div id=\"fate\" style=\"display:none;\">";


$tfate=(array) null;

print "<table width=\"100%\" style=\"border: 1px dashed black;\">";
print "<tr><td align=\"center\"><font size=\"-1\" color=\"#456898\">Fate</font></td><td align=\"center\"><font size=\"-1\" color=\"#456898\">Gene involved</font></td></tr>";


$I=0;
while ($row=pg_fetch_array($stmt))
{
$fate=$row["FATE"];
$requete0="
select \"GENE_CLUSTER_NAME\" as \"NAME\" 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\"='".trim($row["TRANSCRIPT"])."'
)
)
";
$stmt0=pg_query($c,$requete0);
$row0=pg_fetch_array($stmt0);
//print $requete0."<br>";
if (pg_num_rows($stmt0)==0)
//if (strlen(trim($row0["GENE_CLUSTER_NAME"]))==0)
	{
	$requete0="
	select \"GENE_CLUSTER_NAME_BLAST\" as \"NAME\" from \"GENE_CONCEPT_NAME_BLAST\" where \"GENE_CLUSTER_ID\"=(
	select \"GENE_CLUSTER_ID\" from \"GENE_CONCEPT\" where \"GENE_MODEL_ID\"=(
	SELECT \"GENE_ID\" from \"GENE\" where \"NAME\"='".trim($row["TRANSCRIPT"])."'
	)
	)
	";
//  	print $requete0."<br>";
	$stmt0=pg_query($c,$requete0);
	}

$gname="";
while ($row0=pg_fetch_array($stmt0))
	{
	if (strlen($gname)==0) $gname=$row0["NAME"];
	else $gname.=" / ".$row0["NAME"];
	}

$requete0="SELECT \"GENE_CLUSTER_ID\" from \"GENE_CONCEPT\" where \"GENE_MODEL_ID\"=(
select \"GENE_ID\" from \"GENE\" where \"NAME\"='".$row["TRANSCRIPT"]."'
)";
$stmt0=pg_query($c,$requete0);
$row0=pg_fetch_array($stmt0);
$clustid=$row0["GENE_CLUSTER_ID"];


if ($I%2==0) {$color="#DDDDDB";$fcolor="black";} else {$color="#AAAAAA";$fcolor="black";}
print "<tr><td style=\"background-color:$color;color:$fcolor;\" align=\"center\"><font size=\"-1\">$fate</font></td><td  style=\"background-color:$color;color:$fcolor;\" align=\"center\"><font size=\"-1\"><a target=\"blank\" href=\"gene-card.php?clusterid=$clustid\">$gname</a></font></td></tr>";

$I++;




}

print "</table>";
print "</div>";

print "<br>";
///////////////////////////////////////////////////////// GENE FUNCTION STUDY /////////////////////////////////////////////////////////////////////


//$requete="SELECT * from \"ARTICLE_GENE\" where \"ARTICLE_ID\"='$id' and \"TYPE\"='Function' and \"PRIVATE\"='n' and \"CHECKED\"='y'";
$requete="SELECT * from \"ARTICLE_GENE\" where \"ARTICLE_ID\"='$id' and \"TYPE\"='Function'";
$stmt=pg_query($c,$requete);
$NUM=pg_num_rows($stmt);
if ($NUM==1)
	{

print "<img id=\"img2\" src=\"plus-box.gif\" onclick=\"
if (gene_fun.style.display=='block')
	{
	img2.src='plus-box.gif';
	gene_fun.style.display='none';
	}
else
	{
	img2.src='min-box.gif';
	gene_fun.style.display='block';
	}

\">&nbsp;";
print "<font color=\"#656565\" size=\"2\"><b>$NUM Gene Functionally analyzed</b></font><br>";
	}


if ($NUM>1)
	{
print "<img id=\"img2\" src=\"plus-box.gif\" onclick=\"
if (gene_fun.style.display=='block')
	{
	img2.src='plus-box.gif';
	gene_fun.style.display='none';
	}
else
	{
	img2.src='min-box.gif';
	gene_fun.style.display='block';
	}

\">&nbsp;";
print "<font color=\"#656565\" size=\"2\"><b>$NUM Genes Functionally analyzed  </b></font><br>";
	}

if ($NUM==0)
	{
	print "<img id=\"img2\" src=\"min-box.gif\">&nbsp;";
	print "<font color=\"#656565\" size=\"2\"><b>No Gene Functionaly analyzed  (No result)</b></font><br><br>";
	}

print "<div id=\"gene_fun\" style=\"display:none;\">";

print "<table width=\"100%\" style=\"border: 1px dashed black;\">";
print "<tr><td align=\"center\"><font size=\"-1\" color=\"#456898\">Gene</font></td><td align=\"center\"><font size=\"-1\" color=\"#456898\">Evidence</font></td></tr>";

$I=0;
while ($row=pg_fetch_array($stmt))
{

$requete0="
select \"GENE_CLUSTER_NAME\" as \"NAME\" 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["TRANSCRIPT"]."'
)
)
";
$stmt0=pg_query($c,$requete0);
if (pg_num_rows($stmt0)==0)
	{
	$requete0="
	select \"GENE_CLUSTER_NAME_BLAST\" as \"NAME\" from \"GENE_CONCEPT_NAME_BLAST\" where \"GENE_CLUSTER_ID\"=(
	select \"GENE_CLUSTER_ID\" from \"GENE_CONCEPT\" where \"GENE_MODEL_ID\"=(
	SELECT \"GENE_ID\" from \"GENE\" where \"NAME\"='".$row["TRANSCRIPT"]."'
	)
	)
	";
	$stmt0=pg_query($c,$requete0);
	}

$gname="";
while ($row0=pg_fetch_array($stmt0))
	{
	if (strlen($gname)==0) $gname=$row0["NAME"];
	else $gname.=" / ".$row0["NAME"];
	}

$requete0="SELECT \"GENE_CLUSTER_ID\" from \"GENE_CONCEPT\" where \"GENE_MODEL_ID\"=(
select \"GENE_ID\" from \"GENE\" where \"NAME\"='".$row["TRANSCRIPT"]."'
)";
$stmt0=pg_query($c,$requete0);
$row0=pg_fetch_array($stmt0);
$clustid=$row0["GENE_CLUSTER_ID"];


if ($I%2==0) {$color="#DDDDDB";$fcolor="black";} else {$color="#AAAAAA";$fcolor="black";}
print "<tr><td  style=\"background-color:$color;color:$fcolor;\" align=\"center\"><font size=\"-1\"><a target=\"blank\" href=\"gene-card.php?clusterid=$clustid\">$gname</a></font></td>
<td style=\"background-color:$color;color:$fcolor;\" align=\"center\"><font size=\"-1\"><a target=\"blank\" href=\"article-gene-function.php?id=$id&gene=".$row["TRANSCRIPT"]."\">Show evidence</a></font></td>

</tr>";

$I++;




}

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

///////////////////////////////////////////////////////// GENE REGULATION STUDY /////////////////////////////////////////////////////////////////////


//$requete="SELECT * from \"ARTICLE_GENE\" where \"ARTICLE_ID\"='$id' and \"TYPE\"='Regulation' and \"PRIVATE\"='n' and \"CHECKED\"='y'";
$requete="SELECT * from \"ARTICLE_GENE\" where \"ARTICLE_ID\"='$id' and \"TYPE\"='Regulation'";
$stmt=pg_query($c,$requete);
$NUM=pg_num_rows($stmt);
if ($NUM==1)
	{

print "<img id=\"img3\" src=\"plus-box.gif\" onclick=\"
if (gene_reg.style.display=='block')
	{
	img3.src='plus-box.gif';
	gene_reg.style.display='none';
	}
else
	{
	img3.src='min-box.gif';
	gene_reg.style.display='block';
	}

\">&nbsp;";
print "<font color=\"#656565\" size=\"2\"><b>$NUM Gene whose regulation was studied</b></font><br>";
	}


if ($NUM>1)
	{
print "<img id=\"img3\" src=\"plus-box.gif\" onclick=\"
if (gene_reg.style.display=='block')
	{
	img3.src='plus-box.gif';
	gene_reg.style.display='none';
	}
else
	{
	img3.src='min-box.gif';
	gene_reg.style.display='block';
	}

\">&nbsp;";
print "<font color=\"#656565\" size=\"2\"><b>$NUM Genes whose regulation was studied</b></font><br>";
	}

if ($NUM==0)
	{
	print "<img id=\"img3\" src=\"min-box.gif\">&nbsp;";
	print "<font color=\"#656565\" size=\"2\"><b>No Genes whose regulation was studied</b></font><br><br>";
	}

print "<div id=\"gene_reg\" style=\"display:none;\">";

print "<table width=\"100%\" style=\"border:1px dashed black;\" >";
print "<tr><td align=\"center\"><font size=\"-1\" color=\"#456898\">Gene</font></td><td align=\"center\"><font size=\"-1\" color=\"#456898\">Evidence</font></td></tr>";

$I=0;
while ($row=pg_fetch_array($stmt))
{

$requete0="
select \"GENE_CLUSTER_NAME\" as \"NAME\" 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["TRANSCRIPT"]."'
)
)
";
$stmt0=pg_query($c,$requete0);
if (pg_num_rows($stmt0)==0)
	{
	$requete0="
	select \"GENE_CLUSTER_NAME_BLAST\" as \"NAME\" from \"GENE_CONCEPT_NAME_BLAST\" where \"GENE_CLUSTER_ID\"=(
	select \"GENE_CLUSTER_ID\" from \"GENE_CONCEPT\" where \"GENE_MODEL_ID\"=(
	SELECT \"GENE_ID\" from \"GENE\" where \"NAME\"='".$row["TRANSCRIPT"]."'
	)
	)
	";
	$stmt0=pg_query($c,$requete0);
	}

$gname="";
while ($row0=pg_fetch_array($stmt0))
	{
	if (strlen($gname)==0) $gname=$row0["NAME"];
	else $gname.=" / ".$row0["NAME"];
	}

$requete0="SELECT \"GENE_CLUSTER_ID\" from \"GENE_CONCEPT\" where \"GENE_MODEL_ID\"=(
select \"GENE_ID\" from \"GENE\" where \"NAME\"='".$row["TRANSCRIPT"]."'
)";
$stmt0=pg_query($c,$requete0);
$row0=pg_fetch_array($stmt0);
$clustid=$row0["GENE_CLUSTER_ID"];


if ($I%2==0) {$color="#DDDDDB";$fcolor="black";} else {$color="#AAAAAA";$fcolor="black";}
print "<tr><td  style=\"background-color:$color;color:$fcolor;\" align=\"center\"><font size=\"-1\"><a target=\"blank\" href=\"gene-card.php?clusterid=$clustid\">$gname</a></font></td>
<td style=\"background-color:$color;color:$fcolor;\" align=\"center\"><font size=\"-1\"><a target=\"blank\" href=\"article-gene-regulation.php?id=$id&gene=".$row["TRANSCRIPT"]."\">Show evidence</a></font></td>

</tr>";

$I++;




}

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


///////////////////////////////////////////////////////// GENE WILD TYPE STUDY  /////////////////////////////////////////////////////////////////////
//$requete="SELECT * from \"ARTICLE_GENE\" where \"ARTICLE_ID\"='$id' and \"TYPE\"='Wild type expression' and \"PRIVATE\"='n' and \"CHECKED\"='y'";
$requete="SELECT * from \"ARTICLE_GENE\" where \"ARTICLE_ID\"='$id' and \"TYPE\"='Wild type expression'";
$stmt=pg_query($c,$requete);
$NUM=pg_num_rows($stmt);
if ($NUM==1)
	{

print "<img id=\"img4\" src=\"plus-box.gif\" onclick=\"
if (gene_wild.style.display=='block')
	{
	img4.src='plus-box.gif';
	gene_wild.style.display='none';
	}
else
	{
	img4.src='min-box.gif';
	gene_wild.style.display='block';
	}

\">&nbsp;";
print "<font color=\"#656565\" size=\"2\"><b>$NUM Gene with description of Wild Type Expression</b></font><br>";
	}


if ($NUM>1)
	{
print "<img id=\"img4\" src=\"plus-box.gif\" onclick=\"
if (gene_wild.style.display=='block')
	{
	img4.src='plus-box.gif';
	gene_wild.style.display='none';
	}
else
	{
	img4.src='min-box.gif';
	gene_wild.style.display='block';
	}

\">&nbsp;";
print "<font color=\"#656565\" size=\"2\"><b>$NUM Genes with description of Wild Type Expression</b></font><br>";
	}

if ($NUM==0)
	{
	print "<img id=\"img4\" src=\"min-box.gif\">&nbsp;";
	print "<font color=\"#656565\" size=\"2\"><b>No Genes with description of Wild Type Expression</b></font><br><br>";
	}

print "<div id=\"gene_wild\" style=\"display:none;\">";

print "<table width=\"100%\" style=\"border: 1px dashed black;\" >";
print "<tr><td align=\"center\"><font size=\"-1\" color=\"#456898\">Gene</font></td><td align=\"center\"><font size=\"-1\" color=\"#456898\">Evidence</font></td></tr>";

$I=0;
while ($row=pg_fetch_array($stmt))
{

$requete0="
select \"GENE_CLUSTER_NAME\" as \"NAME\" 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["TRANSCRIPT"]."'
)
)
";
$stmt0=pg_query($c,$requete0);
if (pg_num_rows($stmt0)==0)
	{
	$requete0="
	select \"GENE_CLUSTER_NAME_BLAST\" as \"NAME\" from \"GENE_CONCEPT_NAME_BLAST\" where \"GENE_CLUSTER_ID\"=(
	select \"GENE_CLUSTER_ID\" from \"GENE_CONCEPT\" where \"GENE_MODEL_ID\"=(
	SELECT \"GENE_ID\" from \"GENE\" where \"NAME\"='".$row["TRANSCRIPT"]."'
	)
	)
	";
	$stmt0=pg_query($c,$requete0);
	}

$gname="";
while ($row0=pg_fetch_array($stmt0))
	{
	if (strlen($gname)==0) $gname=$row0["NAME"];
	else $gname.=" / ".$row0["NAME"];
	}

$requete0="SELECT \"GENE_CLUSTER_ID\" from \"GENE_CONCEPT\" where \"GENE_MODEL_ID\"=(
select \"GENE_ID\" from \"GENE\" where \"NAME\"='".$row["TRANSCRIPT"]."'
)";
$stmt0=pg_query($c,$requete0);
$row0=pg_fetch_array($stmt0);
$clustid=$row0["GENE_CLUSTER_ID"];


if ($I%2==0) {$color="#DDDDDB";$fcolor="black";} else {$color="#AAAAAA";$fcolor="black";}
print "<tr><td  style=\"background-color:$color;color:$fcolor;\" align=\"center\"><font size=\"-1\"><a target=\"blank\" href=\"gene-card.php?clusterid=$clustid\">$gname</a></font></td>
<td style=\"background-color:$color;color:$fcolor;\" align=\"center\"><font size=\"-1\"><a target=\"blank\" href=\"article-gene-WT.php?id=$id&gene=".$row["TRANSCRIPT"]."\">Show evidence</a></font></td>

</tr>";

$I++;




}

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



///////////////////////////////////////////////////////// MORPHOGENETIC PROCESS  /////////////////////////////////////////////////////////////////////



//$requete="SELECT * from \"ARTICLE_MORPHOGEN\" where \"ARTICLE_ID\"='$id' and \"PRIVATE\"='n' and \"CHECKED\"='y'";
$requete="SELECT * from \"ARTICLE_MORPHOGEN\" where \"ARTICLE_ID\"='$id'";
$stmt=pg_query($c,$requete);
$NUM=pg_num_rows($stmt);

if ($NUM==1)
	{

print "<img id=\"img5\" src=\"plus-box.gif\" onclick=\"
if (morpho.style.display=='block')
	{
	img5.src='plus-box.gif';
	morpho.style.display='none';
	}
else
	{
	img5.src='min-box.gif';
	morpho.style.display='block';
	}

\">&nbsp;";
print "<font color=\"#656565\" size=\"2\"><b>Morphological Phenotypes ($NUM result)</b></font><br>";
	}


if ($NUM>1)
	{
print "<img id=\"img5\" src=\"plus-box.gif\" onclick=\"
if (morpho.style.display=='block')
	{
	img5.src='plus-box.gif';
	morpho.style.display='none';
	}
else
	{
	img5.src='min-box.gif';
	morpho.style.display='block';
	}

\">&nbsp;";
print "<font color=\"#656565\" size=\"2\"><b>Morphological Phenotypes  ($NUM results)</b></font><br>";
	}

if ($NUM==0)
	{
	print "<img id=\"img5\" src=\"min-box.gif\">&nbsp;";
	print "<font color=\"#656565\" size=\"2\"><b>Morphological Phenotypes  (No result)</b></font><br><br>";
	}

print "<div id=\"morpho\" style=\"display:none;\">";

print "<table width=\"100%\" style=\"border: 1px dashed black;\">";
print "<tr><td align=\"center\"><font size=\"-1\" color=\"#456898\">Morphological Phenotypes Name</font></td><td align=\"center\"><font size=\"-1\" color=\"#456898\">Gene</font></td><td align=\"center\"><font size=\"-1\" color=\"#456898\">Comments</font></td><td align=\"center\"><font size=\"-1\" color=\"#456898\">Developmental stage</font></td><td align=\"center\"><font size=\"-1\" color=\"#456898\">Pictures</font></td></tr>";

$I=0;

while ($row=pg_fetch_array($stmt))
{


$comments=$row["COMMENTS"];
$mname=$row["NAME"];
$devid=$row["DEV_STAGE_ID"];

$requete0="SELECT \"NAME\" from \"DEV_STAGE\" where \"DEV_STAGE_ID\"='$devid'";
$stmt0=pg_query($c,$requete0);
$row0=pg_fetch_array($stmt0);
$devname=$row0["NAME"];

if (strlen($devname)==0) $devname="<i>No data</i>";


$requete0="
select \"GENE_CLUSTER_NAME\" as \"NAME\" 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["TRANSCRIPT"]."'
)
)
";
$stmt0=pg_query($c,$requete0);
if (pg_num_rows($stmt0)==0)
	{
	$requete0="
	select \"GENE_CLUSTER_NAME_BLAST\" as \"NAME\" from \"GENE_CONCEPT_NAME_BLAST\" where \"GENE_CLUSTER_ID\"=(
	select \"GENE_CLUSTER_ID\" from \"GENE_CONCEPT\" where \"GENE_MODEL_ID\"=(
	SELECT \"GENE_ID\" from \"GENE\" where \"NAME\"='".$row["TRANSCRIPT"]."'
	)
	)
	";
	$stmt0=pg_query($c,$requete0);
	}

$gname="";
while ($row0=pg_fetch_array($stmt0))
	{
	if (strlen($gname)==0) $gname=$row0["NAME"];
	else $gname.=" / ".$row0["NAME"];
	}

$requete0="SELECT \"GENE_CLUSTER_ID\" from \"GENE_CONCEPT\" where \"GENE_MODEL_ID\"=(
select \"GENE_ID\" from \"GENE\" where \"NAME\"='".$row["TRANSCRIPT"]."'
)";
$stmt0=pg_query($c,$requete0);
$row0=pg_fetch_array($stmt0);
$clustid=$row0["GENE_CLUSTER_ID"];


if ($I%2==0) {$color="#DDDDDB";$fcolor="black";} else {$color="#AAAAAA";$fcolor="black";}
print "<tr>
<td  style=\"background-color:$color;color:$fcolor;\" align=\"center\"><font size=\"-1\">$mname</font></td>
<td  style=\"background-color:$color;color:$fcolor;\" align=\"center\"><font size=\"-1\"><a target=\"blank\" href=\"gene-card.php?clusterid=$clustid\">$gname</a></font></td>
<td  style=\"background-color:$color;color:$fcolor;\" align=\"center\"><font size=\"-1\">$comments</font></td>
<td  style=\"background-color:$color;color:$fcolor;\" align=\"center\"><font size=\"-1\">$devname</font></td>
<td style=\"background-color:$color;color:$fcolor;\" align=\"center\"><font size=\"-1\"><a target=\"blank\" href=\"view-morphogen.php?morphoid=".$row["MORPHOGEN_ID"]."\">View</a></font></td>

</tr>";

$I++;


}


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






///////////////////////////////////////////////////////// ISH  /////////////////////////////////////////////////////////////////////

$requete="select \"IN_SITU_ID\" from \"IN_SITU\" where \"IN_SITU_ID\" in (SELECT \"BIO_ID\" from \"REFERENCE\" where \"PUBMED_ID\"='$pmid') and \"PRIVATE\"='n' and \"CHECKED\"='y'";
$stmt=pg_query($c,$requete);
$NUM=pg_num_rows($stmt);

if ($NUM==0) $NUM="No";
if ($NUM==0) print "<img src=\"point-box.gif\">&nbsp;<font color=\"#656565\" size=\"2\"><b>In Situ data related to this Article ($NUM result) </b>&nbsp;&nbsp";
if ($NUM==1) print "<img src=\"point-box.gif\">&nbsp;<font color=\"#656565\" size=\"2\"><b>In Situ data related to this Article ($NUM result) </b>&nbsp;&nbsp";
if ($NUM>1) print "<img src=\"point-box.gif\">&nbsp;<font color=\"#656565\" size=\"2\"><b>In Situ data related to this Article ($NUM results) </b>&nbsp;&nbsp";
if ($NUM!=0) print "<a target=\"blank\" href=\"insitu-result.php?pmid=$pmid\"> View </a> </font>";

print "<br><br>";

///////////////////////////////////////////////////////// MOLECULAR TOOLS //////////////////////////////////////////////////////////
//$requete="select \"MOLECULAR_TOOL_ID\" from \"MOLECULAR_TOOL\" where \"MOLECULAR_TOOL_ID\" in (SELECT \"BIO_ID\" from \"REFERENCE\" where \"PUBMED_ID\"='$pmid')";

//$requete="select \"MOLECULAR_TOOL_ID\" from \"MOLECULAR_TOOL\" where \"ASSOCIATED_GENE_ID\" in (select \"GENE_MODEL_ID\" from \"GENE_CONCEPT\" where \"GENE_CLUSTER_ID\"=(select \"GENE_CLUSTER_ID\" from \"GENE_CONCEPT\" where \"GENE_MODEL_ID\" in (select \"GENE_ID\" from \"GENE\" where \"NAME\" in (SELECT \"TRANSCRIPT\" from \"ARTICLE_GENE\" where \"ARTICLE_ID\"='$id'))))";


$requete="



select \"MOLECULAR_TOOL_ID\" from \"MOLECULAR_TOOL\" where \"ASSOCIATED_GENE_ID\" in (
select \"NAME\" from \"GENE\" where \"GENE_ID\" in (
select \"GENE_MODEL_ID\" from \"GENE_CONCEPT\" where \"GENE_CLUSTER_ID\" in (
select \"GENE_CLUSTER_ID\" from \"GENE_CONCEPT\" where \"GENE_MODEL_ID\" in(
select \"GENE_ID\" from \"GENE\" where \"NAME\" in (
select distinct \"TRANSCRIPT\" from \"ARTICLE_GENE\" where \"ARTICLE_ID\"='$id'
)
)
)
)
) 
and \"MOLECULAR_TOOL_ID\" in (
select \"BIO_ID\" from \"REFERENCE\" where \"PUBMED_ID\"='$pmid'
)


";


$stmt=pg_query($c,$requete);
$NUM=pg_num_rows($stmt);

if ($NUM==0) $NUM="No";
if ($NUM==0) print "<img src=\"point-box.gif\">&nbsp;<font color=\"#656565\" size=\"2\"><b>Molecular Tool used in this Article ($NUM result) </b>&nbsp;&nbsp ";
if ($NUM==1) print "<img src=\"point-box.gif\">&nbsp;<font color=\"#656565\" size=\"2\"><b>Molecular Tool used in this Article ($NUM result) </b>&nbsp;&nbsp ";
if ($NUM>1) print "<img src=\"point-box.gif\">&nbsp;<font color=\"#656565\" size=\"2\"><b>Molecular Tools used in this Article ($NUM results) </b>&nbsp;&nbsp ";
if ($NUM!=0) print "<a target=\"blank\" href=\"moltool-result.php?id=$id&pmid=$pmid\"> View </a> </font>";
print "<br><br>";

///////////////////////////////////////////////////////// REGULATORY REGION //////////////////////////////////////////////////////////

/*$requete="
select \"BIO_ID\" from \"REFERENCE\" where \"BIO_ID\" in (
select \"IN_SITU_ID\" from \"TARGET\" where \"TARGET_ID\" in (
select \"CONSTRUCTION_ID\" from \"CONSTRUCTION\")
)
and \"PUBMED_ID\"='$pmid'
";
*/
/*
$requete="
select \"BIO_ID\" from \"REFERENCE\" where \"BIO_ID\" in (
select \"PROMOTER_ID\" from \"PROMOTER\" where \"PRIVATE\"='n' and \"CHECKED\"='y'
)
and \"PUBMED_ID\"='$pmid'
";
*/

$requete="SELECT \"PROMOTER_ID\" from \"PROMOTER\" where \"BASE_REG_ID\" in (select \"BIO_ID\" from \"REFERENCE\" where \"PUBMED_ID\"='$pmid') and \"PRIVATE\"='n' and \"CHECKED\"='y'";




$stmt=pg_query($c,$requete);
$NUM=pg_num_rows($stmt);
if ($NUM==0) $NUM="No ";
if ($NUM==0) print "<img src=\"point-box.gif\">&nbsp;<font color=\"#656565\" size=\"2\"><b>Cis-regulatory region related to this Article ($NUM result) </b>&nbsp;&nbsp ";
if ($NUM==1) print "<img src=\"point-box.gif\">&nbsp;<font color=\"#656565\" size=\"2\"><b>Cis-regulatory region related to this Article ($NUM result) </b>&nbsp;&nbsp ";
if ($NUM>1) print "<img src=\"point-box.gif\">&nbsp;<font color=\"#656565\" size=\"2\"><b>Cis-regulatory regions related to this Article ($NUM results) </b>&nbsp;&nbsp ";

if ($NUM!=0) print "<a target=\"blank\" href=\"reg-region-search-results.php?reg_type=-----ANY-----&species=-----ANY-----&target=&name=&pmid=$pmid\"> View </a> </font>";

print "<br><br>";


////////////////////////////////
// print "</div>";




////////////////////////////////////////////////// PICTURES /////////////////////////////////////////////////////////////////////
$requete="select \"PICTURE_ID\",\"IN_SITU_ID\",\"PATH\" from \"PICTURE\" where \"IN_SITU_ID\" in(

select \"IN_SITU_ID\" from \"IN_SITU\" where \"CHECKED\"='y' and \"PRIVATE\"='n' and \"IN_SITU_ID\" in (
select \"BIO_ID\" from \"REFERENCE\" where \"PUBMED_ID\"='$pmid'
)

)";
$stmt=pg_query($c,$requete) or die ("Error");

$NUM=pg_num_rows($stmt);



if ($NUM>1)
{
print "<img id=\"img6\" src=\"plus-box.gif\" onclick=\"
if (picture.style.display=='block')
	{
	img6.src='plus-box.gif';
	picture.style.display='none';
	}
else
	{
	img6.src='min-box.gif';
	picture.style.display='block';
	}

\">&nbsp;";
if ($NUM>=200)
	{
print "<font color=\"#656565\" size=\"2\"><b>Pictures  ($NUM results)</b> too many results</font>&nbsp;&nbsp;<small><i><b><font color=\"red\">New</font></b></i></small><br>";
	}
else print "<font color=\"#656565\" size=\"2\"><b>Pictures  ($NUM results)</b></font>&nbsp;&nbsp;<small><i><b><font color=\"red\">New</font></b></i></small><br>";


}

if ($NUM==0)
	{
	print "<img id=\"img6\" src=\"min-box.gif\">&nbsp;";
	print "<font color=\"#656565\" size=\"2\"><b>Pictures  (No result)</b></font>&nbsp;&nbsp;<small><i><b><font color=\"red\">New</font></b></i></small><br><br>";
	}





print "<div id=\"picture\" style=\"display:none;\">";
print "<center>";
print "<br>";
if ($NUM<200)
{
while ($row=pg_fetch_array($stmt))
{
if (strstr($row["PATH"],"mix")) continue;
 if (strlen($row["PATH"])==0) print "<a target=\"_blank\" href=\"http://crfb.univ-mrs.fr/aniseed/insitu.php?id=".$row["IN_SITU_ID"]."\"><img border=\"0\" width=\"80\" src=\"picture-mini.php?id=".$row["PICTURE_ID"]."\"></a>&nbsp;";
 else print "<a target=\"_blank\" href=\"http://crfb.univ-mrs.fr/aniseed/insitu.php?id=".$row["IN_SITU_ID"]."\"><img border=\"0\" width=\"80\" src=\"http://crfb.univ-mrs.fr/aniseed/picturesDB/".$row["PATH"]."\"></a>&nbsp;";
}
}
print "</center>";
print "<br><br>";
////////////////////////////////
print "</div>";




include ("frames_footer.php");
?>