#!/usr/bin/perl -w


$PROCESS_INPUT_URL = 'search_holdingClone_results.cgi';


#$CGI_VERSION = "(search_holdingClone.cgi v 0.1 beta 1a)";


BEGIN{
    print "Content-type: text/html\n\n";
    # Ensure that errors go to the web browser.
    open(STDERR, ">&STDOUT");
    $| = 1;
    print '';
}

use Carp;

use CGI;
# The CGI module is available from 
# http://www.genome.wi.mit.edu/ftp/distribution/software/WWW/

main();

sub main {

  $LIGHT_COLOR="#BBFFBB";
  $C_ROW = "<tr bgcolor=$LIGHT_COLOR>";
  #$OLIGO_INPUT_SIZE=30;
  #$SOURCE_SEQUENCE_WIDTH = 3 * ($OLIGO_INPUT_SIZE + 1) + 2;
  #$INPUT_VALUE = "";

  $query = new CGI;

  input_screen($query);
}

sub input_screen {
    my ($query) = @_;

    my $script = "function clearAll() {\n";
    $script .= "    document.data.ACCESSION_CHECK.checked = false;\n";
    $script .= "    document.data.RIKEN_CHECK.checked = false;\n";
    $script .= "    document.data.TUID_CHECK.checked = false;\n";
    $script .= "    document.data.RELATED_CHECK.checked = false;\n";
    $script .= "    document.data.GENE_CHECK.checked = false;\n";
    $script .= "    document.data.GENEID_CHECK.checked = false;\n";
    $script .= "    document.data.PROTEIN_CHECK.checked = false;\n";
    $script .= "    document.data.UNIGENE_CHECK.checked = false;\n";
    $script .= "}\n";
    
    print $query->start_html(-title => "Search HoldingClone",
                             -script => $script);

    print qq{
<form name="data"
      action="$PROCESS_INPUT_URL" 
      method="post" 
      enctype="x-www-form-urlencoded">

<table border=0 width="100%">
  $C_ROW
    <td rowspan=2> <font size="+3"> Search holdingClone </font> <br>
</table>

<br>


input search word<br>
<input type="text" class="box" name="INPUT_TEXT" size="80">

<input type="radio" name="SEARCH_FLG" value=1>&nbsp;and&nbsp;&nbsp;
<input type="radio" name="SEARCH_FLG" value=0 checked>&nbsp;or&nbsp;&nbsp;

<br>
"You can use multiple search words with using space."
 
<br><br>

<input type="radio" name="HUMAN_FLG" value=1 checked>&nbsp;Human clone&nbsp;&nbsp;
<input type="radio" name="HUMAN_FLG" value=0>&nbsp;Mouse FANTOM3 clone set&nbsp;&nbsp;
<br><br>

check the target for search<br>
<input type="checkbox" name="ACCESSION_CHECK" value=1 checked>accession&nbsp;&nbsp;
<input type="checkbox" name="RIKEN_CHECK" value=1 checked>RIKEN_cloneid&nbsp;&nbsp;
<input type="checkbox" name="TUID_CHECK" value=1 checked>TUID&nbsp;&nbsp;
<input type="checkbox" name="RELATED_CHECK" value=1 checked>Related_TUID&nbsp;&nbsp;
<input type="checkbox" name="GENE_CHECK" value=1 checked>gene&nbsp;&nbsp;
<input type="checkbox" name="GENEID_CHECK" value=1 checked>GeneID&nbsp;&nbsp;
<input type="checkbox" name="PROTEIN_CHECK" value=1 checked>protein_id&nbsp;&nbsp;
<input type="checkbox" name="UNIGENE_CHECK" value=1 checked>unigene_id&nbsp;&nbsp;&nbsp;&nbsp;
<br>
<input type="button" onClick="clearAll()" value="clear check"><br>
<input type="reset" value="reset"><br>
<br>

<input type="submit" name=" Go! " value=" Go! ">
<br>
</form>

<pre>
<br>
<b>About 'status' columun.</b>
[Status values for full length sequence]
<b>"OK"</b>  : Same sequence as RefSeq. <b><font color="red">Good!</font></b>
<b>"C"</b>   : Complete CDS as RefSeq. <b><font color="red">Good!</font></b>
"Cs"  : Complete CDS as RefSeq with substitution.
"Cg"  : Complete CDS as RefSeq with insertion and/or deletion.
"Cgs" : Complete CDS as RefSeq with ins/del and substitusion.
"Cfs" : Complete CDS as RefSeq with frame shift.
"P"   : Partial CDS as RefSeq.
"Ps"  : Partial CDS as RefSeq with subsititution.
"Pg"  : Partial CDS as RefSeq with insertion and/or deletion.
"Pgs" : Partial CDS as RefSeq with ins/del and sub.
"Pfs" : Partial CDS as RefSeq with frame shift.
"Pfs" : Partial with (frame shift)

[Status values for 5' and/or 3' end sequences]
"5-longer:3-longer"   : 5'-end and 3'-end sequences are mapped on genome sequences
                        and both ends are longer than longest transcript on TU.
"5-longer:3-shoter"   : (Same as above ) and 3-end is shorter than than longest transcript on TU.
"5-longer:na"         : 5'-end sequences are mapped on genome sequences but not 3'-end
                        and both 5'-ends are longer than longest transcript on TU.
"5-shorter:3-longer"  : (Same logics as above.)
"5-shorter:3-shorter" : (Same logics as above.)
"5-shorter:na"        : (Same logics as above.)

<b>About 'seq_verify' columun.</b>
[Status values for sequencing verification (ID check sequence)]
<b>"verified"</b>	: This clone was verified with sequencing and comparing with NCBI genbank's sequence of this clone. <b><font color="red">Good!</font></b>
"unverified"	: This clone couldn't be verified because it couldn't found similality with NCBI genbanks's sequence.
"seq_lowQual"	: This clone couldn't be verified because of low quality sequence. (It has possibility of contamination of clones and/or less quality of clone culturing.)
"nt_not_available"	: This clone's NCBI genbank's sequence have been expired by clone distributer.
"seq_not-yet"	: Sequencing verification of this clones have not done yet.
"no_growth"	: This clone could not growth on well of plate. It might be low quality of clones.
"source"	:	Source clone. (Sequencing verification isn't necessarry.)

<b>About columns of alignment values between clone's nucleotide sequence and RefSeq peptide (fastx).</b>
"refseq_nuc"	: Accession ID of refseq nucleotide.
"refseq_pep"	: Accession ID of refseq peptide.
"refseq_status"	: Please see document on NCBI RefSeq web site.(<a href="http://www.ncbi.nlm.nih.gov/RefSeq/key.html#status">here</a>)
"status"	: See as above.
"ident"	: Local identity value.
"gident	: Global identity value. (There is gap if 'ident' and 'gident' are different.)
"overlap"	: Overlapped length.
"q_len"	: Length of clone's sequence.
"q_start"	: Alignment start position of clone's sequence.
"q_stop"	: Alignment stop position of clone's sequence.
"s_len"	: Length of RefSeq peptide sequence.
"s_start"	: Alignment start position of RefSeq peptide sequence.
"s_stop"	: Alignment stop position of RefSeq peptide sequence.

</pre>

<H3>Data Download</H3>
<a href="./data"><b>List of Clones</b></a>



};


    print $query->end_html;
    print "\n";
}