diff strelka_wrapper.py @ 22:1c8dcda28be7

version 27/11/2014, corrected extra arguments bug
author mini
date Thu, 27 Nov 2014 10:31:58 +0100
parents 3c10d88b55ad
children
line wrap: on
line diff
--- a/strelka_wrapper.py	Wed Oct 15 15:47:03 2014 +0200
+++ b/strelka_wrapper.py	Thu Nov 27 10:31:58 2014 +0100
@@ -20,9 +20,23 @@
 def _create_config(args, config_path):
     conf_file = open(config_path, "w")
     conf_file.write("[user]\n")
-    for option in args:
-        if not option in ["tumorBam", "normalBam", "refFile", "configFile", "scriptPath"] and args[option]!=None:
-    	    conf_file.write("%s=%s\n" % (option, args[option]))
+    args2 = vars(args)
+    for option in args2:
+        if not option in ["tumorBam", "normalBam", "refFile", "configFile", "scriptPath", "a", "b", "c", "d", "e", "extraStrelkaArguments"] and args2[option]!=None:
+	    conf_file.write("%s=%s\n" % (option, args2[option]))
+    if args.extraStrelkaArguments == "yes":
+    	conf_file.write("extraStrelkaArguments=")
+   	if args.a:
+            conf_file.write("--ignore-conflicting-read-names ")
+    	if args.b != None:
+            conf_file.write("-used-allele-count-min-qscore %s " % (args.b))
+    	if args.c != None:
+            conf_file.write("--candidate-indel-input-vcf %s " % (args.c))
+    	if args.d != None:
+            conf_file.write("--force-output-vcf %s " % (args.d))
+    	if args.e != None:
+            conf_file.write("-min-small-candidate-indel-read-frac %s " % (args.e))
+    	conf_file.write("\n")
     conf_file.close()
 
 def my_Popen(cmd, prefix_for_stderr_name, tmp_dir, msg_error):
@@ -60,10 +74,10 @@
     #Manage options
     print(os.environ['PATH'])
     parser = argparse.ArgumentParser()                                             
-    parser.add_argument( '-t', '--tumorBam', help='path to tumor bam file', required = False )
-    parser.add_argument( '-n', '--normalBam', help='', required = False )   
-    parser.add_argument( '-r', '--refFile', help='', required = False )
-    parser.add_argument( '-c', '--configFile', help='', required = False )
+    parser.add_argument( '--tumorBam', help='path to tumor bam file', required = False )
+    parser.add_argument( '--normalBam', help='', required = False )   
+    parser.add_argument( '--refFile', help='', required = False )
+    parser.add_argument( '--configFile', help='', required = False )
     parser.add_argument( '--depthFilterMultiple', help='', required = False )
     parser.add_argument( '--snvMaxFilteredBasecallFrac', help='', required = False )
     parser.add_argument( '--snvMaxSpanningDeletionFrac', help='', required = False )
@@ -85,6 +99,11 @@
     parser.add_argument( '--isSkipDepthFilters', help='', required = False )
     parser.add_argument( '--maxInputDepth', help='', required = False )
     parser.add_argument( '--scriptPath', help='', required = False )
+    parser.add_argument( '-a', action="store_true", help='', required = False )
+    parser.add_argument( '-b', help='', required = False )
+    parser.add_argument( '-c', help='', required = False )
+    parser.add_argument( '-d', help='', required = False )
+    parser.add_argument( '-e', help='', required = False )
     args = parser.parse_args()
 
     root_dir= args.scriptPath
@@ -114,7 +133,7 @@
     
     #creating config file if needed
     if args.configFile == "Custom":
-    	_create_config(vars(args), config_ini)
+    	_create_config(args, config_ini)
     elif args.configFile in ["strelka_config_bwa_default.ini", "strelka_config_isaac_default.ini", "strelka_config_eland_default.ini"]:
         cmdbash="cp %s %s" % (root_dir + "/lib/" + 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")