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

Diff of /FigKernelScripts/get_neighbors_and_corr_to_ref.pl

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

revision 1.6, Fri Feb 19 19:38:21 2010 UTC revision 1.7, Mon Aug 30 16:08:24 2010 UTC
# Line 8  Line 8 
8  use ProtSims;  use ProtSims;
9  use gjoseqlib;  use gjoseqlib;
10  use Data::Dumper;  use Data::Dumper;
11    use SeedAware;
12    
13  my $usage = "usage: get_neighbors_and_corr_to_ref GenomeDir";  my $usage = "usage: get_neighbors_and_corr_to_ref GenomeDir";
14  my $gdir;  my $gdir;
# Line 66  Line 67 
67      my $g1 = $1;      my $g1 = $1;
68      if ($g1 ne $g2)      if ($g1 ne $g2)
69      {      {
70          system "svr_corresponding_genes -d $gdir $g1 $g2 > $gdir/CorrToReferenceGenomes/$g2";          my $exe = SeedAware::executable_for("svr_corresponding_genes");
71            SeedAware::system_with_redirect([$exe, "-d", $gdir, $g1, $g2],
72                                        { stdout => "$gdir/CorrToReferenceGenomes/$g2" });
73            #system "svr_corresponding_genes -d $gdir $g1 $g2 > $gdir/CorrToReferenceGenomes/$g2";
74      }      }
75  }  }
76    
# Line 74  Line 78 
78      my($gdir) = @_;      my($gdir) = @_;
79    
80      my %by_func;      my %by_func;
     (-s "$gdir/assigned_functions") || die "$gdir contains no assigned_functions";  
81    
82      my %uniqH;      my %uniqH;
83      foreach my $line (`cat $gdir/assigned_functions`)  
84        my $af_fh;
85        if (!open($af_fh, "<", "$gdir/assigned_functions"))
86        {
87            warn "Cannot open $gdir/assigned_functions: $!";
88            return ();
89        }
90    
91        while (defined(my $line = <$af_fh>))
92      {      {
93          if ($line =~ /^(fig\|\d+\.\d+\.peg\.\d+)\t(\S[^\#]+\S)/)          if ($line =~ /^(fig\|\d+\.\d+\.peg\.\d+)\t(\S[^\#]+\S)/)
94          {          {
95              $uniqH{$1} = $2;              $uniqH{$1} = $2;
96          }          }
97      }      }
98        close($af_fh);
99    
100      foreach my $peg (keys(%uniqH))      foreach my $peg (keys(%uniqH))
101      {      {

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3