-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetMango.DMR.pl
29 lines (29 loc) · 2.06 KB
/
getMango.DMR.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!perl -w
$id = `grep '>' $ARGV[4]`;
$id =~ s/>//g;
$id =~ s/\n//g;
$out1 = $id.".".$ARGV[0];
$out2 = $id.".".$ARGV[1];
$out3 = $id.".".$ARGV[2];
$out4 = $id.".".$ARGV[3];
$bout1 = $id.".".$ARGV[0].".bed";
$bout2 = $id.".".$ARGV[1].".bed";
$bout3 = $id.".".$ARGV[2].".bed";
$bout4 = $id.".".$ARGV[3].".bed";
$dmr = $id.".".$ARGV[0]."vs".$ARGV[2];
$dmr =~ s/\.rep1\.meth//g;
system ("bash /gpfsdata/Mango/Methylation/Result/DMR/get_DMRcaller_data.sh $ARGV[0] $id $out1 $bout1");
system ("bash /gpfsdata/Mango/Methylation/Result/DMR/get_DMRcaller_data.sh $ARGV[1] $id $out2 $bout2");
system ("bash /gpfsdata/Mango/Methylation/Result/DMR/get_DMRcaller_data.sh $ARGV[2] $id $out3 $bout3");
system ("bash /gpfsdata/Mango/Methylation/Result/DMR/get_DMRcaller_data.sh $ARGV[3] $id $out4 $bout4");
system ("sort $bout1 $bout2 |uniq > $bout1.$bout2");
system ("sort $bout1.$bout2 $bout3 |uniq > $bout1.$bout2.$bout3");
system ("sort $bout1.$bout2.$bout3 $bout4 |uniq > $bout1.$bout2.$bout3.$bout4");
system ("sed -i \"s\/\#\/\\t\/g\" $bout1.$bout2.$bout3.$bout4" );
system ("sort -k1,1 -k2n,2 $bout1.$bout2.$bout3.$bout4 >$bout1.$bout2.$bout3.$bout4.sort.txt");
system ("rm $bout1 $bout2 $bout3 $bout4 $bout1.$bout2 $bout1.$bout2.$bout3 $bout1.$bout2.$bout3.$bout4");
system ("perl /gpfsdata/shiyan/Poaceae/Pineapple/BS-seq/DMR2/getAll_C.pl $out1 $bout1.$bout2.$bout3.$bout4.sort.txt >$out1.all");
system ("perl /gpfsdata/shiyan/Poaceae/Pineapple/BS-seq/DMR2/getAll_C.pl $out2 $bout1.$bout2.$bout3.$bout4.sort.txt >$out2.all");
system ("perl /gpfsdata/shiyan/Poaceae/Pineapple/BS-seq/DMR2/getAll_C.pl $out3 $bout1.$bout2.$bout3.$bout4.sort.txt >$out3.all");
system ("perl /gpfsdata/shiyan/Poaceae/Pineapple/BS-seq/DMR2/getAll_C.pl $out4 $bout1.$bout2.$bout3.$bout4.sort.txt >$out4.all");
system ("Rscript /gpfsdata/shiyan/Mango/Meth/DMR/Call.DMR.R $out1.all $out2.all $out3.all $out4.all $dmr");