3 index.pl - In Silico PCR web interface
7 This interface shows a form that requires user input of the forward primer,
8 reverse primer, maximum product size, Allowed mismathces. Also, In Silico
9 PCR is dependent on the BLAST similarity search. Part of the blast code was
10 used here to get the database, program, matrix, e-value.
11 This page will forward the input to pcr_blast_result.pl and will then display
12 the results in view_result.pl.
17 Alot of the BLAST code in /sgn/cgi-bin/tool/blast was reused here
18 PCR is dependent on the BLAST search to find the primers in the databases
22 Waleed Haso wh292@cornell.edu
23 Only added modifications to support the PCR part
24 Original code was aspired from BLAST.
34 use CXGN
::DB
::Connection
;
37 use CXGN
::Page
::FormattingHelpers qw
/page_title_html info_table_html hierarchical_selectboxes_html /;
38 use CXGN
::Page
::UserPrefs
;
39 use CXGN
::Tools
::List qw
/evens distinct/;
41 my $page = CXGN
::Page
->new("In Silico PCR form","Waleed");
42 my $dbh = CXGN
::DB
::Connection
->new;
43 our $prefs = CXGN
::Page
::UserPrefs
->new( $dbh );
45 $page->header('In Silico PCR');
47 my ($databases,$programs,$programs_js) = blast_db_prog_selects
();
49 ##############################################################################################################################
51 print page_title_html
("In Silico PCR");
58 <form method="post" action="pcr_blast_result.pl" name="PCRform" enctype="multipart/form-data">
59 <input type="hidden" name="outformat" value="8" />
61 <table id="PCRinput" align="center" summary="" cellpadding="0" cellspacing="15" border="0">
64 <H2><B> PCR Primers:</B></H2>
69 <B> Forward Primer</B>
72 <input type="text" size="65" value="" name="fprimer" />
77 <B>Reverse Complement Forward Primer</B>
80 <input type="checkbox" name="frevcom" />
85 <B> Reverse Primer</B>
88 <input type="text" size="65" value="" name="rprimer" />
93 <B>Reverse Complement Reverse Primer</B>
96 <input type="checkbox" name="rrevcom" />
101 <b>Product Maximum Length</b>
104 <input type="text" size="5" value="5000" name="productLength" />
109 <b>Allowed Mismatches</b>
112 <input type="text" size="5" value="0" name="allowedMismatches" />
117 <H2><B> BLAST Attributes:</B></H2>
123 <b>Database (<tt>-d</tt>)</b>
126 $databases <a style="font-size: 80%" title="View details of each database" href="/tools/blast/dbinfo.pl">db details</a>
131 <b>BLAST Program (<tt>-p</tt>)</b>
139 <b>Substitution Matrix (<tt>-M</tt>)</b>
142 <select name="matrix">
143 <option value="BLOSUM62">BLOSUM62 (default)</option>
144 <option value="BLOSUM80">BLOSUM80 (recent divergence)</option>
145 <option value="BLOSUM45">BLOSUM45 (ancient divergence)</option>
146 <option value="PAM30">PAM30</option>
147 <option value="PAM70">PAM70</option>
153 <b>Expectation value (<tt>-e</tt>)</b>
156 <input type="text" size="10" value="0.01" name="expect" />
159 <tr><td><b>Filter query sequence (DUST with blastn, SEG with others) (<tt>-F</tt>)</b></td>
160 <td><input type="checkbox" checked="checked" name="filterq" /></td>
163 <td align="right"><input type="reset" value="Clear" /></td>
164 <td align="center"><input type="submit" name="search" value=" Run " style="background: yellow; font-size: 130%" /></td>
168 <script language="JavaScript" type="text/javascript">
173 #}#end of the commented else
177 ##########################################################################################################################
178 #This subroutine is copied exactly from the BLAST index.pl code
180 sub blast_db_prog_selects
{
183 my $timestamp = $db->file_modtime
185 $timestamp = strftime
(' (%m-%d-%y)',gmtime $db->file_modtime);
186 my $seq_count = $db->sequences_count;
188 [$db->blast_db_id, $db->title.$timestamp]
191 my @db_choices = map {
192 my @dbs = map [$_,opt
($_)], grep $_->file_modtime, $_->blast_dbs( web_interface_visible
=> 't');
193 @dbs ?
('__'.$_->name, @dbs) : ()
194 } CXGN
::BlastDB
::Group
->search_like(name
=> '%',{order_by
=> 'ordinal, name'});
196 my @ungrouped_dbs = grep $_->file_modtime,CXGN
::BlastDB
->search( blast_db_group_id
=> undef, web_interface_visible
=> 't', {order_by
=> 'title'} );
198 push @db_choices, '__Other', map [$_,opt
($_)], @ungrouped_dbs;
201 @db_choices or return '<span class="ghosted">The BLAST service is temporarily unavailable, we apologize for the inconvenience</span>';
203 my $selected_db_file_base = $prefs->get_pref('last_blast_db_file_base');
204 #warn "got pref last_blast_db_file_base '$selected_db_file_base'\n";
206 my %prog_descs = ( blastn
=> 'BLASTN (nucleotide to nucleotide)',
207 blastx
=> 'BLASTX (nucleotide to protein; query translated to protein)',
208 blastp
=> 'BLASTP (protein to protein)',
209 tblastx
=> 'TBLASTX (protein to protein; both database and query are translated)',
210 tblastn
=> 'TBLASTN (protein to nucleotide; database translated to protein)',
213 my @program_choices = map {
215 if($db->type eq 'protein') {
216 [map [$_,$prog_descs{$_}], 'blastx','blastp']
218 [map [$_,$prog_descs{$_}], 'blastn','tblastx','tblastn']
220 } grep ref, @db_choices;
222 @db_choices = map {ref($_) ?
$_->[1] : $_} @db_choices;
224 return hierarchical_selectboxes_html
( parentsel
=> { name
=> 'database',
227 $selected_db_file_base ?
(selected
=> $selected_db_file_base) : (),
229 childsel
=> { name
=> 'program',
231 childchoices
=> \
@program_choices