annotate somatic_sniper_wrapper.pl @ 18:32fd2c1af529 draft

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