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

Diff of /FigKernelScripts/find_neighbors_using_figfams.pl

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

revision 1.7, Wed Feb 13 14:54:27 2008 UTC revision 1.8, Wed Feb 13 23:04:18 2008 UTC
# Line 37  Line 37 
37    
38  my ($i, $fam_data, $to_call_dir, $N, $foundF);  my ($i, $fam_data, $to_call_dir, $N, $foundF);
39    
40  # First, let's determine which FigfamsData directory to use  #...First, let's determine which FigfamsData directory to use:
   
41  for ($i=0; ($i < @ARGV) && ($ARGV[$i] !~ /^-fams=/); $i++) {}  for ($i=0; ($i < @ARGV) && ($ARGV[$i] !~ /^-fams=/); $i++) {}
42  if ($i < @ARGV) {  if ($i < @ARGV) {
43      if ($ARGV[$i] =~ /^-fams=(\S+)/) {      if ($ARGV[$i] =~ /^-fams=(\S+)/) {
# Line 79  Line 78 
78      $to_call = new NewGenome($to_call_dir);      $to_call = new NewGenome($to_call_dir);
79  }  }
80    
81    
82    open(FOUNDFAMS, ">>$foundF") || die "Could not append-open $foundF";
83    
84    my $called_by_file = "$to_call_dir/called_by";
85    open(CALLED_BY, ">>$called_by_file")
86        || die "Could not append-open $called_by_file";
87    
88    
89    #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
90    #...Get the current ORF-calls if they exist;
91    #   else, try to call a set of candidate ORFs.
92    #-----------------------------------------------------------------------
93  my @orf_ids = $to_call->get_fids_for_type('orf');  my @orf_ids = $to_call->get_fids_for_type('orf');
94  if (not @orf_ids) {  if (not @orf_ids) {
95      $to_call->possible_orfs;      $to_call->possible_orfs();
96      @orf_ids = $to_call->get_fids_for_type('orf');      @orf_ids = $to_call->get_fids_for_type('orf');
97  }  }
98    
# Line 93  Line 104 
104      }      }
105  }  }
106    
 open(FOUNDFAMS, ">>$foundF") || die "Could not append-open $foundF";  
   
 my $called_by_file = "$to_call_dir/called_by";  
 open(CALLED_BY, ">>$called_by_file")  
     || die "Could not append-open $called_by_file";  
107    
108  my @peg_ids = ();  my @peg_ids = ();
109  my %genomes_hit;  my %genomes_hit;
# Line 126  Line 132 
132                            ];                            ];
133              my $orf   = &NewGenome::ORF::new('NewGenome::ORF', $to_call, $orf_id);              my $orf   = &NewGenome::ORF::new('NewGenome::ORF', $to_call, $orf_id);
134              $fid      = $orf->promote_to_peg($sims, $func, $annot);              $fid      = $orf->promote_to_peg($sims, $func, $annot);
135    
136                if ($fid) {
137                    print CALLED_BY "$fid\t$self\n";
138                    print FOUNDFAMS "$fid\t$fam_id\t$func\n";
139                }
140                else {
141                    die "Could not promote $orf_id";
142          }          }
         else  
         {  
             $fid = $orf_id;  
143          }          }
144    
145          if ($fid) {          if ($fid) {
146              push @peg_ids, $fid;              push @peg_ids, $fid;
147    
             print CALLED_BY "$fid\t$self\n";  
             print FOUNDFAMS "$fid\t$fam_id\t$func\n";  
   
148              for ($i=0; ($i < $N) && ($i < @$sims); ++$i) {              for ($i=0; ($i < $N) && ($i < @$sims); ++$i) {
149                  ++$genomes_hit{&FIG::genome_of($sims->[$i]->id2)};                  ++$genomes_hit{&FIG::genome_of($sims->[$i]->id2)};
150                    next unless $sims->[$i]->ln2;
151                  $weight_of_hits{&FIG::genome_of($sims->[$i]->id2)} +=                  $weight_of_hits{&FIG::genome_of($sims->[$i]->id2)} +=
152                      ($sims->[$i]->bsc / $sims->[$i]->ln2);                      ($sims->[$i]->bsc / $sims->[$i]->ln2);
153              }              }

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3