本文整理汇总了Python中pbcore.io.AlignmentSet.attach方法的典型用法代码示例。如果您正苦于以下问题:Python AlignmentSet.attach方法的具体用法?Python AlignmentSet.attach怎么用?Python AlignmentSet.attach使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pbcore.io.AlignmentSet
的用法示例。
在下文中一共展示了AlignmentSet.attach方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mainCmpH5
# 需要导入模块: from pbcore.io import AlignmentSet [as 别名]
# 或者: from pbcore.io.AlignmentSet import attach [as 别名]
def mainCmpH5(options):
alnReader = AlignmentSet(options.inputCmpH5,
referenceFastaFname=options.referenceFilename)
if options.fofn is not None:
alnReader.attach(options.fofn)
if options.referenceFilename:
referenceTable = loadReferences(options.referenceFilename, alnReader)
else:
referenceTable = None
for refWindow in options.referenceWindows:
refId = refWindow.refId
refName = alnReader.referenceInfo(refWindow.refId).FullName
refLength = alnReader.referenceInfo(refWindow.refId).Length
refWindow = refWindow._replace(refId=refId)
refWindow = makeDisplayWindow(refLength, options.width, refWindow)
if options.rowNumbers != None:
alns = alnReader[options.rowNumbers]
else:
alns = readsInWindow(alnReader, refWindow, options.depth,
minMapQV=options.minMapQV, strategy=options.sorting)
print windowToGffString(Window(refName, refWindow.start, refWindow.end))
if options.oneAtATime:
formatIndividualAlignments(alnReader, refWindow, alns)
else:
formatWindow(alnReader, refWindow, alns,
referenceTable, options.aligned, options.color,
options.realign, options.consensus)
print
示例2: mainGff
# 需要导入模块: from pbcore.io import AlignmentSet [as 别名]
# 或者: from pbcore.io.AlignmentSet import attach [as 别名]
def mainGff(options):
reader = GffReader(options.inputGff)
alnsFname, referenceFname = extractCmpH5AndReferenceFromGff(reader)
# Allow overriding
alnsFname = options.inputCmpH5 or alnsFname
referenceFname = options.referenceFilename or referenceFname
assert os.path.isfile(alnsFname)
assert os.path.isfile(referenceFname)
alnReader = AlignmentSet(alnsFname, referenceFastaFname=referenceFname)
if options.fofn is not None:
alnReader.attach(options.fofn)
referenceTable = loadReferences(referenceFname, alnReader)
for i, gffRecord in enumerate(reader):
referenceSeq = gffRecord.get("reference", "-")
variantSeq = gffRecord.get("variantSeq", "-")
variantConfidence = gffRecord.confidence
variantSummary = "(%s > %s)" % (referenceSeq, variantSeq)
print gffRecord.type, gffRecord.seqid, gffRecord.start, gffRecord.end, \
variantSummary, variantConfidence
refId = gffRecord.seqid
refLength = alnReader.referenceInfo(gffRecord.seqid).Length
refWindow = makeDisplayWindow(refLength, options.width,
Window(refId,
gffRecord.start-10,
gffRecord.end+10))
if "rows" in gffRecord.attributes:
alns = alnReader[map(int, gffRecord.rows.split(","))]
else:
alns = readsInWindow(alnReader, refWindow, options.depth,
minMapQV=options.minMapQV, strategy=options.sorting)
formatWindow(alnReader, refWindow, alns, referenceTable,
aligned=(gffRecord.type != "insertion"),
consensus=options.consensus,
useColor=options.color,
doRealign=options.realign)
if options.pulseRecognizer:
# CSV output for pulse recognizer
print
csvFname = "variant-" + str(i) + ".csv"
dumpVariantCsv(csvFname, alnReader, alns, gffRecord)
formatVariantCsvLink(csvFname)
print