26 |
|
|
27 |
&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"); |
&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"); |
&run("remove_multiple_occurring_probes $exp_ed/peg.probe.table $exp_ed/probe.occ.table > $exp_ed/peg.probe.table.no.multiple"); |
|
system "pushd $exp_ed"; |
|
29 |
chdir $exp_ed; |
chdir $exp_ed; |
30 |
|
|
31 |
&run("Rscript $FIG_Config::bin/RunRMA.R $rma_key $exp_ed/peg.probe.table $exp_ed/Experiments 2> $exp_ed/stderr.RMA"); |
&make_missing_probes("$exp_ed/peg.probe.table.no.multiple", "$exp_ed/probes", "$exp_ed/probe.no.match"); |
32 |
|
|
33 |
|
&run("Rscript $FIG_Config::bin/RunRMA.R $rma_key $exp_ed $exp_ed/Experiments 2> $exp_ed/stderr.RMA"); |
34 |
&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"); |
&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"); |
35 |
&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"); |
&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"); |
36 |
&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"); |
&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"); |
39 |
&run("cut -f2 $exp_ed/probes.always.on | sort -u > $exp_ed/pegs.always.on"); |
&run("cut -f2 $exp_ed/probes.always.on | sort -u > $exp_ed/pegs.always.on"); |
40 |
&run("Rscript $FIG_Config::bin/Pipeline.R $exp_ed/pegs.always.on $exp_ed/merged.clusters > $exp_ed/comments.by.Pipeline.R"); |
&run("Rscript $FIG_Config::bin/Pipeline.R $exp_ed/pegs.always.on $exp_ed/merged.clusters > $exp_ed/comments.by.Pipeline.R"); |
41 |
&run("Rscript $FIG_Config::bin/SplitGeneSets.R $exp_ed/merged.clusters 0.7 > $exp_ed/split.clusters"); |
&run("Rscript $FIG_Config::bin/SplitGeneSets.R $exp_ed/merged.clusters 0.7 > $exp_ed/split.clusters"); |
42 |
system "popd"; |
|
43 |
|
sub make_missing_probes |
44 |
|
{ |
45 |
|
my($probe_table, $probes, $output) = @_; |
46 |
|
open(MATCH,"<", $probe_table) or die "Cannot open $probe_table: $!"; |
47 |
|
open(PROBES,"<", $probes) or die "Cannot open $probes: $!"; |
48 |
|
open(OUTPUT, ">", $output) or die "Cannot open $output: $!"; |
49 |
|
my %locations; |
50 |
|
while(<MATCH>) |
51 |
|
{ |
52 |
|
chomp; |
53 |
|
my($peg,$loc)=split "\t"; |
54 |
|
$locations{$loc} = $peg; |
55 |
|
} |
56 |
|
|
57 |
|
while(<PROBES>) |
58 |
|
{ |
59 |
|
chomp; |
60 |
|
my($loc,$seq) = split "\t"; |
61 |
|
print OUTPUT $loc, "\n" if ! exists $locations{$loc}; |
62 |
|
} |
63 |
|
close(MATCH); |
64 |
|
close(PROBES); |
65 |
|
close(OUTPUT); |
66 |
|
} |
67 |
|
|
68 |
sub run { |
sub run { |
69 |
shift if UNIVERSAL::isa($_[0],__PACKAGE__); |
shift if UNIVERSAL::isa($_[0],__PACKAGE__); |