annotate somatic_sniper_wrapper.pl @ 0:e81f5649bd4d draft default tip

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