[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.3, Tue Feb 8 20:06:35 2011 UTC revision 1.4, Sat Apr 2 14:59:17 2011 UTC
# Line 1  Line 1 
1    
2  use strict;  use strict;
3  use Data::Dumper;  use Data::Dumper;
4  use Carp;  use Carp;
# Line 18  Line 19 
19      svr_all_features 83333.1 peg | svr_corr_by_exp      svr_all_features 83333.1 peg | svr_corr_by_exp
20    
21  would produce a 3-column table.  The first column would contain  would produce a 3-column table.  The first column would contain
22  PEG IDs for genes occurring in genome 3702.1, the second would give the  PEG IDs for genes occurring in genome 83333.1, the second would give the
23  Pearson correlation coefficient, and the third would give the PEG that  Pearson correlation coefficient, and the third would give the PEG that
24  seems to have a similar expression profile..  seems to have a similar expression profile..
25    
# Line 46  Line 47 
47    
48  =item -m Minimum value for the Pearson correlation coefficient  =item -m Minimum value for the Pearson correlation coefficient
49    
50    =item -max MaxReturned [default 1000000]
51    
52    This is used to restrict the number of results displayed for a single incoming line (not a restriction
53    on the number of tatal lines)
54    
55  =back  =back
56    
57  =head2 Output Format  =head2 Output Format
# Line 63  Line 69 
69  my $sapObject = SAPserver->new();  my $sapObject = SAPserver->new();
70  use Getopt::Long;  use Getopt::Long;
71    
72  my $usage = "usage: svr_corr_by_exp [-c column]";  my $usage = "usage: svr_corr_by_exp [-c column] [-m minPCC] [-max MaxReturned]";
73    
74  my $column;  my $column;
75    my $maxR  = 100000;
76  my $min_pcc = 0;  my $min_pcc = 0;
77  my $rc  = GetOptions('c=i' => \$column,  my $rc  = GetOptions('c=i' => \$column,
78                         'max=i'  => \$maxR,
79                       'm=f' => \$min_pcc);                       'm=f' => \$min_pcc);
80    
81  if (! $rc) { print STDERR $usage; exit }  if (! $rc) { print STDERR $usage; exit }
# Line 79  Line 87 
87  my $corrH = $sapObject->coregulated_fids(-ids => \@fids);  my $corrH = $sapObject->coregulated_fids(-ids => \@fids);
88  foreach $_ (@lines)  foreach $_ (@lines)
89  {  {
90        my $printed = 0;
91      my $peg = $_->[$column-1];      my $peg = $_->[$column-1];
92      if (my $x = $corrH->{$peg})      if (my $x = $corrH->{$peg})
93      {      {
# Line 88  Line 97 
97              my $pcc = sprintf("%0.3f",$x->{$peg2});              my $pcc = sprintf("%0.3f",$x->{$peg2});
98              if ($pcc >= $min_pcc)              if ($pcc >= $min_pcc)
99              {              {
100                    if ($printed < $maxR)
101                    {
102                  print join("\t",(@$_,$pcc,$peg2)),"\n";                  print join("\t",(@$_,$pcc,$peg2)),"\n";
103                        $printed++;
104                    }
105              }              }
106          }          }
107      }      }

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3