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

Diff of /FigKernelScripts/exp_pc_compute.pl

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

revision 1.1, Tue Jul 19 19:35:51 2011 UTC revision 1.3, Wed Jul 20 13:09:35 2011 UTC
# Line 50  Line 50 
50  C<out>I<User>C<.log>, respectively, where I<User> is the value of the  C<out>I<User>C<.log>, respectively, where I<User> is the value of the
51  B<user> option above.  B<user> option above.
52    
53    =item recursive
54    
55    If specified, then instead of treating the positional parameter as an expression
56    directory, it is treated as a directory of directories, and all the sub-directories
57    are processed.
58    
59  =item h  =item h
60    
61  Display this command's parameters and options.  Display this command's parameters and options.
# Line 63  Line 69 
69      use Tracer;      use Tracer;
70    
71  # Get the command-line options and parameters.  # Get the command-line options and parameters.
72  my ($options, @parameters) = StandardSetup([qw() ], {},  my ($options, @parameters) = StandardSetup([qw() ],
73                                               { recursive => ["", "if specified, all child directories will be processed"] },
74                                             "<expressionDirectory>",                                             "<expressionDirectory>",
75                                             @ARGV);                                             @ARGV);
76  # Get the expression directory.  # Get the expression directory.
77  my $expDataDirectory = $ARGV[0];  my $mainDirectory = $parameters[0];
78  if (! -d $expDataDirectory) {  if (! -d $mainDirectory) {
79      # It wasn't found, so complain.      # It wasn't found, so complain.
80      Trace("Directory $expDataDirectory not found.") if T(0);      Trace("Directory $mainDirectory not found.") if T(0);
81  } else {  } else {
82        # Get the list of directories to process.
83        my @dirs;
84        if ($options->{recursive}) {
85            # Direct mode. Process the incoming directory.
86            push @dirs, $mainDirectory;
87        } else {
88            # Recursive mode. Process the subdirectories.
89            if (opendir(my $dh, $mainDirectory)) {
90                my @genomes = grep { $_ =~ /^\d+$/ } readdir $dh;
91                push @dirs, map { "$mainDirectory/$_" } @genomes;
92            }
93        }
94        # Process all the directories.
95        for my $expDataDirectory (@dirs) {
96      # Get the raw data file.      # Get the raw data file.
97      my $raw_data_file = "$expDataDirectory/rma_normalized.tab";      my $raw_data_file = "$expDataDirectory/rma_normalized.tab";
98      if (! -f $raw_data_file) {      if (! -f $raw_data_file) {
# Line 124  Line 145 
145          }          }
146      }      }
147  }  }
148    }
149    
150  =head3 compute_pc  =head3 compute_pc
151    

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3