[Bio] / FigKernelPackages / representative_sequences.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/representative_sequences.pm

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

revision 1.7, Sat May 12 20:12:56 2007 UTC revision 1.8, Sat May 12 20:47:03 2007 UTC
# Line 24  Line 24 
24                  );                  );
25    
26  #===============================================================================  #===============================================================================
27  #  Build or add to a set of representative sequences (if you to not want an  #  Build or add to a set of representative sequences (if you do not want an
28  #  enrichment of sequences around a focus sequence (called the reference), this  #  enrichment of sequences around a focus sequence (called the reference), this
29  #  is probably the subroutine that you want).  #  is probably the subroutine that you want).
30  #  #
# Line 106  Line 106 
106  #  #
107  #    \%options  Key=>Value pairs that modify the behaviour:  #    \%options  Key=>Value pairs that modify the behaviour:
108  #  #
109    #        by_size    (rep_seq and rep_seq_2 only)
110    #                   By default, sequences are analyzed in input order.  This
111    #                   option set to true will sort from longest to shortest.
112    #
113  #        logfile    Filehandle for a logfile of the progress.  As each  #        logfile    Filehandle for a logfile of the progress.  As each
114  #                   sequence is analyzed, its disposition in recorded.  #                   sequence is analyzed, its disposition in recorded.
115  #                   In representative_sequences(), the id of each new  #                   In representative_sequences(), the id of each new
# Line 341  Line 345 
345    
346      # ---------------------------------------# Default values for options      # ---------------------------------------# Default values for options
347    
348        my $by_size   = undef;                 # Analyze sequences in order provided
349      my $max_sim   = 0.80;                  # Retain 80% identity of less      my $max_sim   = 0.80;                  # Retain 80% identity of less
350      my $logfile   = undef;                 # Log file of sequences processed      my $logfile   = undef;                 # Log file of sequences processed
351      my $max_e_val = 0.01;                  # Blast E-value to decrease output      my $max_e_val = 0.01;                  # Blast E-value to decrease output
# Line 380  Line 385 
385          {          {
386              $options->{ savetmp } = 1;              $options->{ savetmp } = 1;
387          }          }
388            elsif ( m/size/i )                  #  add longest to shortest
389            {
390                $by_size = 1;
391            }
392          else          else
393          {          {
394              print STDERR "WARNING: rep_seq bad option ignored: '$_' => '$value'\n";              print STDERR "WARNING: rep_seq bad option ignored: '$_' => '$value'\n";
# Line 419  Line 428 
428          }          }
429      }      }
430    
431        if ( $by_size )
432        {
433            @$reps2 = sort { length( $b->[2] ) <=> length( $a->[2] ) } @$reps2;
434        }
435    
436      #  If no preexisting representatives, then take first sequence:      #  If no preexisting representatives, then take first sequence:
437    
438      @$reps2 or ( @$reps2 = shift @$seqs2 );      @$reps2 or ( @$reps2 = shift @$seqs2 );
# Line 627  Line 641 
641    
642      # ---------------------------------------# Default values for options      # ---------------------------------------# Default values for options
643    
644      my $max_sim   = 0.80;                  # Retain 80% identity or less      my $by_size   = undef;                 # Analyze sequences in order provided
645        my $max_sim   = 0.80;                  # Retain 80% identity of less
646      my $logfile   = undef;                 # Log file of sequences processed      my $logfile   = undef;                 # Log file of sequences processed
647      my $max_e_val = 0.01;                  # Blast E-value to decrease output      my $max_e_val = 0.01;                  # Blast E-value to decrease output
648      my $sim_meas  = 'identity_fraction';   # Use sequence identity as measure      my $sim_meas  = 'identity_fraction';   # Use sequence identity as measure
# Line 662  Line 677 
677          {          {
678              $sim_meas = standardize_similarity_measure( $value );              $sim_meas = standardize_similarity_measure( $value );
679          }          }
680            elsif ( m/by_?size/i || m/size/i )  #  add longest to shortest
681            {
682                $by_size = 1;
683            }
684          else          else
685          {          {
686              print STDERR "WARNING: rep_seq_2 bad option ignored: '$_' => '$value'\n";              print STDERR "WARNING: rep_seq_2 bad option ignored: '$_' => '$value'\n";
# Line 701  Line 720 
720          }          }
721      }      }
722    
723        if ( $by_size )
724        {
725            @$reps2 = sort { length( $b->[2] ) <=> length( $a->[2] ) } @$reps2;
726        }
727    
728      #  If no preexisting representatives, then take first sequence:      #  If no preexisting representatives, then take first sequence:
729    
730      @$reps2 or @$reps2 = ( shift @$seqs2 );      @$reps2 or @$reps2 = ( shift @$seqs2 );

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3