changeset 9:0e8e6011082b

Strelka Workflow 0.0.2
author mini
date Fri, 26 Sep 2014 15:51:35 +0200
parents 2cee4ed50058
children 137e05f24336
files libexec/callSomaticVariants.pl libexec/consolidateResults.pl libexec/filterSomaticVariants.pl strelka_wrapper.py
diffstat 4 files changed, 10 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/libexec/callSomaticVariants.pl	Fri Sep 26 14:33:07 2014 +0200
+++ b/libexec/callSomaticVariants.pl	Fri Sep 26 15:51:35 2014 +0200
@@ -1,7 +1,5 @@
 #!/usr/bin/env perl
-print "\n";
-print @INC;
-print "\n";
+
 =head1 LICENSE
 
 Strelka Workflow Software
@@ -38,9 +36,6 @@
 my $baseDir;
 my $libDir;
 BEGIN {
-print "\n";
-print @INC;
-print "\n";
 
     my $thisDir=(File::Spec->splitpath($0))[1];
     $baseDir=File::Spec->catdir($thisDir,File::Spec->updir());
@@ -48,12 +43,12 @@
 }
 use lib $libDir;
 use Utils;
+print "all imported call";
 
 if(getAbsPath($baseDir)) {
     errorX("Can't resolve path for strelka_workflow install directory: '$baseDir'");
 }
 my $libexecDir=File::Spec->catdir($baseDir,'libexec');
-#my $optDir=File::Spec->catdir($baseDir,'opt');
 
 
 my $scriptName=(File::Spec->splitpath($0))[2];
@@ -82,12 +77,9 @@
 #
 checkDir($baseDir);
 checkDir($libexecDir);
-#checkDir($optDir);
 
 my $strelkaBin=File::Spec->catdir($libexecDir,'strelka2');
 checkFile($strelkaBin,"strelka binary");
-#my $samtoolsBin = File::Spec->catfile($optDir,'samtools','samtools');
-#checkFile($samtoolsBin,"samtools binary");
 
 
 
--- a/libexec/consolidateResults.pl	Fri Sep 26 14:33:07 2014 +0200
+++ b/libexec/consolidateResults.pl	Fri Sep 26 15:51:35 2014 +0200
@@ -35,24 +35,18 @@
 
 my $baseDir;
 my $libDir;
-#my $optDir;
-#my $vcftDir;
 BEGIN {
     my $thisDir=(File::Spec->splitpath($0))[1];
     $baseDir=File::Spec->catdir($thisDir,File::Spec->updir());
     $libDir=File::Spec->catdir($baseDir,'lib');
-    #$optDir=File::Spec->catdir($baseDir,'opt');
-    #$vcftDir=File::Spec->catdir($optDir,'vcftools','lib','perl5','site_perl');
 }
 use lib $libDir;
 use Utils;
-#use lib $vcftDir;
 use Vcf;
 
 if(getAbsPath($baseDir)) {
     errorX("Can't resolve path for strelka_workflow install directory: '$baseDir'");
 }
-#$optDir=File::Spec->catdir($baseDir,'opt');
 
 
 my $scriptName=(File::Spec->splitpath($0))[2];
@@ -70,13 +64,6 @@
 pod2usage(2) unless(defined($configFile));
 
 #
-# check fixed paths
-#
-#my $samtoolsBin = File::Spec->catfile($optDir,'samtools','samtools');
-#checkFile($samtoolsBin,"samtools binary");
-
-
-#
 # read config and validate values
 #
 checkFile($configFile,"configuration ini");
@@ -247,17 +234,17 @@
     return unless(scalar(@bamList));
 
     my $headerFH = File::Temp->new();
-    my $getHeaderCmd = "bash -c '$samtoolsBin view -H ".$bamList[0]." > $headerFH'";
+    my $getHeaderCmd = "bash -c 'samtools view -H ".$bamList[0]." > $headerFH'";
     executeCmd($getHeaderCmd);
 
     my $allFile = File::Spec->catfile($reDir,$fileName . $itag);
-    my $cmd="$samtoolsBin merge -h $headerFH $allFile ". join(" ",@bamList);
+    my $cmd="samtools merge -h $headerFH $allFile ". join(" ",@bamList);
     executeCmd($cmd);
 
     my $allFileFinished = File::Spec->catfile($reDir,$fileName);
     checkMove($allFile,$allFileFinished);
 
-    my $indexCmd="$samtoolsBin index $allFileFinished";
+    my $indexCmd="samtools index $allFileFinished";
     executeCmd($indexCmd);
 
     # for now don't remove all the bin realignments...
--- a/libexec/filterSomaticVariants.pl	Fri Sep 26 14:33:07 2014 +0200
+++ b/libexec/filterSomaticVariants.pl	Fri Sep 26 15:51:35 2014 +0200
@@ -34,18 +34,15 @@
 
 my $baseDir;
 my $libDir;
-#my $vcftDir;
 BEGIN {
     my $thisDir=(File::Spec->splitpath($0))[1];
     $baseDir=File::Spec->catdir($thisDir,File::Spec->updir());
     $libDir=File::Spec->catdir($baseDir,'lib');
-    #my $optDir=File::Spec->catdir($baseDir,'opt');
-    #$vcftDir=File::Spec->catdir($optDir,'vcftools','lib','perl5','site_perl');
 }
 use lib $libDir;
 use Utils;
-#use lib $vcftDir;
-#use Vcf;
+use Vcf;
+print "all imported in filter";
 
 
 my $scriptName=(File::Spec->splitpath($0))[2];
--- a/strelka_wrapper.py	Fri Sep 26 14:33:07 2014 +0200
+++ b/strelka_wrapper.py	Fri Sep 26 15:51:35 2014 +0200
@@ -98,7 +98,7 @@
     job_dir=os.getcwd()
     analysis_dir=job_dir + "/StrelkaAnalysis"
     config_script=root_dir + "/configureStrelkaWorkflow.pl"
-    tmp_dir = "tmp"  #tempfile.mkdtemp( prefix='tmp-strelkaAnalysis-' )
+    tmp_dir = tempfile.mkdtemp( prefix='tmp-strelkaAnalysis-' )
     config_ini = "%s/config.ini" % (tmp_dir)
 
     print("root_dir: " + root_dir + "\njob_dir :" + job_dir + "\nanalysis_dir :" + analysis_dir + "\nconfig_script :" + config_script + "\ntmp_dir :" + tmp_dir + "\nconfig_ini :" +  config_ini)
@@ -113,7 +113,7 @@
     
 
     # creating index if needed
-    os.environ['PATH']= root_dir + "/opt/samtools:" + os.environ['PATH']
+    #os.environ['PATH']= root_dir + "/opt/samtools:" + os.environ['PATH']
     bam_filenames = [ args.tumorBam, args.normalBam ]
     index_bam_files( bam_filenames, tmp_dir )
     fasta_files = [ args.refFile ]
@@ -129,7 +129,7 @@
     	if not os.path.exists(args.configFile):
 	     print( "The path to your configuration File seems to be wrong, use another one or custom option", file=sys.stderr)
     	cmdbash="cp %s %s" % (args.configFile, config_ini)
-        my_Popen(cmdbash, "copy_default_file_err", tmp_dir, "Error during the copy of default config file, maybe it was removed")
+        my_Popen(cmdbash, "copy_default_file_err", tmp_dir, "Error during the copy of the selected config file")