0
|
1
|
|
2 use strict;
|
|
3 use warnings;
|
|
4 use File::Basename;
|
|
5 use Cwd;
|
|
6 use File::Path qw(make_path remove_tree);
|
|
7 die qq(
|
|
8 Bad numbr of inputs
|
|
9
|
|
10 ) if(!@ARGV);
|
|
11
|
|
12 my $bam_normal;
|
|
13 my $bam_tumor;
|
|
14 my $player_options = "";
|
|
15 my $output;
|
|
16 my $action;
|
|
17 my $ref_genome;
|
|
18
|
|
19 foreach my $input (@ARGV)
|
|
20 {
|
|
21 my @tmp = split "::", $input;
|
|
22 if($tmp[0] eq "BAMNORMAL")
|
|
23 {
|
|
24 $bam_normal = $tmp[1];
|
|
25 }
|
|
26 elsif($tmp[0] eq "BAMTUMOR")
|
|
27 {
|
|
28 $bam_tumor = $tmp[1];
|
|
29 }
|
|
30 elsif($tmp[0] eq "OPTION")
|
|
31 {
|
|
32 $player_options = "$player_options ${tmp[1]}";
|
|
33 }
|
|
34 elsif($tmp[0] eq "REFGENOME")
|
|
35 {
|
|
36 $ref_genome = $tmp[1];
|
|
37 }
|
|
38 elsif($tmp[0] eq "ACTION")
|
|
39 {
|
|
40 $action = $tmp[1];
|
|
41 }
|
|
42 elsif($tmp[0] eq "OUTPUT")
|
|
43 {
|
|
44 $output = $tmp[1];
|
|
45 }
|
|
46
|
|
47 else
|
|
48 {
|
|
49 die("Unknown Input: $input\n");
|
|
50 }
|
|
51 }
|
|
52
|
|
53
|
|
54 #Create Symbolic links and indexes
|
|
55
|
|
56 my $working_dir = cwd();
|
|
57
|
|
58 system ("ln -s $bam_normal $working_dir/normal.bam");
|
|
59 system ("samtools index $working_dir/normal.bam");
|
|
60
|
|
61 system ("ln -s $bam_tumor $working_dir/tumor.bam");
|
|
62 system ("samtools index $working_dir/tumor.bam");
|
|
63
|
|
64
|
|
65 #run jsm
|
|
66
|
|
67 if($action eq "classify")
|
|
68 {
|
|
69 system ("jsm.py $action $player_options $ref_genome $working_dir/normal.bam $working_dir/tumor.bam");
|
|
70 }
|
|
71 else
|
|
72 {
|
|
73 system ("jsm.py $action $player_options $ref_genome $working_dir/normal.bam $working_dir/tumor.bam $output");
|
|
74 }
|
|
75
|