def main() : primarySectionName="StrelkaSomatic" options,iniSections=StrelkaSomaticWorkflowOptions().getRunOptions(primarySectionName, version=workflowVersion) # we don't need to instantiate the workflow object during configuration, # but this is done here to trigger additional parameter validation: # StrelkaSomaticWorkflow(options) # generate runscript: # ensureDir(options.runDir) workflowScriptPath = os.path.join(options.runDir, options.workflowScriptName) makeRunScript(workflowScriptPath,os.path.join(workflowDir,"strelkaSomaticWorkflow.py"),"StrelkaSomaticWorkflow",primarySectionName,iniSections) notefp=sys.stdout notefp.write(""" Successfully created workflow run script. To execute the workflow, run the following script and set appropriate options: %s """ % (workflowScriptPath))
def main(): primarySectionName = "counts" options, iniSections = SequenceErrorCountsWorkflowOptions().getRunOptions( primarySectionName, version=workflowVersion) # we don't need to instantiate the workflow object during configuration, # but this is done here to trigger additional parameter validation: # SequenceErrorCountsWorkflow(options) # generate runscript: # ensureDir(options.runDir) scriptFile = os.path.join(options.runDir, "runWorkflow.py") makeRunScript(scriptFile, os.path.join(workflowDir, "sequenceErrorCountsWorkflow.py"), "SequenceErrorCountsWorkflow", primarySectionName, iniSections) notefp = sys.stdout notefp.write(""" Successfully created workflow run script. To execute the workflow, run the following script and set appropriate options: %s """ % (scriptFile))
def main() : if (sys.version_info[0] != 2): notefp=sys.stdout notefp.write("""Failed to create workflow run script.\nPyflow only supports python2. Detected python %s on the system.\n""" % sys.version_info[0]) return primarySectionName="snoise" options,iniSections=snoiseWorkflowOptions().getRunOptions(primarySectionName, version=workflowVersion) # we don't need to instantiate the workflow object during configuration, # but this is done here to trigger additional parameter validation: # snoiseWorkflow(options) # generate runscript: # ensureDir(options.runDir) workflowScriptPath = os.path.join(options.runDir, options.workflowScriptName) makeRunScript(workflowScriptPath,os.path.join(workflowDir,"snoiseWorkflow.py"),"snoiseWorkflow",primarySectionName,iniSections) notefp=sys.stdout notefp.write(""" Successfully created workflow run script. To execute the workflow, run the following script and set appropriate options: %s """ % (workflowScriptPath))
def __init__(self,params,iniSections) : # clear out some potentially destabilizing env variables: clearList = [ "PYTHONPATH", "PYTHONHOME"] for key in clearList : if key in os.environ : del os.environ[key] self.params=params self.iniSections=iniSections # make sure run directory is setup: self.params.runDir=os.path.abspath(self.params.runDir) ensureDir(self.params.runDir) # everything that's not intended to be a final result should dump directories/files in workDir self.params.workDir=os.path.join(self.params.runDir,"workspace") ensureDir(self.params.workDir) # all finalized pretty results get transfered to resultsDir self.params.resultsDir=os.path.join(self.params.runDir,"results") ensureDir(self.params.resultsDir) self.params.statsDir=os.path.join(self.params.resultsDir,"stats") ensureDir(self.params.statsDir) self.params.variantsDir=os.path.join(self.params.resultsDir,"variants") ensureDir(self.params.variantsDir) # self.params.reportsDir=os.path.join(self.params.resultsDir,"reports") # ensureDir(self.params.reportsDir) indexRefFasta=self.params.referenceFasta+".fai" if self.params.referenceFasta is None: raise Exception("No reference fasta defined.") else: checkFile(self.params.referenceFasta,"reference fasta") checkFile(indexRefFasta,"reference fasta index") self.params.normalBamList = [] for bam in (self.params.normalBam,) : if bam is None : continue self.params.normalBamList.append(bam) self.params.tumorBamList = [] for bam in (self.params.tumorBam,) : if bam is None : continue self.params.tumorBamList.append(bam) # read fasta index (self.params.chromOrder,self.params.chromSizes) = getFastaChromOrderSize(indexRefFasta) # sanity check some parameter typing: self.params.binSize = int(self.params.binSize) self.params.nonlocalWorkBins = int(self.params.nonlocalWorkBins) self.paths = PathInfo(self.params)
def __init__(self, params) : global PathInfo super(SequenceAlleleCountsWorkflow, self).__init__(params, PathInfo) # if debugging output is going to be produced, add a results/debug dir if self.params.isReportObservedIndels: self.params.debugDir=os.path.join(self.params.resultsDir,"debug") ensureDir(self.params.debugDir) # format bam lists: if self.params.bamList is None : self.params.bamList = []
def __init__(self,params,iniSections) : # clear out some potentially destabilizing env variables: clearList = [ "PYTHONPATH", "PYTHONHOME"] for key in clearList : if key in os.environ : del os.environ[key] self.params=params self.iniSections=iniSections # format bam lists: if self.params.normalBamList is None : self.params.normalBamList = [] if self.params.tumorBamList is None : self.params.tumorBamList = [] # make sure run directory is setup: self.params.runDir=os.path.abspath(self.params.runDir) ensureDir(self.params.runDir) # everything that's not intended to be a final result should dump directories/files in workDir self.params.workDir=os.path.join(self.params.runDir,"workspace") ensureDir(self.params.workDir) # all finalized pretty results get transfered to resultsDir self.params.resultsDir=os.path.join(self.params.runDir,"results") ensureDir(self.params.resultsDir) self.params.statsDir=os.path.join(self.params.resultsDir,"stats") ensureDir(self.params.statsDir) self.params.variantsDir=os.path.join(self.params.resultsDir,"variants") ensureDir(self.params.variantsDir) # self.params.reportsDir=os.path.join(self.params.resultsDir,"reports") # ensureDir(self.params.reportsDir) indexRefFasta=self.params.referenceFasta+".fai" if self.params.referenceFasta is None: raise Exception("No reference fasta defined.") else: checkFile(self.params.referenceFasta,"reference fasta") checkFile(indexRefFasta,"reference fasta index") # read fasta index (self.params.chromOrder,self.params.chromSizes) = getFastaChromOrderSize(indexRefFasta) # sanity check some parameter typing: MEGABASE = 1000000 self.params.scanSize = int(self.params.scanSizeMb) * MEGABASE self.params.nonlocalWorkBins = int(self.params.nonlocalWorkBins) self.paths = PathInfo(self.params) self.params.isHighDepthFilter = (not (self.params.isExome or self.params.isRNA)) self.params.isIgnoreAnomProperPair = (self.params.isRNA)
def __init__(self,params) : global PathInfo super(StrelkaGermlineWorkflow,self).__init__(params,PathInfo) # format bam lists: if self.params.bamList is None : self.params.bamList = [] # format other: safeSetBool(self.params,"isWriteRealignedBam") if self.params.isWriteRealignedBam : self.params.realignedDir=os.path.join(self.params.resultsDir,"realigned") ensureDir(self.params.realignedDir) if self.params.isExome : self.params.isEVS = False
def __init__(self, params, iniSections): cleanPyEnv() self.params = params self.iniSections = iniSections # format bam lists: if self.params.normalBamList is None: self.params.normalBamList = [] if self.params.tumorBamList is None: self.params.tumorBamList = [] # make sure run directory is setup: self.params.runDir = os.path.abspath(self.params.runDir) ensureDir(self.params.runDir) # everything that's not intended to be a final result should dump directories/files in workDir self.params.workDir = os.path.join(self.params.runDir, "workspace") ensureDir(self.params.workDir) # all finalized pretty results get transfered to resultsDir self.params.resultsDir = os.path.join(self.params.runDir, "results") ensureDir(self.params.resultsDir) self.params.statsDir = os.path.join(self.params.resultsDir, "stats") ensureDir(self.params.statsDir) self.params.variantsDir = os.path.join(self.params.resultsDir, "variants") ensureDir(self.params.variantsDir) # self.params.reportsDir=os.path.join(self.params.resultsDir,"reports") # ensureDir(self.params.reportsDir) indexRefFasta = self.params.referenceFasta + ".fai" if self.params.referenceFasta is None: raise Exception("No reference fasta defined.") else: checkFile(self.params.referenceFasta, "reference fasta") checkFile(indexRefFasta, "reference fasta index") # read fasta index (self.params.chromOrder, self.params.chromSizes) = getFastaChromOrderSize(indexRefFasta) self.paths = PathInfo(self.params) self.params.isHighDepthFilter = (not (self.params.isExome or self.params.isRNA)) self.params.isIgnoreAnomProperPair = (self.params.isRNA)
def __init__(self, params, iniSections): global PathInfo super(StrelkaPedigreeWorkflow, self).__init__(params, iniSections, PathInfo) # format bam lists: if self.params.probandBamList is None: self.params.probandBamList = [] if self.params.parentBamList is None: self.params.parentBamList = [] if self.params.siblingBamList is None: self.params.siblingBamList = [] # bools coming from the ini file need to be cleaned up: safeSetBool(self.params, "isWriteRealignedBam") if self.params.isOutputCallableRegions: self.params.regionsDir = os.path.join(self.params.resultsDir, "regions") ensureDir(self.params.regionsDir)
def __init__(self,params) : global PathInfo super(StrelkaSomaticWorkflow,self).__init__(params, PathInfo) # format bam lists: if self.params.normalBamList is None : self.params.normalBamList = [] if self.params.tumorBamList is None : self.params.tumorBamList = [] # bools coming from the ini file need to be cleaned up: safeSetBool(self.params,"isWriteRealignedBam") if self.params.isOutputCallableRegions : self.params.regionsDir=os.path.join(self.params.resultsDir,"regions") ensureDir(self.params.regionsDir) if self.params.isWriteRealignedBam : self.params.realignedDir=os.path.join(self.params.resultsDir,"realigned") ensureDir(self.params.realignedDir)
def __init__(self,params,iniSections) : cleanPyEnv() self.params=params self.iniSections=iniSections # format bam lists: if self.params.normalBamList is None : self.params.normalBamList = [] if self.params.tumorBamList is None : self.params.tumorBamList = [] # make sure run directory is setup: self.params.runDir=os.path.abspath(self.params.runDir) ensureDir(self.params.runDir) # everything that's not intended to be a final result should dump directories/files in workDir self.params.workDir=os.path.join(self.params.runDir,"workspace") ensureDir(self.params.workDir) # all finalized pretty results get transfered to resultsDir self.params.resultsDir=os.path.join(self.params.runDir,"results") ensureDir(self.params.resultsDir) self.params.statsDir=os.path.join(self.params.resultsDir,"stats") ensureDir(self.params.statsDir) self.params.variantsDir=os.path.join(self.params.resultsDir,"variants") ensureDir(self.params.variantsDir) # self.params.reportsDir=os.path.join(self.params.resultsDir,"reports") # ensureDir(self.params.reportsDir) indexRefFasta=self.params.referenceFasta+".fai" if self.params.referenceFasta is None: raise Exception("No reference fasta defined.") else: checkFile(self.params.referenceFasta,"reference fasta") checkFile(indexRefFasta,"reference fasta index") # read fasta index (self.params.chromOrder,self.params.chromSizes) = getFastaChromOrderSize(indexRefFasta) self.paths = PathInfo(self.params) self.params.isHighDepthFilter = (not (self.params.isExome or self.params.isRNA)) self.params.isIgnoreAnomProperPair = (self.params.isRNA)
def __init__(self, params, PathInfoType): cleanPyEnv() self.params = params # make sure run directory is setup: self.params.runDir = os.path.abspath(self.params.runDir) ensureDir(self.params.runDir) # everything that's not intended to be a final result should dump directories/files in workDir self.params.workDir = os.path.join(self.params.runDir, "workspace") ensureDir(self.params.workDir) # all finalized pretty results get transferred to resultsDir self.params.resultsDir = os.path.join(self.params.runDir, "results") ensureDir(self.params.resultsDir) self.params.variantsDir = os.path.join(self.params.resultsDir, "variants") ensureDir(self.params.variantsDir) # timings and other stats go into statsDir self.params.statsDir = os.path.join(self.params.resultsDir, "stats") ensureDir(self.params.statsDir) self.paths = PathInfoType(self.params) referenceFastaIndex = self.params.referenceFasta + ".fai" if self.params.referenceFasta is None: raise Exception("No reference fasta defined.") else: checkFile(self.params.referenceFasta, "reference fasta") checkFile(referenceFastaIndex, "reference fasta index") # read fasta index (self.params.chromOrder, self.params.chromSizes) = getFastaChromOrderSize(referenceFastaIndex) # determine subset of chroms where we can skip calling entirely self.params.chromIsSkipped = getChromIsSkipped(self) self.params.isHighDepthFilter = (not (self.params.isExome or self.params.isRNA))
def __init__(self, params, iniSections): global PathInfo super(StrelkaGermlineWorkflow, self).__init__(params, iniSections, PathInfo) # format bam lists: if self.params.bamList is None: self.params.bamList = [] # format other: safeSetBool(self.params, "isWriteRealignedBam") if self.params.isWriteRealignedBam: self.params.realignedDir = os.path.join(self.params.resultsDir, "realigned") ensureDir(self.params.realignedDir) if self.params.isExome: self.params.isEVS = False if self.params.isRNA: self.params.germlineSnvScoringModelFile = joinFile( self.params.configDir, 'RNAVariantScoringModels.json') self.params.germlineIndelScoringModelFile = None
def main() : primarySectionName="manta" options,iniSections=MantaWorkflowOptions().getRunOptions(primarySectionName, version=workflowVersion) # we don't need to instantiate the workflow object during configuration, # but this is done here to trigger additional parameter validation: # MantaWorkflow(options,iniSections) # generate runscript: # ensureDir(options.runDir) scriptFile=os.path.join(options.runDir,"runWorkflow.py") makeRunScript(scriptFile,os.path.join(workflowDir,"mantaWorkflow.py"),"MantaWorkflow",primarySectionName,iniSections) notefp=sys.stdout notefp.write(""" Successfully created workflow run script. To execute the workflow, run the following script and set appropriate options: %s """ % (scriptFile))
def __init__(self,params) : cleanPyEnv() self.params=params # normalize boolean option input: safeSetBool(self.params,"enableRemoteReadRetrievalForInsertionsInGermlineCallingModes") safeSetBool(self.params,"enableRemoteReadRetrievalForInsertionsInCancerCallingModes") safeSetBool(self.params,"useOverlapPairEvidence") # Use RNA option for minCandidate size if self.params.isRNA: self.params.minCandidateVariantSize = self.params.rnaMinCandidateVariantSize # format bam lists: if self.params.normalBamList is None : self.params.normalBamList = [] if self.params.tumorBamList is None : self.params.tumorBamList = [] # make sure run directory is setup: self.params.runDir=os.path.abspath(self.params.runDir) ensureDir(self.params.runDir) # everything that's not intended to be a final result should dump directories/files in workDir self.params.workDir=os.path.join(self.params.runDir,"workspace") ensureDir(self.params.workDir) # all finalized pretty results get transfered to resultsDir self.params.resultsDir=os.path.join(self.params.runDir,"results") ensureDir(self.params.resultsDir) self.params.statsDir=os.path.join(self.params.resultsDir,"stats") ensureDir(self.params.statsDir) self.params.variantsDir=os.path.join(self.params.resultsDir,"variants") ensureDir(self.params.variantsDir) self.params.evidenceDir=os.path.join(self.params.resultsDir,"evidence") ensureDir(self.params.evidenceDir) # self.params.reportsDir=os.path.join(self.params.resultsDir,"reports") # ensureDir(self.params.reportsDir) indexRefFasta=self.params.referenceFasta+".fai" if self.params.referenceFasta is None: raise Exception("No reference fasta defined.") else: checkFile(self.params.referenceFasta,"reference fasta") checkFile(indexRefFasta,"reference fasta index") # read fasta index (self.params.chromOrder,self.params.chromSizes) = getFastaChromOrderSize(indexRefFasta) # determine subset of chroms where we can skip calling entirely (self.params.callRegionList, self.params.chromIsSkipped) = getCallRegions(self.params) self.paths = PathInfo(self.params) self.params.isHighDepthFilter = (not (self.params.isExome or self.params.isRNA)) self.params.isIgnoreAnomProperPair = (self.params.isRNA) # always use overlapping pairs for RNA calling if (self.params.isRNA) : self.params.useOverlapPairEvidence = True
def __init__(self, params): cleanPyEnv() self.params = params # normalize boolean option input: safeSetBool( self.params, "enableRemoteReadRetrievalForInsertionsInGermlineCallingModes") safeSetBool( self.params, "enableRemoteReadRetrievalForInsertionsInCancerCallingModes") safeSetBool(self.params, "useOverlapPairEvidence") # Use RNA option for minCandidate size if self.params.isRNA: self.params.minCandidateVariantSize = self.params.rnaMinCandidateVariantSize # format bam lists: if self.params.normalBamList is None: self.params.normalBamList = [] if self.params.tumorBamList is None: self.params.tumorBamList = [] # make sure run directory is setup: self.params.runDir = os.path.abspath(self.params.runDir) ensureDir(self.params.runDir) # everything that's not intended to be a final result should dump directories/files in workDir self.params.workDir = os.path.join(self.params.runDir, "workspace") ensureDir(self.params.workDir) # all finalized pretty results get transfered to resultsDir self.params.resultsDir = os.path.join(self.params.runDir, "results") ensureDir(self.params.resultsDir) self.params.statsDir = os.path.join(self.params.resultsDir, "stats") ensureDir(self.params.statsDir) self.params.variantsDir = os.path.join(self.params.resultsDir, "variants") ensureDir(self.params.variantsDir) self.params.evidenceDir = os.path.join(self.params.resultsDir, "evidence") ensureDir(self.params.evidenceDir) # self.params.reportsDir=os.path.join(self.params.resultsDir,"reports") # ensureDir(self.params.reportsDir) indexRefFasta = self.params.referenceFasta + ".fai" if self.params.referenceFasta is None: raise Exception("No reference fasta defined.") else: checkFile(self.params.referenceFasta, "reference fasta") checkFile(indexRefFasta, "reference fasta index") # read fasta index (self.params.chromOrder, self.params.chromSizes) = getFastaChromOrderSize(indexRefFasta) # determine subset of chroms where we can skip calling entirely (self.params.callRegionList, self.params.chromIsSkipped) = getCallRegions(self.params) self.paths = PathInfo(self.params) self.params.isHighDepthFilter = (not (self.params.isExome or self.params.isRNA)) self.params.isIgnoreAnomProperPair = (self.params.isRNA) # always use overlapping pairs for RNA calling if (self.params.isRNA): self.params.useOverlapPairEvidence = True