#!/usr/bin/perl -w
use File::Spec;
use CGI;
use POSIX;
$cgi = new CGI;
print $cgi->header();
$cgi->start_html(-title=>'Scan for Motifs inputs');
########################################################################################################
################################### START SESSION ID ##############################################
 $time = localtime(time);
# $time1 =time;
 $time =~ s/\s/_/g;
 $time =~ s/:/./g;
 $idnumber = $time;
 $idnumber .= "_";
 for (my $i = 0; $i < 5; $i++)
     {
       $idnumber .= int (rand 10);
     }
     
################################## END SESSION ID #################################################  
my $client_ip = $ENV{'REMOTE_ADDR'};
my $client_proxy=$ENV{'HTTP_X_FORWARDED_FOR'};
my $referrer=$ENV{'HTTP_REFERER'}; 
my $contents = $ENV{'QUERY_STRING'};

if(not defined $client_proxy){$client_proxy=$client_ip;}
if(not defined $referrer or $referrer!~/otago\.ac\.nz/)
	{
		system("echo '$client_proxy from $client_ip  \t$time \t No referrer, Terminated.\t $contents' >>/PROJECTS/ACCESS_DETAILS_OF_ALL_PROJECTS/ACCESS_DETAILS.txt");
		exit;
	}
	
#my $l_time=localtime(time);

#open(APP,">>/PROJECTS/ACCESS_DETAILS_OF_ALL_PROJECTS/ACCESS_DETAILS.txt");
#flock(APP,2);
#print APP "$client_proxy from $client_ip  \tSFM \t$referrer\t TIME=$l_time\n";
#close(APP);
   


##########################################################

############# create a log file
$log_file=$idnumber."_LOG.LOG";
open(WR_LOG,">tmp/$log_file") or print "$!";
print WR_LOG "OK\n";
close(WR_LOG);
		
system("chmod 777 tmp/$log_file");	

############################## 


##########################################################
#exit;


print qq~
<!DOCTYPE XHTML 1.1 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html style="height:99%" xmlns="http://www.w3.org/1999/xhtml">
<head>

<title>Scan for Motifs input</title>
<link href="./imgs/logo_1.ico" rel="shortcut icon">
<meta name="generator" content="ZZEE Art HTML Listing">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript" src="./js/ajax_database_lookup_main.js"></script>
<script type="text/javascript" src="./js/ajax_show_sample_sequence.js"></script>
<script type="text/javascript" src="./js/ajax_load_transterm_elements.js"></script>

<script src="./overlay_files/jquery.tools.min.js"></script>






	<!-- standalone page styling (can be removed) -->
	<link rel="stylesheet" type="text/css" href="./overlay_files/standalone.css">	
	<link rel="stylesheet" type="text/css" href="./overlay_files/overlay-basic.css">
	
	
<script>	



\$(document).ready(function()
	{
		//alert( "ready!" );
		loadTranstermElements('SFM_AJAX_SCRIPTS/load_transterm_elements.pl','t_elements');
		\$("img[rel]").overlay();
	});	
	
	
		

		
  </script>	
		
<style type="text/css">
	/* some styling for triggers */
	#triggers {
		text-align:center;
	}
	
	#triggers img {
		cursor:pointer;
		//margin:0 5px;
		background-color:#fff;
		border:1px solid #ccc;
		//padding:2px;
	
		-moz-border-radius:4px;
		-webkit-border-radius:4px;
		
	}
	
	
	
	/* styling for elements inside overlay */
	.details {
		position:absolute;
		top:15px;
		left:15px;
		right:15px;
		font-size:11px;
		color:#fff;
		//width:150px;
	}
	
	.details h3 {
		color:#aba;
		font-size:15px;
		//margin:0 0 -10px 0;
	}
	</style>
	
	

