changeset 7:3e8541ece3c7

trying to fix environment variable 0.0.1
author mini
date Fri, 26 Sep 2014 14:30:27 +0200
parents 87568e5a7d4f
children 2cee4ed50058
files strelka.xml strelka_wrapper.py tool_dependencies.xml tralalalala
diffstat 3 files changed, 18 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/strelka.xml	Fri Sep 26 13:24:13 2014 +0200
+++ b/strelka.xml	Fri Sep 26 14:30:27 2014 +0200
@@ -2,6 +2,7 @@
 
   <description>Strelka good interface but no dependencies</description>
   <requirements>
+    <requirement type="set_environment">SCRIPT_PATH</requirement>
     <requirement type="package" version="0.1.18">samtools</requirement>
     <requirement type="package" version="0.1.11">vcftools</requirement>
   </requirements>
@@ -35,6 +36,7 @@
 	      --extraStrelkaArguments 		    $configuration.extra_arguments.extraStrelkaArguments
         #end if
    #end if
+        --scriptPath				\$SCRIPT_PATH
    </command>
 
    <inputs>
--- a/strelka_wrapper.py	Fri Sep 26 13:24:13 2014 +0200
+++ b/strelka_wrapper.py	Fri Sep 26 14:30:27 2014 +0200
@@ -26,7 +26,7 @@
     conf_file = open(config_path, "w")
     conf_file.write("[user]\n")
     for option in args:
-        if not option in ["tumorBam", "normalBam", "refFile", "configFile"] and args[option]!=None:
+        if not option in ["tumorBam", "normalBam", "refFile", "configFile", "scriptPath"] and args[option]!=None:
     	    conf_file.write("%s=%s\n" % (option, args[option]))
     conf_file.close()
 
@@ -64,17 +64,6 @@
 def __main__():
     #Parse Command Line  OPTPARSE DEPRECIATED USE ARGPARSE INSTEAD
     #MKTEMP DEPRECIATED USE MKDTlizations#EMP INSTEAD
-        
-    root_dir= "/home/galaxyusr/data/galaxy_dist/tools/strelka2"
-    expected_dir="for_tests"
-    job_dir=os.getcwd()
-    analysis_dir=job_dir + "/StrelkaAnalysis"
-    config_script=root_dir + "/configureStrelkaWorkflow.pl"
-    tmp_dir = "tmp"  #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)
-   
     #manage parsing
     parser = argparse.ArgumentParser()                                             
     parser.add_argument( '-t', '--tumorBam', help='path to tumor bam file', required = False )
@@ -101,8 +90,20 @@
     parser.add_argument( '--extraStrelkaArguments', help='path to tumor bam file', required = False )
     parser.add_argument( '--isSkipDepthFilters', help='path to tumor bam file', required = False )
     parser.add_argument( '--maxInputDepth', help='path to tumor bam file', required = False )
+    parser.add_argument( '--scriptPath', help='path to tumor bam file', required = False )
     args = parser.parse_args()
 
+    root_dir= SCRIPT_PATH
+    expected_dir="for_tests"
+    job_dir=os.getcwd()
+    analysis_dir=job_dir + "/StrelkaAnalysis"
+    config_script=root_dir + "/configureStrelkaWorkflow.pl"
+    tmp_dir = "tmp"  #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)
+
+
     #verifying eveything's ok
     if not os.path.isfile(config_script):
     	sys.exit("ERROR: The strelka workflow must be built prior to running. See installation instructions in '$root_dir/README'")
--- a/tool_dependencies.xml	Fri Sep 26 13:24:13 2014 +0200
+++ b/tool_dependencies.xml	Fri Sep 26 14:30:27 2014 +0200
@@ -1,5 +1,8 @@
 <?xml version="1.0"?>
 <tool_dependency>
+  <set_environment version="1.0">
+     <environment_variable name="SCRIPT_PATH" action="set_to">$REPOSITORY_INSTALL_DIR</environment_variable>
+  </set_environment>
   <package name="samtools" version="0.1.18">
     <repository changeset_revision="171cd8bc208d" name="package_samtools_0_1_18" owner="devteam" toolshed="http://toolshed.g2.bx.psu.edu" />
   </package>