本文整理汇总了Python中Helper.Helper.info方法的典型用法代码示例。如果您正苦于以下问题:Python Helper.info方法的具体用法?Python Helper.info怎么用?Python Helper.info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Helper.Helper
的用法示例。
在下文中一共展示了Helper.info方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: startAnalysis
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import info [as 别名]
def startAnalysis(self):
"""
START MAPPING
"""
if self.fastqFiles[0].endswith("bam"):
if self.fastqFiles[0].endswith("noDup.realigned.recalibrated.bam"):
Helper.info("Bam File given. Skip mapping", self.logFile, self.textField)
self.mapFastQ=None
mapResultFile=self.fastqFiles[0]
else:
Helper.error("Bam File was not mapped with RnaEditor, this is not supported. Please provide the fastq Files to RnaEditor", self.logFile, self.textField, "red")
else:
self.mapFastQ=MapFastq(self)
mapResultFile=self.mapFastQ.startAnalysis()
"""
START CALLING EDITING SITES
"""
self.callEditSites=CallEditingSites(mapResultFile,self)
result = self.callEditSites.startAnalysis()
#finished
self.isTerminated=True
Helper.status("rnaEditor Finished with %s" % self.params.output, self.logFile, self.textField,"green",True)
Helper.status("Open %s to see the results" % self.params.output+".html", self.logFile, self.textField,"green",True)
self.cleanUp()
示例2: deleteOverlapsFromVcf
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import info [as 别名]
def deleteOverlapsFromVcf(self,variants):
'''
delete the variants from 'variantsA' which also are in 'variantsB'
'''
variantSetA = set(self.variantDict.keys())
#detrmine type of variantB
if type(variants) == str:
variantsB = open(variants)
elif type(variants) != file:
raise TypeError("variantB has wrong type, need str or file, %s found" % type(variantsB))
#TODO: variants could also be another object of VariantsSet
#get Start time
startTime = Helper.getTime()
Helper.info(" [%s] Delete overlapps from %s" % (startTime.strftime("%c"),variantsB.name),self.logFile,self.textField)
for line in variantsB:
if line.startswith("#"):
continue
for varTuple in self.getVariantTuble(line):
if varTuple in variantSetA:
#A.discard(varTuple)
variantSetA.remove(varTuple)
del self.variantDict[varTuple]
#calculate duration
Helper.printTimeDiff(startTime,self.logFile,self.textField)
示例3: deleteNonEditingBases
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import info [as 别名]
def deleteNonEditingBases(self):
startTime=Helper.getTime()
Helper.info("Delete non Editing Bases (keep only T->C and A->G)",self.logFile,self.textField)
for varTuple in self.variantDict.keys():
chr,pos,ref,alt = varTuple
if (ref =="A" and alt == "G") or (ref=="T" and alt=="C"):
pass
else:
del self.variantDict[varTuple]
示例4: checkDependencies
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import info [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)
示例5: annotateVariantDict
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import info [as 别名]
def annotateVariantDict(self,genome):
'''
adds the corresponding Gene and the exact segment wehre the SNP appears
:param genome: Genome
'''
startTime = Helper.getTime()
Helper.info(" [%s] Annotating Variants" % (startTime.strftime("%c")),self.logFile,self.textField)
for v in self.variantDict.values():
anno = genome.annotatePosition(v.chromosome,v.position) #[(gene1,segment1;segment2;..)..]
GI=[]
for a in anno:
GI.append(a)
v.attributes["GI"]=GI
Helper.printTimeDiff(startTime,self.logFile,self.textField)
示例6: fillDicts
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import info [as 别名]
def fillDicts(files,columns,keys):
'''
creates the table and fills the set of keys
'''
fileNumber=len(files)
fileCounter=0
keySet=()
fileCounter=0
for file in files: #loop through all files
i=0
Helper.info("Get information from %s" % file)
file = open(file)
for line in file: #loop through current file
line = line.split()
keyTuple=()
for k in keys:
keyTuple=keyTuple+(line[k-1],)
value=[]
for column in columns: #get the needed values
try:
value.append(line[column-1])
except IndexError:
raise ValueError("Not enough rows in line: %s in file %s" % (" ".join(line),file.name))
if keyTuple in keySet:
#currentDefaultList=idDict[keyTuple]
#currentDefaultList[fileCounter]=value
#idDict[keyTuple]=currentDefaultList
idDict[keyTuple][fileCounter]=value #replace filecounter List with values from current File
else:
currentDefaultList=[["--"]*len(columns)]*len(files) #create default list, with all values empty
currentDefaultList[fileCounter]=value
idDict[keyTuple]=currentDefaultList
keySet=keySet+(keyTuple,)
i+=1
if i % 1000 == 0:
Helper.status("%s lines parsed" % i)
fileCounter+=1
return idDict,keySet
示例7: getOverlapsFromBed
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import info [as 别名]
def getOverlapsFromBed(self,bedFile,getNonOverlaps=False):
'''
returns overlaps from bed file features
:param bedFile: as string or file
:param getNonOverlaps: boolean
:return new variantSet of overlaps
'''
if type(bedFile) == str:
bedFile = open(bedFile)
elif type(bedFile) != file:
raise TypeError("bedFile has wrong type, need str or file, %s found" % type(bedFile))
startTime=Helper.getTime()
Helper.info("[%s] Delete overlaps from %s" % (startTime.strftime("%c"),bedFile.name) ,self.logFile,self.textField)
variantsByChromosome = self.getVariantListByChromosome()
overlapps = set()
for line in bedFile:
try:
sl = line.split("\t")
#if "\t" in line else line.split(" ")
chromosome,start,stop = sl[:3]
start,stop=(int(start),int(stop))
except ValueError:
raise ValueError("Error in line '%s'" % line)
for v in variantsByChromosome[chromosome]:
if start < v.position < stop:
overlapps.add((v.chromosome,v.position,v.ref,v.alt))
if getNonOverlaps:
overlapps = set(self.variantDict.keys()) - overlapps #delete all accept the ones which are overlapping
newSet={}
for variantTuple in overlapps:
#del self.variantDict[variantTuple]
newSet[variantTuple]=self.variantDict[variantTuple]
Helper.printTimeDiff(startTime, self.logFile,self.textField)
return newSet
示例8: printClusters
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import info [as 别名]
def printClusters(self, outFile):
if type(outFile) == str:
try:
outFile=open(outFile,"w")
except IOError:
Helper.warning("Could not open %s to write Variant" % outFile ,self.logFile,self.textField)
if type(outFile) != file:
raise AttributeError("Invalid outfile type in 'printVariantDict' (need string or file, %s found)" % type(outFile))
startTime=Helper.getTime()
Helper.info("[%s] Print Clusters to %s" % (startTime.strftime("%c"),outFile.name),self.logFile,self.textField)
outFile.write("\t".join(["#Chr","Start","Stop","IslandID","GeneID","Gene Symbol","Cluster Length","Number of Editing_sites","Editing_rate","\n"]))
for cluster in self.clusterDict.keys():
end = max(v.position for v in self.clusterDict[cluster])
start = min(v.position for v in self.clusterDict[cluster])
length = end - start
editingRate=float(len(self.clusterDict[cluster]))/float(length)
geneIdSet=set()
geneNameSet=set()
for v in self.clusterDict[cluster]:
try:
gene = v.attributes['GI'][0][0]
if type(gene) == Gene:
geneIdSet.add(gene.geneId)
geneNameSet |= set(gene.names)
#geneList.append(v.attributes['GI'][0][0])
else:
geneIdSet.add("Intergenic")
geneNameSet.add("Intergenic")
except KeyError:
geneIdSet.add("N/A") #when variant has no attribute GI
outFile.write("\t".join([v.chromosome,str(start),str(end),"Island"+str(cluster), #Chr","Start","Stop","Cluster Name",
",".join(map(str,geneIdSet)),",".join(map(str,geneNameSet)), #"GeneID","Gene Symbol"
str(length),str(len(self.clusterDict[cluster])),'%1.2f'%float(editingRate),"\n"]))
示例9: removeEdgeMismatches
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import info [as 别名]
def removeEdgeMismatches(self,bamFile,minDistance, minBaseQual):
startTime=Helper.getTime()
minDistance=int(minDistance)
counter=0;j=0
num_lines = len(self.variantDict)
Helper.info(" [%s] remove Missmatches from the first %s bp from read edges" % (startTime.strftime("%c"),str(minDistance)),self.logFile,self.textField)
bamFile = Samfile(bamFile, "rb")
for varKey in self.variantDict.keys():
variant = self.variantDict[varKey]
counter+=1
if counter%10000==0:
Helper.status('%s mm parsed ' % counter ,self.logFile, self.textField,"grey")
keepSNP=False
varPos=variant.position-1
iter = bamFile.pileup(variant.chromosome, variant.position-1, variant.position)
#walks up the region wich overlap this position
for x in iter:
if x.pos == varPos:
for pileupread in x.pileups: #walk through the single reads
if not pileupread.is_del and not pileupread.is_refskip:
distance=abs(pileupread.alignment.alen-pileupread.query_position) if pileupread.alignment.is_reverse else pileupread.query_position
if distance >= minDistance:
#check readBase and Base Quality
if pileupread.alignment.query_sequence[pileupread.query_position] == variant.alt and pileupread.alignment.query_qualities[pileupread.query_position]>=minBaseQual:
#if pileupread.alignment.query_sequence[pileupread.query_position] == variant.alt:
keepSNP=True
if keepSNP==False:
j+=1
del self.variantDict[varKey]
Helper.status('%s of %svariants were deleted' % (j,num_lines), self.logFile, self.textField,"black")
Helper.printTimeDiff(startTime, self.logFile, self.textField)
bamFile.close()
示例10: printVariantDict
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import info [as 别名]
def printVariantDict(self,outfile):
'''
print the variants from the dictionary to the outfile if defined
'''
if type(outfile) == str:
try:
outfile=open(outfile,"w")
except IOError:
Helper.warning("Could not open %s to write Variant" % outfile ,self.logFile,self.textField)
if type(outfile) != file:
raise AttributeError("Invalid outfile type in 'printVariantDict' (need string or file, %s found)" % type(outfile))
startTime=Helper.getTime()
Helper.info("[%s] Print Variants to %s" % (startTime.strftime("%c"),outfile.name),self.logFile,self.textField)
outfile.write("\t".join(["#CHROM", "POS", "ID", "REF", "ALT", "QUAL", "FILTER", "INFO", "\n"]))
for v in self.variantDict.values():
attributeString=""
for key in v.attributes.keys():
if key=="BaseCounts":
attributeString+= "BaseCounts=" + ",".join(v.attributes["BaseCounts"]) + ";"
continue
elif key =="GI":
a=""
for anno in v.attributes["GI"]:
gene,segment = anno
if gene == "-":
a += gene+":"+"|".join(segment)
else:
if type(gene)==str: #when variantDict was not annotated yet
a+=gene +":"+"|".join(segment)+","
else:
a+=gene.names[0]+":"+"|".join(segment)+","
attributeString+=key+"="+a[:-1]+";"
continue
attributeString+= key+"="+str(v.attributes[key])+";"
outfile.write("\t".join([v.chromosome,str(v.position),v.id,v.ref,v.alt,str(v.qual),v.filter, attributeString+"\n"]))
示例11: parseVcf
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import info [as 别名]
def parseVcf(self,vcfFile):
'''
Imports a given Variant File and returns the variants as Dictionary with Tuple of (chromosome,pos,ref,alt) as key and a the VariantObject as value
{(1,45435,"A","G"):VariantObject1,(1,45435,"A","G"):VariantObject1,.....}
'''
startTime = Helper.getTime()
Helper.info(" [%s] Parsing Variant Data from %s" % (startTime.strftime("%c"),vcfFile),self.logFile,self.textField)
#check correct Type
if type(vcfFile) == str:
if os.path.getsize(vcfFile) == 0: #getsize raises OSError if file is not existing
raise IOError("%s File is empty" % vcfFile)
vcfFile = open(vcfFile,"r")
elif type(vcfFile) != file:
raise TypeError("Invalid type in 'parseVcfFile' (need string or file, %s found)" % type(vcfFile))
variantDict = OrderedDict()
for v in self.iterator(vcfFile):
variantDict[(v.chromosome,v.position,v.ref,v.alt)]=v
#variantDict[(v.chromosome,v.position)]=v
Helper.printTimeDiff(startTime,self.logFile,self.textField)
return variantDict
示例12: printParameters
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import info [as 别名]
def printParameters(self):
Helper.info("*** Start RnaEditor with: ***", self.logFile,self.textField)
if self.fastqFiles[0].endswith(".bam"):
Helper.info("\t Bam File: " + self.fastqFiles[0],self.logFile,self.textField)
else:
if self.params.paired:
Helper.info("\t FastQ-File_1: " + self.fastqFiles[0],self.logFile,self.textField)
Helper.info("\t FastQ-File_2: " + self.fastqFiles[1],self.logFile,self.textField)
else:
Helper.info("\t FastQ-File: " + self.fastqFiles[0],self.logFile,self.textField)
Helper.info("\t outfilePrefix:" + self.params.output,self.logFile,self.textField)
Helper.info("\t refGenome:" + self.params.refGenome,self.logFile,self.textField)
Helper.info("\t dbsnp:" + self.params.dbsnp,self.logFile,self.textField)
Helper.info("\t sourceDir:" + self.params.sourceDir,self.logFile,self.textField)
Helper.info("\t threads:" + self.params.threads,self.logFile,self.textField)
Helper.info("\t maxDiff:" + self.params.maxDiff,self.logFile,self.textField)
Helper.info("\t seedDiff:" + self.params.seedDiff,self.logFile,self.textField)
Helper.info("\t paired:" + str(self.params.paired),self.logFile,self.textField)
Helper.info("\t keepTemp:" + str(self.params.keepTemp),self.logFile,self.textField)
Helper.info("\t overwrite:" + str(self.params.overwrite),self.logFile,self.textField)
Helper.info("",self.logFile,self.textField)
示例13: splitByBed
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import info [as 别名]
def splitByBed(self,bedFile):
'''
returns overlaps and nonOverlaps from bed file features
:param bedFile: as string or file
:param getNonOverlaps: boolean
'''
if type(bedFile) == str:
bedFile = open(bedFile)
elif type(bedFile) != file:
raise TypeError("bedFile has wrong type, need str or file, %s found" % type(bedFile))
startTime=Helper.getTime()
Helper.info("[%s] Split Variants by Bed File %s" % (startTime.strftime("%c"),bedFile.name) ,self.logFile,self.textField)
variantsByChromosome = self.getVariantListByChromosome()
overlapSet = set()
i=0
for line in bedFile:
try:
sl = line.split("\t")
#if "\t" in line else line.split(" ")
chromosome,start,stop = sl[:3]
start,stop=(int(start),int(stop))
except ValueError:
raise ValueError("Error in line '%s'" % line)
for v in variantsByChromosome[chromosome]:
if start < v.position < stop:
overlapSet.add((v.chromosome,v.position,v.ref,v.alt))
i+=1
if i %100000==0:
Helper.status("%s Bed Feautes parsed" % i, self.logFile,self.textField,"grey")
Helper.info("finished parsing Bed file", self.logFile,self.textField)
Helper.printTimeDiff(startTime, self.logFile,self.textField)
#nonOverlapSet = set(self.variantDict.keys()) - overlapSet #delete all accept the ones which are overlapping
overlaps = {key: self.variantDict[key] for key in self.variantDict if key in overlapSet}
Helper.info("finished creating overlaps", self.logFile,self.textField)
Helper.printTimeDiff(startTime, self.logFile,self.textField)
nonOverlaps = {key: self.variantDict[key] for key in self.variantDict if key not in overlapSet}
"""
overlaps={}
for variantTuple in overlapSet:
#del self.variantDict[variantTuple]
overlaps[variantTuple]=self.variantDict[variantTuple]
nonOverlaps={}
for variantTuple in nonOverlapSet:
nonOverlaps[variantTuple]=self.variantDict
"""
Helper.printTimeDiff(startTime, self.logFile,self.textField)
return overlaps, nonOverlaps
示例14: checkDependencies
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import info [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)
#.........这里部分代码省略.........
示例15: printAttributes
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import info [as 别名]
def printAttributes(self):
print
Helper.info("*** MAP READS WITH FOLLOWING ATTRIBUTES ***", self.rnaEdit.logFile,self.rnaEdit.textField)
if self.rnaEdit.params.paired:
Helper.info("\t FastQ-File_1: " + self.fastqFile1,self.rnaEdit.logFile,self.rnaEdit.textField)
Helper.info("\t FastQ-File_2: " + self.fastqFile2,self.rnaEdit.logFile,self.rnaEdit.textField)
else:
Helper.info("\t FastQ-File: " + self.fastqFile,self.rnaEdit.logFile,self.rnaEdit.textField)
Helper.info("\t outfilePrefix:" + self.rnaEdit.params.output,self.rnaEdit.logFile,self.rnaEdit.textField)
Helper.info("\t refGenome:" + self.rnaEdit.params.refGenome,self.rnaEdit.logFile,self.rnaEdit.textField)
Helper.info("\t dbsnp:" + self.rnaEdit.params.dbsnp,self.rnaEdit.logFile,self.rnaEdit.textField)
Helper.info("\t sourceDir:" + self.rnaEdit.params.sourceDir,self.rnaEdit.logFile,self.rnaEdit.textField)
Helper.info("\t threads:" + self.rnaEdit.params.threads,self.rnaEdit.logFile,self.rnaEdit.textField)
Helper.info("\t maxDiff:" + self.rnaEdit.params.maxDiff,self.rnaEdit.logFile,self.rnaEdit.textField)
Helper.info("\t seedDiff:" + self.rnaEdit.params.seedDiff,self.rnaEdit.logFile,self.rnaEdit.textField)
Helper.info("\t paired:" + str(self.rnaEdit.params.paired),self.rnaEdit.logFile,self.rnaEdit.textField)
Helper.info("\t keepTemp:" + str(self.rnaEdit.params.keepTemp),self.rnaEdit.logFile,self.rnaEdit.textField)
Helper.info("\t overwrite:" + str(self.rnaEdit.params.overwrite),self.rnaEdit.logFile,self.rnaEdit.textField)
Helper.info("",self.rnaEdit.logFile,self.rnaEdit.textField)