[Bio] / FigKernelScripts / promote_orfs_to_pegs.pl Repository:
ViewVC logotype

Diff of /FigKernelScripts/promote_orfs_to_pegs.pl

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

revision 1.8, Thu Jun 7 19:01:48 2007 UTC revision 1.9, Fri Jun 8 18:11:21 2007 UTC
# Line 16  Line 16 
16  # http://www.theseed.org/LICENSE.TXT.  # http://www.theseed.org/LICENSE.TXT.
17  #  #
18    
19    use strict;
20  use FIG;  use FIG;
21  my $fig = new FIG;  my $fig = new FIG;
22    
# Line 48  Line 49 
49  #...Build file of "nearby" PEGs  #...Build file of "nearby" PEGs
50  my $tmp_close = "$FIG_Config::temp/tmp_close_$$.fasta";  my $tmp_close = "$FIG_Config::temp/tmp_close_$$.fasta";
51  system("/bin/rm -f $tmp_close*");  system("/bin/rm -f $tmp_close*");
52  foreach $org (@neighbors) {  foreach my $org (@neighbors) {
53      print STDERR "Appending $org to $tmp_close\n" if $ENV{VERBOSE};      print STDERR "Appending $org to $tmp_close\n" if $ENV{VERBOSE};
54      system("cat $FIG_Config::organisms/$org/Features/peg/fasta >> $tmp_close");      system("cat $FIG_Config::organisms/$org/Features/peg/fasta >> $tmp_close");
55  }  }
# Line 59  Line 60 
60  open(TMP_SIMS, ">$tmp_sims")  open(TMP_SIMS, ">$tmp_sims")
61      || die "Could not write-open $tmp_sims";      || die "Could not write-open $tmp_sims";
62  foreach my $orf_id ($to_call->get_fids_for_type('orf')) {  foreach my $orf_id ($to_call->get_fids_for_type('orf')) {
63      $sims = &blast_against($to_call->get_feature_sequence($orf_id), $tmp_close);      my $sims = &blast_against($to_call->get_feature_sequence($orf_id), $tmp_close);
64    
65      if (@$sims) {      if (@$sims) {
66          print STDERR "Promoting $orf_id based on ", (scalar @$sims), " sims\n" if $ENV{VERBOSE};          print STDERR "Promoting $orf_id based on ", (scalar @$sims), " sims\n" if $ENV{VERBOSE};
# Line 105  Line 106 
106          }          }
107      }      }
108      close(FOUND) || die "Could not close $found_file";      close(FOUND) || die "Could not close $found_file";
109        unlink($tmp_seqs)  || die "Could not remove $tmp_seqs";
110  }  }
111    
112  $to_call->promote_remaining_orfs;  $to_call->promote_remaining_orfs;
# Line 126  Line 128 
128    
129  unlink($tmp_close) || die "Could not remove $tmp_close";  unlink($tmp_close) || die "Could not remove $tmp_close";
130  unlink($tmp_sims)  || die "Could not remove $tmp_sims";  unlink($tmp_sims)  || die "Could not remove $tmp_sims";
 unlink($tmp_seqs)  || die "Could not remove $tmp_seqs";  
   
   
131    
132    
133    
# Line 143  Line 142 
142    
143      my $sims = [];      my $sims = [];
144      @$sims = map { chomp $_;      @$sims = map { chomp $_;
145                     @x = split(/\t/, $_);                     my @x = split(/\t/, $_);
146                     push @x, ($seq_len, $fig->translation_length($x[1]));                     push @x, ($seq_len, $fig->translation_length($x[1]));
147                     bless( [@x], "Sim" )                     bless( [@x], "Sim" )
148                     } `blastall -i $tmp_seq -d $db -p blastp -m8 -e1.0e-10`;                     } `blastall -i $tmp_seq -d $db -p blastp -m8 -e1.0e-10`;

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3