changeset 9:2e66a79fe57f draft

Uploaded
author nilesh
date Fri, 28 Jun 2013 16:36:15 -0400
parents 5e4aa9a970db
children 9d9ce3f5a383
files somatic_sniper_wrapper.pl
diffstat 1 files changed, 54 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/somatic_sniper_wrapper.pl	Fri Jun 28 16:36:15 2013 -0400
@@ -0,0 +1,54 @@
+use strict;
+use warnings;
+use File::Basename; 
+use Cwd;
+use File::Path qw(make_path remove_tree);
+die qq(
+Bad numbr of inputs
+
+) if(!@ARGV);
+
+my $options ="";
+my $normal="";
+my $tumor="";
+my $output="";
+
+
+foreach my $input (@ARGV) 
+{
+	my @tmp = split "::", $input;
+	if($tmp[0] eq "NORMAL") 
+	{
+		$normal = $tmp[1];
+	} 
+	elsif($tmp[0] eq "TUMOR") 
+	{
+		$tumor = $tmp[1];
+	}
+	elsif($tmp[0] eq "OUTPUT") 
+	{
+		$output = $tmp[1];
+	}
+	elsif($tmp[0] eq "OPTION") 
+	{
+		$options = "$options ${tmp[1]}";
+	}
+	
+	else 
+	{
+		die("Unknown Input: $input\n");
+	}
+}
+
+
+my $working_dir = cwd();
+
+system ("ln -s $normal $working_dir/normal.bam");
+system ("samtools index $working_dir/normal.bam");
+ 
+system ("ln -s $tumor $working_dir/tumor.bam");
+system ("samtools index $working_dir/tumor.bam");
+
+system ("bam-somaticsniper $options $working_dir/tumor.bam $working_dir/normal.bam $output");
+
+