[Bio] / FigWebServices / protein.cgi Repository:
ViewVC logotype

Diff of /FigWebServices/protein.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.76, Fri Jan 28 19:30:02 2005 UTC revision 1.77, Fri Jan 28 21:42:40 2005 UTC
# Line 884  Line 884 
884      my @sims = grep { $show_env || ( $_->id2 !~ /^fig\|999999/ ) }      my @sims = grep { $show_env || ( $_->id2 !~ /^fig\|999999/ ) }
885                 &sims( $fig_or_sprout, $peg, $maxN, $maxP, $select, $max_expand );                 &sims( $fig_or_sprout, $peg, $maxN, $maxP, $select, $max_expand );
886    
887        #  Similarity filter
888    
889        if ( defined( $min_sim ) && ( $min_sim > 0 ) && ( $sim_meas eq 'id' ) ) {
890            @sims = grep { $_->iden >= $min_sim } @sims;
891        }
892    
893        #  Query sequence coverage filter
894    
895        if ( defined( $min_q_cov ) && ( $min_q_cov > 0 ) ) {
896            my $thresh = 0.01 * $min_q_cov;
897            @sims = grep { ( abs( $_->e1 - $_->b1 ) + 1 ) >= ( $thresh * $_->ln1 ) } @sims;
898        }
899    
900        #  Subject sequence coverage filter
901    
902        if ( defined( $min_s_cov ) && ( $min_s_cov > 0 ) ) {
903            my $thresh = 0.01 * $min_s_cov;
904            @sims = grep { ( abs( $_->e2 - $_->b2 ) + 1 ) >= ( $thresh * $_->ln2 ) } @sims;
905        }
906    
907      if ( @sims ) {      if ( @sims ) {
908          push( @$html, $cgi->hr );          push( @$html, $cgi->hr );
909          my @from = $cgi->radio_group( -name => 'from',          my @from = $cgi->radio_group( -name => 'from',
# Line 1205  Line 1225 
1225      my $trans_role = $cgi->param('translate')  || 0;      my $trans_role = $cgi->param('translate')  || 0;
1226      my $expand_groups = $cgi->param('expand_groups') || 0;      my $expand_groups = $cgi->param('expand_groups') || 0;
1227    
1228      #  New parameters.  Not yet implimented.      #  New similarity options
1229      #  Make the defaults loose ennough to pass everything:  
1230        #  Act on request for more or fewer sim options
1231    
1232      my $extra_opt = defined( $cgi->param('extra_opt') ) ? $cgi->param('extra_opt') : 0;      my $extra_opt = defined( $cgi->param('extra_opt') ) ? $cgi->param('extra_opt') : 0;
1233      my $min_sim   = defined( $cgi->param('min_sim') )   ? $cgi->param('min_sim')   : 0.01;      if ( $cgi->param('more sim options') ) {
1234      my $min_q_cov = defined( $cgi->param('min_q_cov') ) ? $cgi->param('min_q_cov') : 0.01;          $extra_opt = 1;
1235      my $min_s_cov = defined( $cgi->param('min_s_cov') ) ? $cgi->param('min_s_cov') : 0.01;          $cgi->delete('more sim options');
1236      my $sim_meas  = defined( $cgi->param('sim_meas') )  ? $cgi->param('sim_meas')  : 'id';      }
1237        if ( $cgi->param('fewer sim options') ) {
1238            $extra_opt = 0;
1239            $cgi->delete('fewer sim options');
1240        }
1241    
1242        #  Make defaults completely open (match original behavior)
1243    
1244        my $min_sim   = $extra_opt && defined( $cgi->param('min_sim') )   ? $cgi->param('min_sim')   : 0;
1245        my $min_q_cov = $extra_opt && defined( $cgi->param('min_q_cov') ) ? $cgi->param('min_q_cov') : 0;
1246        my $min_s_cov = $extra_opt && defined( $cgi->param('min_s_cov') ) ? $cgi->param('min_s_cov') : 0;
1247        my $sim_meas  = $extra_opt && defined( $cgi->param('sim_meas') )  ? $cgi->param('sim_meas')  : 'id';
1248    
1249        #  New parameters.  Not yet implimented.
1250      #  The defaults for representative sequences might be tuned:      #  The defaults for representative sequences might be tuned:
1251    
1252      my $show_rep  = defined( $cgi->param('show_rep') )  ? $cgi->param('show_rep')  : 0;      my $show_rep  = $extra_opt && defined( $cgi->param('show_rep') )  ? $cgi->param('show_rep')  : 0;
1253      my $max_sim   = defined( $cgi->param('max_sim') )   ? $cgi->param('max_sim')   : 0.70;      my $max_sim   = $extra_opt && defined( $cgi->param('max_sim') )   ? $cgi->param('max_sim')   : 0.70;
1254      my $dyn_thrsh = defined( $cgi->param('dyn_thrsh') ) ? $cgi->param('dyn_thrsh') : 0;      my $dyn_thrsh = $extra_opt && defined( $cgi->param('dyn_thrsh') ) ? $cgi->param('dyn_thrsh') : 0;
1255      my $save_dist = defined( $cgi->param('save_dist') ) ? $cgi->param('save_dist') : 0.80;      my $save_dist = $extra_opt && defined( $cgi->param('save_dist') ) ? $cgi->param('save_dist') : 0.80;
1256    
1257      #  Mark some of the sequences automatically?      #  Mark some of the sequences automatically?
1258    
1259      my $chk_which = defined( $cgi->param('chk_which') ) ? $cgi->param('chk_which')  : 'none';      my $chk_which = $extra_opt && defined( $cgi->param('chk_which') ) ? $cgi->param('chk_which')  : 'none';
1260    
1261    
1262      #  Use $cgi->param('more similarities') to drive increase in maxN and max_expand      #  Use $cgi->param('more similarities') to drive increase in maxN and max_expand
1263    
# Line 1233  Line 1267 
1267          $cgi->delete('more similarities');          $cgi->delete('more similarities');
1268      }      }
1269    
     #  Act on request for more or fewer sim options  
   
     if ( $cgi->param('more sim options') ) {  
         $extra_opt = 1;  
         $cgi->delete('more sim options');  
     }  
     if ( $cgi->param('fewer sim options') ) {  
         $extra_opt = 0;  
         $cgi->delete('fewer sim options');  
     }  
   
1270      #  We have processed all options.  Use them to build forms.      #  We have processed all options.  Use them to build forms.
1271    
1272      #  Sanity checks on fixed vocabulary parameter values:      #  Sanity checks on fixed vocabulary parameter values:
# Line 1317  Line 1340 
1340          my $chk_chk_all      = select_if( $chk_which eq 'all' );          my $chk_chk_all      = select_if( $chk_which eq 'all' );
1341          my $chk_chk_rep      = select_if( $chk_which eq 'rep' );          my $chk_chk_rep      = select_if( $chk_which eq 'rep' );
1342    
1343            #  Finally time to write some HTML
1344            #
1345          #  Default options          #  Default options
1346    
1347          push @$html, <<"End_Default_Options";          push @$html, <<"End_Default_Options";
# Line 1338  Line 1363 
1363          #  Extra options          #  Extra options
1364    
1365          push @$html, <<"End_Extra_Options" if $extra_opt;          push @$html, <<"End_Extra_Options" if $extra_opt;
1366        <input type=hidden name=extra_opt value=\"$extra_opt\">
1367    
1368      Min similarity:<input type=text name=min_sim size=5 value=$min_sim>      Min similarity:<input type=text name=min_sim size=5 value=$min_sim>
1369      As defined by      As defined by
1370      <select name=sim_meas>      <select name=sim_meas>
1371          <option value=id  $chk_sim_meas_id>identities</option>          <option value=id  $chk_sim_meas_id>identities</option>
1372            <!--  Hide unimplimented options
1373          <option value=pos $chk_sim_meas_pos>\"positives\"</option>          <option value=pos $chk_sim_meas_pos>\"positives\"</option>
1374          <option value=bpp $chk_sim_meas_bpp>bit score per position</option>          <option value=bpp $chk_sim_meas_bpp>bit score per position</option>
1375            -->
1376      </select>      </select>
1377      Min query coverage:<input type=text name=min_q_cov size=5 value=$min_q_cov>      Min query coverage:<input type=text name=min_q_cov size=5 value=$min_q_cov>
1378      Min subject coverage:<input type=text name=min_s_cov size=5 value=$min_s_cov>      Min subject coverage:<input type=text name=min_s_cov size=5 value=$min_s_cov><br />
1379    
1380        <!--  Hide unimplimented options
1381      <TABLE Cols=2>      <TABLE Cols=2>
1382          <TR>          <TR>
1383              <TD Valign=top><input type=checkbox name=show_rep $chk_show_rep></TD>              <TD Valign=top><input type=checkbox name=show_rep $chk_show_rep></TD>
# Line 1360  Line 1390 
1390          </TR>          </TR>
1391      </TABLE>      </TABLE>
1392    
1393        <input type=hidden name=chk_which value=\"$chk_which\">
1394    
1395      Automatically Select (check) which sequences:<select name=chk_which>      Automatically Select (check) which sequences:<select name=chk_which>
1396          <option value=none $chk_chk_none>none</option>          <option value=none $chk_chk_none>none</option>
1397          <option value=all  $chk_chk_all>all shown</option>          <option value=all  $chk_chk_all>all shown</option>
1398          <option value=rep  $chk_chk_rep>representative set</option>          <option value=rep  $chk_chk_rep>representative set</option>
1399      </select><br />      </select><br />
1400        -->
1401  End_Extra_Options  End_Extra_Options
1402    
1403          #  Submit buttons          #  Submit buttons
# Line 1374  Line 1407 
1407      <input type=submit name='more similarities' value='more similarities'>      <input type=submit name='more similarities' value='more similarities'>
1408      $prev_peg_btn      $prev_peg_btn
1409      $next_peg_btn      $next_peg_btn
1410      <!-- $extra_opt_btn -->      $extra_opt_btn
1411  </FORM>  </FORM>
1412  End_of_Buttons  End_of_Buttons
1413    

Legend:
Removed from v.1.76  
changed lines
  Added in v.1.77

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3