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

Diff of /FigKernelScripts/make_PHOBs_for_subsystems.pl

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

revision 1.3, Mon May 9 02:33:25 2005 UTC revision 1.5, Mon Dec 5 18:56:37 2005 UTC
# Line 1  Line 1 
1  # -*- perl -*-  # -*- perl -*-
2    #
3    # Copyright (c) 2003-2006 University of Chicago and Fellowship
4    # for Interpretations of Genomes. All Rights Reserved.
5    #
6    # This file is part of the SEED Toolkit.
7    #
8    # The SEED Toolkit is free software. You can redistribute
9    # it and/or modify it under the terms of the SEED Toolkit
10    # Public License.
11    #
12    # You should have received a copy of the SEED Toolkit Public License
13    # along with this program; if not write to the University of Chicago
14    # at info@ci.uchicago.edu or the Fellowship for Interpretation of
15    # Genomes at veronika@thefig.info or download a copy from
16    # http://www.theseed.org/LICENSE.TXT.
17    #
18    
19    
20  use FIG;  use FIG;
21  my $fig = new FIG;  my $fig = new FIG;
22    
23  $usage = "usage: make_PHOBs_for_subsystems Dir < FileOf_SS-Role-PEG-Func";  $usage = "usage: make_PHOBs_for_subsystems Dir [SimilarityCutoff FracCoverage] < FileOf_SS-Role-PEG-Func";
24    
25  (  (
26   ($dir = shift @ARGV) && (! -d $dir)   ($dir = shift @ARGV) && (! -d $dir)
27  )  )
28      || die $usage;      || die $usage;
29    
30    if (@ARGV == 2)
31    {
32        $sim_cutoff = shift @ARGV;
33        $frac_cov   = shift @ARGV;
34    }
35    
36  mkdir($dir,0777) || die "could not make $dir";  mkdir($dir,0777) || die "could not make $dir";
37  while (defined($_ = <STDIN>))  while (defined($_ = <STDIN>))
38  {  {
# Line 33  Line 56 
56      foreach $role (sort keys(%{$subH{$ss}}))      foreach $role (sort keys(%{$subH{$ss}}))
57      {      {
58          ++$roleN;          ++$roleN;
         print INDEXR "$roleN\t$role\n";  
59    
60          $pegs = $subH{$ss}->{$role};          $pegs = $subH{$ss}->{$role};
61          if (@$pegs < 4)          if (@$pegs < 8)
62          {          {
63              print STDERR "Skipping $dir/$ssN/$roleN, role $role --- only ", (scalar @$pegs), " pegs\n";              print STDERR "Skipping $dir/$ssN/$roleN, role $role --- only ", (scalar @$pegs), " pegs\n";
64              next;              next;
65          }          }
66    
67            print INDEXR "$roleN\t$role\n";
68    
69          open(TMP,">$tmpF") || die "could not open $tmpF";          open(TMP,">$tmpF") || die "could not open $tmpF";
70          foreach $peg (@$pegs)          foreach $peg (@$pegs)
71          {          {
# Line 57  Line 81 
81          close(TMP);          close(TMP);
82    
83          mkdir("$dir/$ssN/$roleN",0777) || die "could not make $dir/$ssN/$roleN";          mkdir("$dir/$ssN/$roleN",0777) || die "could not make $dir/$ssN/$roleN";
84          &FIG::run("split_and_trim_sequences $dir/$ssN/$roleN/split_info < $tmpF");          &FIG::run("split_and_trim_sequences $dir/$ssN/$roleN/split_info $sim_cutoff $frac_cov < $tmpF");
85    
86          if (-s "$dir/$ssN/$roleN/split_info/set.sizes")          if (-s "$dir/$ssN/$roleN/split_info/set.sizes")
87          {          {

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3