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

Diff of /FigKernelScripts/ma_pipeline.pl

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

revision 1.2, Wed May 5 15:17:38 2010 UTC revision 1.8, Mon May 17 13:30:58 2010 UTC
# Line 1  Line 1 
1  use strict;  use strict;
2  use Data::Dumper;  use Data::Dumper;
3    
4  my $usage = "usage: ma_pipeline OrgDir RMA-key";  my $usage = "usage: ma_pipeline Genome RMA-key";
5    
6  my($orgD);  my($genome,$orgD);
7  (  (
8   ($orgD = shift @ARGV)   ($genome = shift @ARGV) && ($orgD = "$FIG_Config::organisms/$genome")
9   )   )
10      || die $usage;      || die $usage;
11  (my $rma_key = sift @ARGV)  
12    (-d $orgD) || die "invalid organism directory";
13    
14    (my $rma_key = shift @ARGV)
15      || die $usage;      || die $usage;
16    
17  my $exp_ed = "$orgD/UserSpace/ExpressionData";  my $exp_ed = "$orgD/UserSpace/ExpressionData";
# Line 21  Line 24 
24  (-s "$orgD/Features/peg/tbl")  (-s "$orgD/Features/peg/tbl")
25      || die "Where is $orgD/Features/peg/tbl?";      || die "Where is $orgD/Features/peg/tbl?";
26    
27  system "make_probes_to_genes $exp_ed/probes $orgD/contigs $orgD/Features/peg/tbl $exp_ed/peg.probe.table $exp_ed/probe.occ.table 2> $exp_ed/problems";  &run("make_probes_to_genes $exp_ed/probes $orgD/contigs $orgD/Features/peg/tbl $exp_ed/peg.probe.table $exp_ed/probe.occ.table 2> $exp_ed/problems");
28    &run("remove_multiple_occurring_probes $exp_ed/peg.probe.table $exp_ed/probe.occ.table > $exp_ed/peg.probe.table.no.multiple");
29  system "Rscript $FIG_Config::bin/RunRMA.R $rma_key $exp_ed/peg.probe.table $exp_ed/Experiments 2> $exp_ed/stderr.RMA";  system "pushd $exp_ed";
30    chdir $exp_ed;
31    
32    &run("Rscript $FIG_Config::bin/RunRMA.R $rma_key $exp_ed/peg.probe.table $exp_ed/Experiments 2> $exp_ed/stderr.RMA");
33    &run("$FIG_Config::bin/call_coregulated_clusters_on_chromosome $genome $exp_ed/raw_data.tab > $exp_ed/coregulated.clusters 2> $exp_ed/stderr.coregulated.clusters");
34    &run("$FIG_Config::bin/make_coreg_conjectures_based_on_subsys  $genome $exp_ed/raw_data.tab > $exp_ed/coregulated.subsys   2> $exp_ed/stderr.coregulated.subsys");
35    &run("cat $exp_ed/coregulated.clusters $exp_ed/coregulated.subsys | cut -f1 | $FIG_Config::bin/merge_gene_sets | filter_on_known $exp_ed/raw_data.tab > $exp_ed/merged.clusters");
36    
37    &run("get_ON_probes $genome $exp_ed/probe.occ.table $exp_ed/peg.probe.table $exp_ed/raw_data.tab > $exp_ed/probes.always.on");
38    &run("cut -f2 $exp_ed/probes.always.on | sort -u > $exp_ed/pegs.always.on");
39    &run("Rscript $FIG_Config::bin/Pipeline.R $exp_ed/pegs.always.on $exp_ed/merged.clusters > $exp_ed/comments.by.Pipeline.R");
40    &run("Rscript $FIG_Config::bin/SplitGeneSets.R $exp_ed/merged.clusters 0.7 > $exp_ed/split.clusters");
41    system "popd";
42    
43    sub run {
44        shift if UNIVERSAL::isa($_[0],__PACKAGE__);
45        my($cmd) = @_;
46    
47        if ($ENV{FIG_VERBOSE}) {
48            my @tmp = `date`;
49            chomp @tmp;
50            print STDERR "$tmp[0]: running $cmd\n";
51        }
52        (system($cmd) == 0) || die("FAILED: $cmd");
53    }
54    
 system "$FIG_Config::bin/call_coregulated_clusters_on_chromosome $genome $exp_ed/raw_data.tab > $exp_ed/coregulated.clusters 2> $exp_ed/stderr.coregulated.clusters";  
 system "$FIG_Config::bin/make_coreg_conjectures_based_on_subsys  $genome $exp_ed/raw_data.tab > $exp_ed/coregulated.subsys   2> $exp_ed/stderr.coregulated.subsys";  
 system "cat $exp_ed/coregulated.clusters $exp_ed/coregulated.subsys | cut -f1 | $FIG_Config::bin/merge_gene_sets > $exp_ed/merged.clusters";  
 system "Rscript $FIG_Config::bin/Pipeline.R $exp_ed/merged.clusters 0.7 > $exp_ed/comments.by.Pipeline.R";  
 system "Rscript $FIG_Config::bin/SplitGeneSets.R $exp_ed/merged.clusters 0.7 > $exp_ed/split.clusters";  

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.8

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3