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

Diff of /FigKernelScripts/make_coreg_conjectures_based_on_subsys.pl

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

revision 1.4, Fri Jan 7 22:20:38 2011 UTC revision 1.5, Tue Apr 19 00:11:18 2011 UTC
# Line 6  Line 6 
6  use ExpressionDir;  use ExpressionDir;
7    
8  my($expr_dir);  my($expr_dir);
9  my $usage = "usage: make_coreg_conjectures_based_on_subsys expr_dir";  my $usage = "usage: make_coreg_conjectures_based_on_subsys expr_dir [subsystems-dir]";
10  (  (
11   ($expr_dir   = shift @ARGV)   ($expr_dir   = shift @ARGV)
12  )  )
13      || die $usage;      || die $usage;
14    
15    my %sets;
16    if ((@ARGV > 0) && (-s "$ARGV[0]/bindings"))
17    {
18        foreach $_ (`cat $ARGV[0]/bindings`)
19        {
20            chop;
21            my($ss,$role,$peg) = split(/\t/,$_);
22            push(@{$sets{$ss}},$peg);
23        }
24    }
25    
26  my $exprO = ExpressionDir->new($expr_dir);  my $exprO = ExpressionDir->new($expr_dir);
27  my $rawF = $exprO->expr_dir . "/rma_normalized.tab";  my $rawF = $exprO->expr_dir . "/rma_normalized.tab";
28    
29  my %bad_subsystems;  my %bad_subsystems;
 if (@ARGV > 0)  
 {  
     map { $_ =~ /^(\S.*\S)/; $1 => 1 } `cat $ARGV[0]`;  
 }  
30    
31  #my $sapO    = SAPserver->new;  #my $sapO    = SAPserver->new;
32    
# Line 32  Line 39 
39  #my $subH = $sapO->ids_in_subsystems( -subsystems => \@subs,  #my $subH = $sapO->ids_in_subsystems( -subsystems => \@subs,
40  #                                    -genome     => $genome);  #                                    -genome     => $genome);
41  my $subH = $exprO->ids_in_subsystems();  my $subH = $exprO->ids_in_subsystems();
42  my @subs = keys %$subH;  my @subs = sort (@ARGV[0] ? keys(%sets) : keys %$subH);
43    
44  my %bad;  my %bad;
45    
46  foreach my $sub (@subs)  foreach my $sub (@subs)
47  {  {
48      my %pegs;      my %pegs;
49        my @pegs;
50        if (@ARGV[0])
51        {
52            @pegs = sort { &SeedUtils::by_fig_id($a,$b) }@{$sets{$sub}};
53        }
54        else
55        {
56      my $sub_entry = $subH->{$sub};      my $sub_entry = $subH->{$sub};
57      my @pegs = ();          @pegs = ();
58      foreach my $role (keys(%$sub_entry))      foreach my $role (keys(%$sub_entry))
59      {      {
60          my $pegs = $sub_entry->{$role};          my $pegs = $sub_entry->{$role};
61          foreach $_ (@$pegs) { $pegs{$_} = 1 }          foreach $_ (@$pegs) { $pegs{$_} = 1 }
62      }      }
63      @pegs = sort { &SeedUtils::by_fig_id($a,$b) } keys(%pegs);      @pegs = sort { &SeedUtils::by_fig_id($a,$b) } keys(%pegs);
64        }
65    
66      my @sets = grep { @$_ > 1 } split_on_pc(\@pegs,$corrH);      my @sets = grep { @$_ > 1 } split_on_pc(\@pegs,$corrH);
67    

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3