annotate somatic_sniper_wrapper.pl @ 1:de08d9401816 default tip

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