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

Diff of /FigKernelScripts/svr_corr_by_exp.pl

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

revision 1.4, Sat Apr 2 14:59:17 2011 UTC revision 1.5, Mon Apr 4 02:57:39 2011 UTC
# Line 68  Line 68 
68  use SAPserver;  use SAPserver;
69  my $sapObject = SAPserver->new();  my $sapObject = SAPserver->new();
70  use Getopt::Long;  use Getopt::Long;
71    use ScriptThing;
72    
73  my $usage = "usage: svr_corr_by_exp [-c column] [-m minPCC] [-max MaxReturned]";  my $usage = "usage: svr_corr_by_exp [-c column] [-m minPCC] [-max MaxReturned]";
74    
# Line 80  Line 81 
81    
82  if (! $rc) { print STDERR $usage; exit }  if (! $rc) { print STDERR $usage; exit }
83    
84  my @lines = map { chomp; [split(/\t/,$_)] } <STDIN>;  while (my @tuples = ScriptThing::GetBatch(\*STDIN, 5, $column)) {
85  if (! $column)  { $column = @{$lines[0]} }      my $corrH = $sapObject->coregulated_fids(-ids => [map { $_->[0] } @tuples]);
86  my @fids = map { $_->[$column-1] } @lines;      foreach my $tuple (@tuples) {
   
 my $corrH = $sapObject->coregulated_fids(-ids => \@fids);  
 foreach $_ (@lines)  
 {  
87      my $printed = 0;      my $printed = 0;
88      my $peg = $_->[$column-1];          my ($peg, $line) = @$tuple;
89      if (my $x = $corrH->{$peg})          if (my $x = $corrH->{$peg}) {
     {  
90          my @pegs2 = keys(%$x);          my @pegs2 = keys(%$x);
91          foreach my $peg2 (@pegs2)              foreach my $peg2 (@pegs2) {
         {  
92              my $pcc = sprintf("%0.3f",$x->{$peg2});              my $pcc = sprintf("%0.3f",$x->{$peg2});
93              if ($pcc >= $min_pcc)              if ($pcc >= $min_pcc)
94              {              {
95                  if ($printed < $maxR)                  if ($printed < $maxR)
96                  {                  {
97                      print join("\t",(@$_,$pcc,$peg2)),"\n";                          print join("\t",($line,$pcc,$peg2)),"\n";
98                      $printed++;                      $printed++;
99                  }                  }
100              }              }
101          }          }
102      }      }
103  }  }
104    }

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3