comparison strelka_wrapper.py @ 18:3c10d88b55ad

improved user interface
author mini
date Wed, 15 Oct 2014 14:43:12 +0200
parents 8260a4188b08
children 1c8dcda28be7
comparison
equal deleted inserted replaced
17:8260a4188b08 18:3c10d88b55ad
59 def __main__(): 59 def __main__():
60 #Manage options 60 #Manage options
61 print(os.environ['PATH']) 61 print(os.environ['PATH'])
62 parser = argparse.ArgumentParser() 62 parser = argparse.ArgumentParser()
63 parser.add_argument( '-t', '--tumorBam', help='path to tumor bam file', required = False ) 63 parser.add_argument( '-t', '--tumorBam', help='path to tumor bam file', required = False )
64 parser.add_argument( '-n', '--normalBam', help='path to tumor bam file', required = False ) 64 parser.add_argument( '-n', '--normalBam', help='', required = False )
65 parser.add_argument( '-r', '--refFile', help='path to tumor bam file', required = False ) 65 parser.add_argument( '-r', '--refFile', help='', required = False )
66 parser.add_argument( '-c', '--configFile', help='path to tumor bam file', required = False ) 66 parser.add_argument( '-c', '--configFile', help='', required = False )
67 parser.add_argument( '--depthFilterMultiple', help='path to tumor bam file', required = False ) 67 parser.add_argument( '--depthFilterMultiple', help='', required = False )
68 parser.add_argument( '--snvMaxFilteredBasecallFrac', help='path to tumor bam file', required = False ) 68 parser.add_argument( '--snvMaxFilteredBasecallFrac', help='', required = False )
69 parser.add_argument( '--snvMaxSpanningDeletionFrac', help='path to tumor bam file', required = False ) 69 parser.add_argument( '--snvMaxSpanningDeletionFrac', help='', required = False )
70 parser.add_argument( '--indelMaxRefRepeat', help='path to tumor bam file', required = False ) 70 parser.add_argument( '--indelMaxRefRepeat', help='', required = False )
71 parser.add_argument( '--indelMaxWindowFilteredBasecallFrac', help='path to tumor bam file', required = False ) 71 parser.add_argument( '--indelMaxWindowFilteredBasecallFrac', help='', required = False )
72 parser.add_argument( '--indelMaxIntHpolLength', help='path to tumor bam file', required = False ) 72 parser.add_argument( '--indelMaxIntHpolLength', help='', required = False )
73 parser.add_argument( '--ssnvPrior', help='path to tumor bam file', required = False ) 73 parser.add_argument( '--ssnvPrior', help='', required = False )
74 parser.add_argument( '--sindelPrior', help='path to tumor bam file', required = False ) 74 parser.add_argument( '--sindelPrior', help='', required = False )
75 parser.add_argument( '--ssnvNoise', help='path to tumor bam file', required = False ) 75 parser.add_argument( '--ssnvNoise', help='', required = False )
76 parser.add_argument( '--sindelNoise', help='path to tumor bam file', required = False ) 76 parser.add_argument( '--sindelNoise', help='', required = False )
77 parser.add_argument( '--ssnvNoiseStrandBiasFrac', help='path to tumor bam file', required = False ) 77 parser.add_argument( '--ssnvNoiseStrandBiasFrac', help='', required = False )
78 parser.add_argument( '--minTier1Mapq', help='path to tumor bam file', required = False ) 78 parser.add_argument( '--minTier1Mapq', help='', required = False )
79 parser.add_argument( '--minTier2Mapq', help='path to tumor bam file', required = False ) 79 parser.add_argument( '--minTier2Mapq', help='', required = False )
80 parser.add_argument( '--ssnvQuality_LowerBound', help='path to tumor bam file', required = False ) 80 parser.add_argument( '--ssnvQuality_LowerBound', help='', required = False )
81 parser.add_argument( '--sindelQuality_LowerBound', help='path to tumor bam file', required = False ) 81 parser.add_argument( '--sindelQuality_LowerBound', help='', required = False )
82 parser.add_argument( '--isWriteRealignedBam', help='path to tumor bam file', required = False ) 82 parser.add_argument( '--isWriteRealignedBam', help='', required = False )
83 parser.add_argument( '--binSize', help='path to tumor bam file', required = False ) 83 parser.add_argument( '--binSize', help='path to tumor bam file', required = False )
84 parser.add_argument( '--extraStrelkaArguments', help='path to tumor bam file', required = False ) 84 parser.add_argument( '--extraStrelkaArguments', help='', required = False )
85 parser.add_argument( '--isSkipDepthFilters', help='path to tumor bam file', required = False ) 85 parser.add_argument( '--isSkipDepthFilters', help='', required = False )
86 parser.add_argument( '--maxInputDepth', help='path to tumor bam file', required = False ) 86 parser.add_argument( '--maxInputDepth', help='', required = False )
87 parser.add_argument( '--scriptPath', help='path to tumor bam file', required = False ) 87 parser.add_argument( '--scriptPath', help='', required = False )
88 args = parser.parse_args() 88 args = parser.parse_args()
89 89
90 root_dir= args.scriptPath 90 root_dir= args.scriptPath
91 expected_dir="for_tests" 91 expected_dir="for_tests"
92 job_dir=os.getcwd() 92 job_dir=os.getcwd()
113 index_fasta_files( fasta_files, tmp_dir ) 113 index_fasta_files( fasta_files, tmp_dir )
114 114
115 #creating config file if needed 115 #creating config file if needed
116 if args.configFile == "Custom": 116 if args.configFile == "Custom":
117 _create_config(vars(args), config_ini) 117 _create_config(vars(args), config_ini)
118 elif args.configFile == "Default": 118 elif args.configFile in ["strelka_config_bwa_default.ini", "strelka_config_isaac_default.ini", "strelka_config_eland_default.ini"]:
119 cmdbash="cp %s %s" % (root_dir + "/strelka_config.sample", config_ini) 119 cmdbash="cp %s %s" % (root_dir + "/lib/" + args.configFile, config_ini)
120 my_Popen(cmdbash, "copy_default_file_err", tmp_dir, "Error during the copy of default config file, maybe it was removed") 120 my_Popen(cmdbash, "copy_default_file_err", tmp_dir, "Error during the copy of default config file, maybe it was removed")
121 else: 121 else:
122 if not os.path.exists(args.configFile): 122 if not os.path.exists(args.configFile):
123 print( "The path to your configuration File seems to be wrong, use another one or custom option", file=sys.stderr) 123 print( "The path to your configuration File seems to be wrong, use another one or custom option", file=sys.stderr)
124 cmdbash="cp %s %s" % (args.configFile, config_ini) 124 cmdbash="cp %s %s" % (args.configFile, config_ini)