[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.2, Fri Feb 16 17:41:34 2007 UTC revision 1.3, Mon Feb 19 14:43:57 2007 UTC
# Line 2  Line 2 
2    
3  use strict;  use strict;
4  use gjoparseblast;  use gjoparseblast;
5    use Data::Dumper;
6    use Carp;
7    
8  #  These four variables are used as globals below.  They would be changed  #  These four variables are used as globals below.  They would be changed
9  #  for the SEED environment.  formatdb is run as a system command, and might  #  for the SEED environment.  formatdb is run as a system command, and might
# Line 663  Line 665 
665    
666      my $db = ( $tmp_dir ? "$tmp_dir/" : "" ) . "tmp_blast_db_$$";      my $db = ( $tmp_dir ? "$tmp_dir/" : "" ) . "tmp_blast_db_$$";
667      my $protein = are_protein( $reps2 );      my $protein = are_protein( $reps2 );
668    
669      my %max_bpp;      my %max_bpp;
670      my $entry;      my $entry;
671      foreach $entry ( @$reps2 )      foreach $entry ( @$reps2 )
# Line 694  Line 697 
697              make_blast_db( $db, $reps2, $protein );              make_blast_db( $db, $reps2, $protein );
698              $newdb = 0;              $newdb = 0;
699          }          }
   
700          #  Do the blast analysis.  Returned records are of the form:          #  Do the blast analysis.  Returned records are of the form:
701          #          #
702          #        0    1     2     3    4     5     6     7      8     9     10     11          #        0    1     2     3    4     5     6     7      8     9     10     11
# Line 815  Line 817 
817    
818      #  First hit is always a perfect match, so we get bits per position:      #  First hit is always a perfect match, so we get bits per position:
819      #  This is only used if the measure is bits per position      #  This is only used if the measure is bits per position
820        if (! $hit->[8]) { return 0 }
821      $hit->[6] / $hit->[8];      $hit->[6] / $hit->[8];
822  }  }
823    
# Line 832  Line 834 
834  sub make_blast_db  sub make_blast_db
835  {   my ( $db, $seqs, $protein ) =  @_;  {   my ( $db, $seqs, $protein ) =  @_;
836    
837        if (! $protein) { confess 'BAD' }
838      open FH, ">$db" or die "Could not create blast database file \"$db\"";      open FH, ">$db" or die "Could not create blast database file \"$db\"";
839      foreach ( @$seqs )      foreach ( @$seqs )
840      {      {
# Line 889  Line 892 
892      close $QFILE;      close $QFILE;
893    
894      my $blast_cmd = "$blastall -p $prog -d '$db' -i '$query_file' $blast_opt";      my $blast_cmd = "$blastall -p $prog -d '$db' -i '$query_file' $blast_opt";
   
895      my   $BPIPE;      my   $BPIPE;
896      open $BPIPE, "$blast_cmd |" or die "Could open blast pipe\n";      open $BPIPE, "$blast_cmd |" or die "Could open blast pipe\n";
897      my $sims = integrate_blast_segments( $BPIPE, $sort, $no_merge, $self );      my $sims = integrate_blast_segments( $BPIPE, $sort, $no_merge, $self );
898      close $BPIPE;      close $BPIPE;
899    
900      unlink $query_file;      unlink $query_file;
901    
902      my $pq = "";  #  Previous query id      my $pq = "";  #  Previous query id

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3