<style type="text/css">
<!--
	body
	{	
		font-family: verdena;
		font-size: 15px;
	 	background-color: #ffffff;
		color: #000000;
		text-align: left;
	}
	img {
		border-style: none;
		}
	ul.zzul {list-style-type:none; display: block;}
	span.zzspace {left:11px;}
	a, a:visited {color: #0000ff;}
	a:hover { color: #ff0000;}
	.style2{
			font-family: verdena;
			font-size: 11pt;
			background-color: #6699FF;    /* this #6699ff is the color of the active tab*/
			
			color: white; 				 /* #000000;*/
			text-align: center;
			
			}
	.style3{
			font-family: verdena;
			font-size: 11pt;
			/* background-color: #AEB404; */
			color: #000000;
			text-align: left;
			}
			
input.btn,select.btn{
				color:#006666;
				font-family:'arial',helvetica,sans-serif;
				font-size:85%;
				font-weight:bold;
				background-color:white;
				border:1px solid;
				border-top-color:#696;
				border-left-color:#696;
				border-right-color:#363;
				border-bottom-color:#363;
				/* filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ffffffff',EndColorStr='#ffeeddaa'); */
				}

			input.btnhov{
			   border-top-color:#c63;
			   border-left-color:#c63;
			   border-right-color:#930;
			   border-bottom-color:#930;}
.showRow{
			display:block;
			width:100%;
		}					
.hideRow{
			display:none;
			width:100%;
		}
.transparent_div
{
  /* filter:alpha(opacity=90); 
   -moz-opacity: 0.9; 
   */
   opacity: 0.9; 
}
		
				
-->
</style>



<!-- ######################## End of CSS Styles ##################### -->



</head>
<body style="height:100%; margin:0px;padding:1px;overflow:auto;background-color:white">
<form id="scan_for_motifs" name="scan_for_motifs" action="./sfm_main_display.pl" target="_blank" method="post" enctype="multipart/form-data">			



<table align=center style="width:850px;background-color:#e6e6e1">

	<tr>
	<td style="width:100%;border:1px solid white;vertical-align:top;"><img src="./imgs/header.png"></img></td>
	</tr>
	
	<tr>
	<td style="width:100%;border:0px solid green;">


		<div style="position:absolute;top:6px; height:20px; z-index:99999; border:0px solid orange;overflow:hidden; overflow-x:hidden;display:'block';">
		<div style="float:left; height:20px; width:575px; z-index:99999; border:0px solid orange;overflow:hidden; overflow-x:hidden;display:'block';"></div>
		<div style="float:right; height:20px; z-index:99999; border:1px solid golden;overflow:hidden; overflow-x:hidden;display:'block';">
			<div style="float:left;top:-3px; "><a href="./sfm_help.html" target="_blank" style="text-decoration:none;border-style:none;font:15px verdena;color:#2E64FE;" onMouseOver=this.style.backgroundColor='white' onMouseOut=this.style.backgroundColor='#F7CA00'>HELP/CITE</a></div><div style="float:left; width:15px;">&nbsp;</div>
			<div style="float:left;top:-3px; "><a href="./sfm_help.html" target="_blank" style="text-decoration:none;border-style:none;font:15px verdena;color:#2E64FE;" onMouseOver=this.style.backgroundColor='white' onMouseOut=this.style.backgroundColor='#F7CA00'>CONTACT</a></div><div style="float:left; width:15px;">&nbsp;</div>
			<div style="float:left;top:-3px; "><a href="http://bioanalysis.otago.ac.nz/" target="_blank" style="text-decoration:none;border-style:none;font:15px verdena;color:#2E64FE;" onMouseOver=this.style.backgroundColor='white' onMouseOut=this.style.backgroundColor='#F7CA00'>RELATED SITES</a></div><div style="float:left; width:15px;">&nbsp;</div>
			<div style="float:left;top:-3px; "><a href="./sfm_help.html#references" target="_blank" style="text-decoration:none;border-style:none;font:15px verdena;color:#2E64FE;" onMouseOver=this.style.backgroundColor='white' onMouseOut=this.style.backgroundColor='#F7CA00'>REFERENCES</a></div>
		</div>
		</div>

	</td>
	</tr>
<tr>
	<td style="width:100%;border:1px solid white">
	<table id="maintable" style="width:99%">	
	<tr>
	<td style="width:100%;border:0px solid white">
		<div>
			<div style="float:left;width:52%;">1. Enter human a gene symbol to fetch a 3'UTR alignment (e.g. "TNF") :</div>		
			<div style="float:left;width:45%;height:100%;"><input type="text" id="gene_name" name="gene_name" style="width:365px; height:85%; border:1px solid red;" onKeyup='ajaxDatabaseLookupMain("./SFM_AJAX_SCRIPTS/search_database_main.pl");' value="">&nbsp;</div>
			<div style="float:left;position:relative;left:-89px; z-index:9999;display:none;overflow:hidden;width:16px;height:100%;" id='main_db_search_loader' class="transparent_div" ><IMG id="align_loader" src=./images/ajax_loader.gif style="display:block; border-style:none; width:16px;height:16px;"/></div> 
			 <div style="float:left;"><a href="./sfm_help.html#gene_symbol" target="_blank" class="" title="Refer help document for more information." style="text-decoration:none;"><div style="position:relative;top:3px;right:70px;"><img src="./images/icn_quickhelp.gif"></div></a></div>
		</div>
		
	</td>
	</tr>
	
	
	<tr>
	<td style="border:0px solid white;">
		<div>
			<div style="float:left;width:52%;">&nbsp;
			<script type="text/javascript">
			<!--
			setTimeout("document.getElementById('result').style.display='none'", 13000);			

			function HidePopup_rs() 
				{ 
					hp = document.getElementById("result"); 
					timer=setTimeout("document.getElementById('result').style.display='none'", 14000);
					//hp.style.display = "none"; 
				}
			function KeepPopup_rs() 
				{ 
					hp = document.getElementById("result");
					hp.style.display = "block"; 
					if(timer){clearTimeout(timer);}
					timer=setTimeout("document.getElementById('result').style.display='none'", 14000);
					
				}	
				
			-->
			</script>
			
			</div>		
			<div style="z-index:99999;float:left;width:45%;height:100%;" onmouseover="KeepPopup_rs();" onmouseout="HidePopup_rs();">			
				<div id="result" name="result" style="position:absolute;top:190px;z-index:99999; background-color:white;border:1px solid orange;overflow:auto; overflow-x:hidden; height:auto; width:363px; display:'none';"></div>
			</div>
		</div>		
	</td>
	</tr>
	
	<tr>
	<td style="border:0px solid white;" align=center><b><font color=red>OR</font></b></td>
	</tr>
	
	<script type="text/javascript"> 
	//hp = document.getElementById("sample_sequence_div");
		function ShowPopup(hoveritem,seq_format) 
			{ 
				hp = document.getElementById("sample_sequence_div");

					// Set popup to visible 
				if ( hp.style.visibility!= "visible" )
					{ 
						//hp.style.top = hoveritem.offsetTop + 50; 
						//hp.style.left = hoveritem.offsetLeft + 40;

						hp.style.visibility = "visible"; 
						
							// now call the axax function to show the sample sequences
						ajaxShowSampleSequence("./SFM_AJAX_SCRIPTS/show_sample_sequence.pl",seq_format);	
					}
				else{
						hp.style.visibility = "hidden";
					}	
			}
			
		function HidePopup() 
			{ 
				hp = document.getElementById("sample_sequence_div"); 
				timer1=setTimeout("hp.style.visibility = 'hidden'",18000); 
				clearTimeout(timer1);
			}
			
		function KeepPopup(hoveritem) 
			{ 
				hp = document.getElementById("sample_sequence_div");
				clearTimeout(timer1);
						// Set popup to visible 
				//hp.style.top = hoveritem.offsetTop; 
				//hp.style.left = hoveritem.offsetLeft;

				hp.style.visibility = "visible"; 
			}


		function use_sample_sequence() 
			{ 
				hp = document.getElementById("sample_sequence_div");
				var text_area_content = document.getElementById("fill_sequence").value;
				document.getElementById("user_seq").value=text_area_content;
				
				hp.style.visibility = "hidden";
			}
		function H_Popup() 
			{ 
				hp = document.getElementById("sample_sequence_div"); 
				
				hp.style.visibility = "hidden";
				if(timer1){clearTimeout(timer1);}
			}
			
		</script>
	
	<script type=\"text/javascript\">	
		function clear_textbox()
			{
				document.getElementById("user_seq").value='';
				return 1;
			}
	</script>
	
	<tr>
	<td style="border:0px solid white;">Search your own sequence or alignment for regulatory elements :
	
	
	
		<div id="sequence_formats" style="position:relative;left:20px;color:gray;">
			<div style="float:left;">[ The following three formats are supported:</div><div style="float:left;width:10px;">&nbsp;</div>
			<div id="sample_1" style="float:left;"><a href="javascript:;" onclick="ShowPopup(this,'sample_1');" style="text-decoration:none;">1. FASTA/MultiFASTA</a>&nbsp;</div>
			<div style="float:left;width:10px;">&nbsp;</div>
			<div id="sample_2" style="float:left;"><a href="javascript:;" onclick="ShowPopup(this,'sample_2');" style="text-decoration:none;">2. Tabular MSA</a><font style="color:gray">&nbsp;</font></div>
			<div style="float:left;width:10px;">&nbsp;</div>
			<div id="sample_2" style="float:left;"><a href="javascript:;" onclick="ShowPopup(this,'sample_3');" style="text-decoration:none;">3. ClustalW (.aln)</a><font style="color:gray"> ]</font></div>
			<div style="float:left;width:150px;">&nbsp;</div>
			<div style="float:right;top:20px;right:20px;bottom:-20px;width:20px;"><a href="javascript:;" onclick="clear_textbox();" class="" title="Click to clear the content of the textbox below" style="text-decoration:none;"><div style="position:relative;top:3px;"><img src="./imgs/clear1.png"></div></a></div>			
		</div>	
		
      </td>
    </tr>
    
    
  
    
    
    <tr>
      <td class="userseq" style="width:100%; border:0px solid red">
		  <div class="transparent_div" id="sample_sequence_div" style="z-index:999;visibility:hidden; position: absolute; width:970px; height:130px; border:1px solid white; background-color:#A9D0F5;" >
				<div style="position:relative;width:99%;border:0px solid silver;text-align:right;">
					<div id="" style="position:relative;border:0px solid white;height:20px;"><div style="position:relative;right:300px;"><a href="javascript:;" onclick="use_sample_sequence();">Use This Sequence</a></div><div style="position:absolute;right:-20px;top:-15px;"><a href="javascript:;" onclick="H_Popup();" style="text-decoration:none;"><img src="./images/close.png" style="border:none;"></a></div></div>
				</div>
				<div style="position:relative;border-left:5px solid #A9D0F5;border-right:5px solid #A9D0F5;border-bottom:5px solid #A9D0F5; height:175px; background-color:#A9D0F5;">
					<textarea id="fill_sequence" style="width:99%;border:1px solid #A9D0F5;overflow:auto;white-space:nowrap;" rows="10"></textarea>
				</div>
				
		  </div>
		
		
		 <div>
			<textarea id="user_seq" name="user_seq" style="width:100%;border:1px solid #A9D0F5;overflow:auto;wrap="soft" rows="8"></textarea>
			</div>
        
      </td>
    </tr>
    <tr>
	<td style="border:0px solid white;" align=center><b><font color=red>OR</font></b></td>
	</tr>
    
    
    <tr>
    <td>
    <div style="float:left;">Upload file containing the sequence in FASTA/multiFASTA/tabular MSA/ClustalW alignment format :&nbsp;</div>
    <div style="float:left;"><a href="./sfm_help.html#supported_formats" target="_blank" class="" title="Refer help document for more information." style="text-decoration:none;"><div style="position:relative;top:3px;"><img src="./images/icn_quickhelp.gif"></div></a></div>
    </td>
    </tr>
    
    <tr>
     <td><div style="float:left;"><input type="file" name="uploaded_file" size="40"></div><br></td>
    </tr>

    
  </tbody>
</table>
</td>
</tr>
<script type="text/javascript">
	<!--
		function update_all_tt_element()	
		{
			var elem =  document.getElementById('scan_for_motifs').elements;
					//alert(elem);
					
			var fp_cutoff_value=document.getElementById("fp_cutoff_score").value;
			
					//alert(fp_cutoff_value);
								
			for(var i = 0; i < elem.length; i++)
				{
					var tmp_id=elem[i].id;
							
					if(tmp_id=='TT_pattern')
						{
									var tmp_id_fp_value=elem[i].getAttribute("FP_VALUE");
									
									//alert(tmp_id_fp_value);
									if(tmp_id_fp_value <= fp_cutoff_value)
										{
											elem[i].checked=true;
										}
									else{
											elem[i].checked=false;
										}		
						}							
				} 
		}
		
	
	
	function check_uncheck_tt_element()	
		{
			var elem =  document.getElementById('scan_for_motifs').elements;
					//alert(elem);
			var main_tt_check_btn_status=document.getElementById("transterm_elements");	
			
			var fp_cutoff_value=document.getElementById("fp_cutoff_score").value;
					
			for(var i = 0; i < elem.length; i++)
				{
					var tmp_id=elem[i].id;
							
					if(tmp_id=='TT_pattern')
						{
							var tmp_id_fp_value=elem[i].getAttribute("FP_VALUE");
							
							if(main_tt_check_btn_status.checked==true)
								{
									if(tmp_id_fp_value <= fp_cutoff_value)
										{
											elem[i].checked=true;
										}
									else{
											elem[i].checked=false;
										}
								}
							else{
									elem[i].checked=false;
								}		
						}							
				} 
		}	

	-->	
</script>
<tr>
<td style="width:100%;border:1px solid white">
	<table style="width:100%;">
		<tr>
		<td colspan=1>2. Select one or more typers of translational control elements from the following:</td>
		</tr>		

		<tr>
		<td style="background-Color:white;">
		<div style="display:block;float:left;">
			<input type=checkbox id="transterm_elements" name="transterm_elements" onclick="check_uncheck_tt_element();" value="1" CHECKED>
				<b>A.</b>&nbsp;&nbsp;Automatically select all regulatory elements with an E-value <= <input type=text id="fp_cutoff_score" onchange="update_all_tt_element();" value="0.175" style="width:40px;border:1px solid red;color:green;"> per thousand bases from <a href="http://guinevere.otago.ac.nz/Transterm.html" target="_blank">TransTerm</a>.&nbsp;
		</div>
		<div style="float:left;"><a href="./sfm_help.html#transterm_elements" target="_blank" class="" title="Refer help document for more information." style="text-decoration:none;"><div style="position:relative;top:3px;"><img src="./images/icn_quickhelp.gif"></div></a></div>
		<div style="clear:both"></div>
		
		
		<div id="transterm_motifs_div" style="display:block;float:left;border:1px solid silver;min-width:980px;">
		<table style="border:0px solid blue;width:100%;min-width:970px;min-height:200px;">
		<tr>	
		<td style="vertical-align:top; width:50%;border:0px solid red;">	
		<div id="t_elements" name="t_elements" style="height:200px;width:100%;overflow:auto;border:0px solid blue;"><div style="text-align:center;"><img src="./imgs/loading_icon.gif"></div>
	~;

	

my $skip_1=0;
if($skip_1==1)
{	
	
	################################# query lancelot database
	use DBI;	
		$host="localhost";
		$db="tt2011";
		$user="Ambarish";
		$pwd="biswas1";
		$connectionInfo="dbi:mysql:$db;$host";
		# make connection to database
		$dbh = DBI->connect($connectionInfo,$user,$pwd);				
			
		$cmd_select="select * from Signal order by Name";	
		$sth = $dbh->prepare($cmd_select);	
		$sth->execute();

		while(@row=$sth->fetchrow_array())
			{
				#print "$row[0]  $row[1]<br>";
				for($i=0;$i<=$#row;$i++)
					{
						if(not defined $row[$i])
							{
								$row[$i]="NA";
							}
					}
					
					
					$signalid=$row[0];chomp $signalid;
				$publish=$row[1]; chomp $publish;
				$identifier=$row[2]; chomp $identifier;if(($identifier eq "") or ($identifier eq "NA")){next;}
					$dbid=$row[3]; chomp $dbid;
					$db_key=$row[4]; chomp $db_key;
				
				$pattern=$row[5]; chomp $pattern;
					$patsearch=$row[6]; chomp $patsearch;
					$rnamotifpattern=$row[7]; chomp $rnamotifpattern;
					$matrix=$row[8]; chomp $matrix;
					$description=$row[9]; chomp $description;
					$rfam=$row[10]; chomp $rfam;
					$utrdb=$row[11]; chomp $utrdb;
					$speciesdiscovered=$row[12]; chomp $speciesdiscovered;
				$species=$row[13]; chomp $species;		
				$falsepositive=$row[14]; chomp $falsepositive;	#$falsepositive=lc($falsepositive);	
					$humanhit=$row[15]; chomp $humanhit;
					$fiveutr=$row[16]; chomp $fiveutr;
					$cds=$row[17]; chomp $cds;
				$threeutr=$row[18]; chomp $threeutr;	
					$datemodified=$row[19]; chomp $datemodified;
				
				$modified_identifier=$identifier;
				$modified_identifier=~ s/\s+/_/g;
				if((not $publish eq "no") and (not $species eq "Prok") and (not $threeutr eq "No"))
					{
						#print "$identifier\t$species\t$threeutr\n";
						if($falsepositive!~/NA/ and $falsepositive < 0.175)
							{
								
								print qq~<div onmouseover="this.style.backgroundColor='silver';" onmouseout="this.style.backgroundColor='white';" style="float:left;border:1px solid #e6eae1;display:inline;color:black;width:99%"><div style="float:left;border:0px solid #e6eae1;"><input type=checkbox name="TT_$db_key" id="TT_pattern" FP_VALUE='$falsepositive' value='$falsepositive' CHECKED>$identifier</div><div id="triggers" style="float:right;"><img src="./images/info.png" title="Click to see more details" height=16 width=16 rel="#$db_key"></div></span></div>~;
								print qq~<div class="simple_overlay" id="$db_key"><a class="close"></a>
											<div class="details">
												<table style="width:100%;height:400px;border:2px solid white;font:15px times normal;background-color:white;color:black;">
												<tr><td style="height:30px;" align=center><h3>$identifier</h3></td></tr>
												<tr><td style="height:30px;"><u>Pattern :</u> $pattern</td></tr>
												<!--<tr><td><h4>$species</h4></td></tr>
												<tr><td><h4>$falsepositive</h4></td></tr>
												-->
												<tr><td style="width:100%; border:1px solid silver;"><div style="overflow:auto;width:830px;height:320px;"><pre>$description</pre></div></td></tr>	
												</table>
											</div>
										</div>										
										~;							
							}							
						else{
								print qq~<div onmouseover="this.style.backgroundColor='silver';" onmouseout="this.style.backgroundColor='white';" style="float:left;border:1px solid #e6eae1;display:inline;color:black;width:99%"><div style="float:left;border:0px solid #e6eae1;"><input type=checkbox name="TT_$db_key" id="TT_pattern" FP_VALUE='$falsepositive' value='$falsepositive'>$identifier</div><div id="triggers" style="float:right;"><img src="./images/info.png" height=16 width=16 rel="#$db_key"></div></span></div>~;
								print qq~<div class="simple_overlay" id="$db_key"><a class="close"></a>
											<div class="details">
												<table style="width:100%;height:400px;border:2px solid white;font:15px times normal;background-color:white;color:black;">
												<tr><td style="height:30px;" align=center><h3>$identifier</h3></td></tr>
												<tr><td style="height:30px;"><u>Pattern :</u> $pattern</td></tr>
												<!--
												<tr><td><h4>$species</h4></td></tr>
												<tr><td><h4>$falsepositive</h4></td></tr>
												-->
												<tr><td style="width:100%; border:1px solid silver;"><div style="overflow:auto;width:830px;height:320px;"><pre>$description</pre></div></td></tr>												
												</table>
											</div>
										</div>										
										~;
							
							}
					}	
				
						
			}
		
		$sth->finish() or print "$!";
		$dbh->disconnect() or print "$!";	
		
		
}		
	###########################################################################	
   print qq~
		</div>
		</td>
		<td style="background-color:#e6e6e1;width:50%;" align=left valign=top>
		<div style="position:relative;">
		 <div style="position:absolute;left:1px;right:3px;height:200px;overflow:none;">
		 	<div>
		 	<div style="float:left;text-align:right;width:65%;">&nbsp;Give your own pattern below :&nbsp;</div>
		 	<div style="float:left;"><a href="./sfm_help.html#transterm_elements" target="_blank" class="" title="Refer help document for more information." style="text-decoration:none;"><div style="position:relative;top:3px;"><img src="./images/icn_quickhelp.gif"></div></a></div>
		 	</div>
		 	
		 	
			<div style="margin:2px;"><TEXTAREA id="user_pattern" name="user_pattern" style="width:100%;border:1px solid silver;overflow:hidden;white-space:wrap;" rows="3" value=""></TEXTAREA></div>
			<div><font color=green>Examples:</font><br>
					<span style="display:inline;font:13px times bold;color:black">r1={au,ua,gc,cg,gu,ug,ga,ag} p1=2...3 0...4 p2=2...5 1...5 r1\~p2 0...4 \~p1 </span> </br>
<span style="display:inline;font:13px times bold;color:black">  ^N CCCCC[1,1,1] 0...5 CCCC[1,0,0] </span>  
					
				</font>
			</div><br>
			<div style="text-align:center;"><a href="http://www.ncbi.nlm.nih.gov/pmc/articles/PMC168955/?tool=pubmed" target="_blank" >Click here to find out more about pattern syntax, or look at the Transterm examples</div>
		</div>
		</div>	
		</td>
		</tr>
		

		
		</table>
		</div>
		</td>
		</tr>
		
		
		
		
		
		<tr>
		<td style="background-Color:white;">		
		<div style="float:left;"><input type=checkbox name="RBPDB" value="1"><b>B.</b>&nbsp;&nbsp;Show those protein binding sites from <a href="http://rbpdb.ccbr.utoronto.ca/index.php" target="_blank">RBPDB</a> for which frequency matrices are available with an E-value <= <input type=text name="RBPDB_OCCURRENCE_SCORE" value="1" style="width:30px;border:1px solid red;color:green;">&nbsp;</div>
		<div style="float:left;"><a href="./sfm_help.html#rbp_elements" target="_blank" class="" title="Refer help document for more information." style="text-decoration:none;"><div style="position:relative;top:3px;"><img src="./images/icn_quickhelp.gif"></div></a></div>
		</td>
		</tr>	
		
		<tr>
		<td style="background-Color:white;">
		<div style="float:left;"><input type=checkbox id="conserved_elements" name="conserved_elements" value="1" disabled=true ><b>C.</b>&nbsp;&nbsp;Show targets of conserved microRNA families as predicted by <a href="http://www.targetscan.org/" target="_blank">Targetscan</a>&nbsp;</div>
		<div style="float:left;"><a href="./sfm_help.html#targetscan_elements" target="_blank" class="" title="Refer help document for more information." style="text-decoration:none;"><div style="position:relative;top:3px;"><img src="./images/icn_quickhelp.gif"></div></a></div>
		</td>
		</tr>
		
		<tr>
		<td style="background-Color:white;">
		<div style="float:left;"><input type=checkbox name="seed_sequences" value="1"><b>D.</b>&nbsp;&nbsp;Show all 		
			<select name="seed_length" style="width:40px;border:1px solid red;color:green;background:white;">
			  <option value="6">6</option>
			  <option value="7">7</option>
			  <option value="8" SELECTED>8</option>			  
			</select>
			base seed sequence targets from human microRNA's (<a href="http://www.mirbase.org/" target="_blank">miRBase</a>)&nbsp;
			</div>
		<div style="float:left;"><a href="./sfm_help.html#mirbase_elements" target="_blank" class="" title="Refer help document for more information." style="text-decoration:none;"><div style="position:relative;top:3px;"><img src="./images/icn_quickhelp.gif"></div></a></div>	
		</td>
		</tr>
		
		<tr>
		<td style="background-Color:white;">
		<div style="float:left;"><input type=checkbox id="show_elements_present_in_referrence" name="show_elements_present_in_referrence" value="1" CHECKED><b>E.</b>&nbsp;&nbsp;Show elements not found in the reference sequence.&nbsp;</div>
		<div style="float:left;"><a href="./sfm_help.html#filtering_elements" target="_blank" class="" title="If a gene name is provided, then the reference sequence will be Human sequence. For uploaded sequences, the first sequence will be considered as the reference sequence." style="text-decoration:none;"><div style="position:relative;top:3px;"><img src="./images/icn_quickhelp.gif"></div></a></div>
		</td>
		</tr>		

	</table>
</td>
</tr>


<!--
<tr>
	<td colspan=2 align=left vAlign=top style="height:400px; width:99%; border:1px solid white;" bgcolor="#d0d0d0">
	  <iframe hspace="0" name="step2_iframe" src="" border="0" bgcolor="" align="left" frameborder="0" width="100%" height="99%" scrolling="auto" ></iframe>					
	</td>
</tr>
-->


<tr>
<td align=center colspan=2 style="width:100%;border:1px solid white">
	<!-- Access code: <input type="text" name="access_code" value="" width=125 style="border:1px solid red;">&nbsp;&nbsp; -->
	<input type="submit" name="Submit" value="Submit">&nbsp;<input type="reset" value="Reset" onclick="clear_textbox();"></td>
</tr>

<!--
<tr>
<td align=center colspan=2 style="width:100%;border:1px solid white"><hr color=red></hr></td>
</tr>
<tr>
<td align=center colspan=2 style="width:100%;border:1px solid white"> "Scan for Motifs". Please contact Ambarish Biswas [ <a href="mailto:ambarishbiswas\@gmail.com">ambarishbiswas\@gmail.com</a> ] or Dr.Chris Brown [ <a href="mailto:cgr.otago\@gmail.com">cgr.otago\@gmail.com</a> ] for the access code.</td>
</tr>
-->


</table>
</form>




<!-- load the jQuery overlay files -->
<script src="./overlay_files/load.js"></script>

</body>
</html>

~;
