0
|
1 use strict;
|
|
2 use warnings;
|
|
3 use File::Basename;
|
|
4 use Cwd;
|
|
5 use File::Path qw(make_path remove_tree);
|
|
6 die qq(
|
|
7 Bad numbr of inputs
|
|
8
|
|
9 ) if(!@ARGV);
|
|
10
|
|
11 my $options ="";
|
|
12 my $normal="";
|
|
13 my $tumor="";
|
|
14 my $output="";
|
|
15
|
|
16
|
|
17 foreach my $input (@ARGV)
|
|
18 {
|
|
19 my @tmp = split "::", $input;
|
|
20 if($tmp[0] eq "NORMAL")
|
|
21 {
|
|
22 $normal = $tmp[1];
|
|
23 }
|
|
24 elsif($tmp[0] eq "TUMOR")
|
|
25 {
|
|
26 $tumor = $tmp[1];
|
|
27 }
|
|
28 elsif($tmp[0] eq "OUTPUT")
|
|
29 {
|
|
30 $output = $tmp[1];
|
|
31 }
|
|
32 elsif($tmp[0] eq "OPTION")
|
|
33 {
|
|
34 $options = "$options ${tmp[1]}";
|
|
35 }
|
|
36
|
|
37 else
|
|
38 {
|
|
39 die("Unknown Input: $input\n");
|
|
40 }
|
|
41 }
|
|
42
|
|
43
|
|
44 my $working_dir = cwd();
|
|
45
|
|
46 system ("ln -s $normal $working_dir/normal.bam");
|
|
47 system ("samtools index $working_dir/normal.bam");
|
|
48
|
|
49 system ("ln -s $tumor $working_dir/tumor.bam");
|
|
50 system ("samtools index $working_dir/tumor.bam");
|
|
51
|
|
52 system ("bam-somaticsniper $options $working_dir/tumor.bam $working_dir/normal.bam $output");
|
|
53
|
|
54
|