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


Java SAMFileHeader.getReadGroup方法代码示例

本文整理汇总了Java中htsjdk.samtools.SAMFileHeader.getReadGroup方法的典型用法代码示例。如果您正苦于以下问题:Java SAMFileHeader.getReadGroup方法的具体用法?Java SAMFileHeader.getReadGroup怎么用?Java SAMFileHeader.getReadGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在htsjdk.samtools.SAMFileHeader的用法示例。


在下文中一共展示了SAMFileHeader.getReadGroup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: PicardAlignment

import htsjdk.samtools.SAMFileHeader; //导入方法依赖的package包/类
public PicardAlignment(SAMRecord record) {
    super();

    this.record = record;

    this.flags = record.getFlags();

    String refName = record.getReferenceName();
    Genome genome = GenomeManager.getInstance().getCurrentGenome();
    this.chr = genome == null ? refName : genome.getCanonicalChrName(refName);

    // SAMRecord is 1 based inclusive.  IGV is 0 based exclusive.

    this.end = record.getAlignmentEnd();   // might be modified later for soft clipping
    this.start = record.getAlignmentStart() - 1;   // might be modified later for soft clipping


    if (record.getReadPairedFlag()) {
        String mateReferenceName = record.getMateReferenceName();
        String mateChr = genome == null ? mateReferenceName : genome.getCanonicalChrName(mateReferenceName);
        this.setMate(new ReadMate(mateChr,
                record.getMateAlignmentStart() - 1,
                record.getMateNegativeStrandFlag(),
                record.getMateUnmappedFlag()));
    }

    String keySequence = null;
    SAMFileHeader header = record.getHeader();
    String flowOrder = null;
    if (header != null) {
        readGroup = (String) record.getAttribute("RG");
        if (readGroup != null) {
            SAMReadGroupRecord rgRec = header.getReadGroup(readGroup);
            if (rgRec != null) {
                this.sample = rgRec.getSample();
                this.library = rgRec.getLibrary();
                flowOrder = rgRec.getFlowOrder();
                keySequence = rgRec.getKeySequence();
            }
        }
    }

    Object colorTag = record.getAttribute("YC");
    if (colorTag != null) {
        try {
            color = ColorUtilities.stringToColor(colorTag.toString(), null);
        } catch (Exception e) {
            log.error("Error interpreting color tag: " + colorTag, e);
        }
    }

    setPairOrientation();
    setPairStrands();
    createAlignmentBlocks(record.getCigarString(), record.getReadBases(), record.getBaseQualities(),
            getFlowSignals(flowOrder, keySequence), flowOrder, this.getFlowSignalsStart());


}
 
开发者ID:hyounesy,项目名称:ALEA,代码行数:59,代码来源:PicardAlignment.java


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