当前位置: 首页>>代码示例>>Python>>正文


Python AlignmentSet.attach方法代码示例

本文整理汇总了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
开发者ID:mdsmith,项目名称:DumbView,代码行数:35,代码来源:main.py

示例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
开发者ID:dalexander,项目名称:DumbView,代码行数:51,代码来源:main.py


注:本文中的pbcore.io.AlignmentSet.attach方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。