<html>
<head>
<title>ANISEED - Ciona intestinalis construct</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="In Aniseed, a Ciona intestinalis regulatory activity of a region is tested through constructs. These are molecular entities used to store spatial and temporal data of expression assays.">
<meta name="keywords" content="Lemaire, Tassy, regulatory region, construct, expression data, transcription factor, regulatory motif, sequence, Ciona intestinalis, Halocynthia roretzi, Aniseed, 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 ("frames_header.php"); 
	include("connection.php");

	//CONSTRUCTION_ID
	$id = $_GET["constructid"];	
	
	$khoueiry = "SELECT * FROM \"CONSTRUCTION\" WHERE \"CONSTRUCTION_ID\"=".$id.";";		
	$stmt = pg_query($c,$khoueiry);
	if($row=pg_fetch_array($stmt)){
		$stable_id = $row["STABLE_ID"];
	    $name=$row["NAME"];
	    $comments=$row["COMMENTS"];
	    $promoter_id = $row["PROMOTER_ID"];
	    $reporter = $row["REPORTER_ID"];
	    $min_prom_id=$row["MIN_PROMOT_ID"];	
		$stable_id=$row["STABLE_ID"];	
		$rep_name=$row["REPORTER_GENE"]; 
			    
	    $promoter_name = "Undefined Regulatory Region";
		$khoueiry = "SELECT \"STABLE_ID\", \"NAME\" FROM \"PROMOTER\" WHERE \"PROMOTER_ID\"=".$promoter_id.";";		
		$stmt = pg_query($c,$khoueiry);
		if($row=pg_fetch_array($stmt)){			  
			$promoter_stable_id = $row["STABLE_ID"];
			$promoter_name = $row["NAME"];
		}	    	    	    
		
	    
	    $min_prom_name = "Undefined Minimal Promoter";
	    if($promoter_id==$min_prom_id){
			$min_prom_name = "Endogenous Promoter";
		} else {
			$khoueiry = "SELECT \"NAME\" FROM \"PROMOTER\" WHERE \"PROMOTER_ID\"=".$min_prom_id.";";		
			$stmt = pg_query($c,$khoueiry);
			if($row=pg_fetch_array($stmt)){			  
				$min_prom_name = $row["NAME"];
			}
		}	    
	}
	
   
    print "<strong>Construct <em><font size=\"-1\"> ".$stable_id."</font>: ".$name."</em></strong> <a href=\"insitu-result.php?target=".$stable_id."&MOLtype=1\" target=\"_blank\"> (View Insitu data) </a><br/>";
	if(!is_null($promoter_id)){	
		print "<strong>This construct is testing Regulatory Region <font size=\"-1\"> $promoter_stable_id </font>: </strong><a target=\"_BLANK\" href=\"reg-region-view.php?id=$promoter_id\">$promoter_name</a><br/><br/>";
	}
    print "<u><strong>Features:</strong></u><br><br/>";
	print "<strong>Name: </strong>".$name."<br><br/>";		
    print "<strong>Comments:</strong> ".$comments."<br/><br/>";  
	
	if(!is_null($min_prom_id)){	
	    print "<strong>Minimal Promoter: </strong>";  
		if($promoter_id==$min_prom_id){
			print "Endogenous Promoter<br/><br/>"; 	  
		} else {
			if($min_prom_name == "Undefined Minimal Promoter"){
				print $min_prom_name."<br/><br/>";
			} else {
				print "<a target=\"_BLANK\" href=\"reg-region-view.php?id=$min_prom_id\">$min_prom_name</a><br/><br/>"; 
			}
		}
	}
	
	$khoueiry = "SELECT \"NAME\" FROM \"MOLECULAR_TOOL\" WHERE \"MOLECULAR_TOOL_ID\"=$reporter;";
	$stmt = pg_query($c,$khoueiry);		
	if($row=pg_fetch_array($stmt)){ 
		print "<strong>Reporter:</strong> ".$row["NAME"]."<br/><br/>";	 
	} else {
		if($rep_name != ''){
			print "<strong>Reporter:</strong> ".$rep_name."<br/><br/>";			
		} else {
			print "<strong>Reporter:</strong> Unable to determine the reporter element used<br/><br/>";
		}
	}
			
	include ("frames_footer.php"); 

?>