本文整理汇总了Python中Helper.Helper.newline方法的典型用法代码示例。如果您正苦于以下问题:Python Helper.newline方法的具体用法?Python Helper.newline怎么用?Python Helper.newline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Helper.Helper
的用法示例。
在下文中一共展示了Helper.newline方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: checkDependencies
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import newline [as 别名]
def checkDependencies(args):
'''
Checks the existence of the necessary packages and tools
:param sourceDir: folder which contains all the software
'''
Helper.newline(1)
Helper.info("CHECK DEPENDENCIES")
#check if all tools are there
if not os.path.isfile(args.sourceDir+"bwa"):
Helper.error("BWA not found in %s" % args.sourceDir)
if not os.path.isfile(args.sourceDir+"picard-tools/SortSam.jar"):
Helper.error("SortSam.jar not found in %s" % args.sourceDir+"picard-tools")
if not os.path.isfile(args.sourceDir+"picard-tools/MarkDuplicates.jar"):
Helper.error("MarkDuplicates.jar not found in %s" % args.sourceDir+"picard-tools")
if not os.path.isfile(args.sourceDir+"GATK/GenomeAnalysisTK.jar"):
Helper.error("GenomeAnalysisTK.jar not found in %s" % args.sourceDir+"GATK/")
if not os.path.isfile(args.sourceDir+"samtools"):
Helper.error("samtools not found in %s" % args.sourceDir)
if not os.system("java -version")==0:
Helper.error("Java could not be found, Please install java")
#check if all files are there
if not os.path.isfile(args.RefGenome):
Helper.error("Could not find Reference Genome in %s: " % args.RefGenome)
# Files for BWA
if not os.path.isfile(args.RefGenome+".amb"):
Helper.error("Could not find %s.amb" % args.RefGenome)
Helper.error("run: 'bwa index %s' to create it" % args.RefGenome)
if not os.path.isfile(args.RefGenome+".ann"):
Helper.error("Could not find %s.ann" % args.RefGenome)
Helper.error("run: 'bwa index %s' to create it" % args.RefGenome)
if not os.path.isfile(args.RefGenome+".bwt"):
Helper.error("Could not find %s.bwt" % args.RefGenome)
Helper.error("run: 'bwa index %s' to create it" % args.RefGenome)
if not os.path.isfile(args.RefGenome+".pac"):
Helper.error("Could not find %s.pac" % args.RefGenome)
Helper.error("run: 'bwa index %s' to create it" % args.RefGenome)
if not os.path.isfile(args.RefGenome+".sa"):
Helper.error("Could not find %s.sa" % args.RefGenome)
Helper.error("run: 'bwa index %s' to create it" % args.RefGenome)
#Files for GATK
if not os.path.isfile(args.RefGenome.replace(".fastq",".dict")):
Helper.error("Could not find %s" % args.RefGenome.replace(".fastq",".dict"))
Helper.error("run: 'java -jar %s/picard-tools/CreateSequenceDictionary.jar R=%s O= %s.dict' to create it" % (args.sourceDir,args.RefGenome,args.RefGenome.replace(".fastq",".dict")))
if not os.path.isfile(args.RefGenome+".fai"):
Helper.error("Could not find %s.fai" % args.RefGenome)
Helper.error("run: 'samtools faidx %s' to create it" % args.RefGenome)
#SNP databases
if not os.path.isfile(args.dbsnp):
Helper.error("Could not find %s: " % args.dbsnp)
示例2: checkDependencies
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import newline [as 别名]
def checkDependencies(self):
"""checks if all files are there
if all programs are installed properly and if the output directory is writable"""
try:
self.logFile=open(self.params.output + ".log","w+")
except IOError:
Helper.error("Cannot open Log File", textField=self.textField)
if type(self.fastqFiles) == list:
self.fastqFiles=self.fastqFiles
elif type(self.fastqFile) == str:
self.fastqFiles=[self.fastqFiles]
else:
Helper.error("FastQ File has wrong variable type",self.logFile,self.textField)
for file in self.fastqFiles:
if not os.path.isfile(file):
Helper.error("Could not find: %s" %file,self.logFile,self.textField)
'''
Checks the existence of the necessary packages and tools
:param sourceDir: folder which contains all the software
'''
Helper.newline(1)
Helper.info("CHECK DEPENDENCIES",self.logFile,self.textField)
#check if all tools are there
if not os.path.isfile(self.params.sourceDir+"bwa"):
Helper.error("BWA not found in %s" % self.params.sourceDir,self.logFile,self.textField)
if not os.path.isfile(self.params.sourceDir+"picard-tools/SortSam.jar"):
Helper.error("SortSam.jar not found in %s" % self.params.sourceDir+"picard-tools",self.logFile,self.textField)
if not os.path.isfile(self.params.sourceDir+"picard-tools/MarkDuplicates.jar"):
Helper.error("MarkDuplicates.jar not found in %s" % self.params.sourceDir+"picard-tools",self.logFile,self.textField)
if not os.path.isfile(self.params.sourceDir+"GATK/GenomeAnalysisTK.jar"):
Helper.error("GenomeAnalysisTK.jar not found in %s" % self.params.sourceDir+"GATK/",self.logFile,self.textField)
if not os.path.isfile(self.params.sourceDir+"blat"):
Helper.error("blat not found in %s" % self.params.sourceDir,self.logFile,self.textField)
if not os.path.isfile(self.params.sourceDir+"samtools"):
Helper.error("samtools not found in %s" % self.params.sourceDir,self.logFile,self.textField)
if not os.system("java -version")==0:
Helper.error("Java could not be found, Please install java",self.logFile,self.textField)
#check if all files are there
if not os.path.isfile(self.params.refGenome):
Helper.error("Could not find Reference Genome in %s: " % self.params.refGenome,self.logFile,self.textField)
# Files for BWA
if not os.path.isfile(self.params.refGenome+".amb"):
Helper.warning("Could not find %s.amb" % self.params.refGenome,self.logFile,self.textField)
Helper.error("run: 'bwa index %s' to create it" % self.params.refGenome,self.logFile,self.textField)
if not os.path.isfile(self.params.refGenome+".ann"):
Helper.warning("Could not find %s.ann" % self.params.refGenome,self.logFile,self.textField)
Helper.error("run: 'bwa index %s' to create it" % self.params.refGenome,self.logFile,self.textField)
if not os.path.isfile(self.params.refGenome+".bwt"):
Helper.warning("Could not find %s.bwt" % self.params.refGenome,self.logFile,self.textField)
Helper.error("run: 'bwa index %s' to create it" % self.params.refGenome,self.logFile,self.textField)
if not os.path.isfile(self.params.refGenome+".pac"):
Helper.warning("Could not find %s.pac" % self.params.refGenome,self.logFile,self.textField)
Helper.error("run: 'bwa index %s' to create it" % self.params.refGenome,self.logFile,self.textField)
if not os.path.isfile(self.params.refGenome+".sa"):
Helper.warning("Could not find %s.sa" % self.params.refGenome,self.logFile,self.textField)
Helper.error("run: 'bwa index %s' to create it" % self.params.refGenome,self.logFile,self.textField)
#Files for GATK
if self.params.refGenome.endswith("fasta"):
if not os.path.isfile(self.params.refGenome.replace(".fasta",".dict")):
Helper.warning("Could not find %s" % self.params.refGenome.replace(".fasta",".dict"),self.logFile,self.textField)
Helper.error("run: 'java -jar %spicard-tools/CreateSequenceDictionary.jar R=%s O= %s' to create it" % (self.params.sourceDir,self.params.refGenome,self.params.refGenome.replace(".fastq",".dict")),self.logFile,self.textField)
elif self.params.refGenome.endswith("fa"):
if not os.path.isfile(self.params.refGenome.replace(".fa",".dict")):
Helper.warning("Could not find %s" % self.params.refGenome.replace(".fa",".dict"),self.logFile,self.textField)
Helper.error("run: 'java -jar %spicard-tools/CreateSequenceDictionary.jar R=%s O= %s' to create it" % (self.params.sourceDir,self.params.refGenome,self.params.refGenome.replace(".fa",".dict")),self.logFile,self.textField)
else:
Helper.error("RefGenome has wrong suffix. Either '.fa' or '.fasta'")
if not os.path.isfile(self.params.refGenome+".fai"):
Helper.warning("Could not find %s.sai" % self.params.refGenome,self.logFile,self.textField)
Helper.error("run: 'samtools faidx %s' to create it" % self.params.refGenome,self.logFile,self.textField)
#SNP databases
if not os.path.isfile(self.params.dbsnp):
Helper.error("Could not find dbSNP database %s: " % self.params.dbsnp,self.logFile,self.textField)
if not os.path.isfile(self.params.hapmap) and self.params.hapmap != "None":
Helper.error("Could not find Hapmap database %s: " % self.params.hapmap,self.logFile,self.textField)
if not os.path.isfile(self.params.omni) and self.params.omni != "None":
Helper.error("Could not find Omni database %s: " % self.params.omni,self.logFile,self.textField)
if not os.path.isfile(self.params.esp) and self.params.esp != "None":
Helper.error("Could not find 1000G database %s: " % self.params.esp,self.logFile,self.textField)
#region Files
if not os.path.isfile(self.params.aluRegions):
Helper.error("Could not find %s: " % self.params.aluRegions,self.logFile,self.textField)
if not os.path.isfile(self.params.gtfFile):
Helper.error("Could not find %s: " % self.params.gtfFile,self.logFile,self.textField)
#.........这里部分代码省略.........