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


Java SAMRecord.getStart方法代码示例

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


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

示例1: computeDifferentBase

import htsjdk.samtools.SAMRecord; //导入方法依赖的package包/类
public List<BasePosition> computeDifferentBase(final SAMRecord record)
    throws IOException {
    if (record.getStart() < min) {
        refreshHeadReferenceBuffer(record.getStart());
    }
    if (record.getEnd() > max) {
        refreshTailReferenceBuffer(record.getEnd());
    }

    ReadBaseProcessor
        baseCounter = new ReadBaseProcessor(record.getReadString(), referenceBuffer.getBuffer(), record.getStart(),
                                            min, record.getCigar().getCigarElements(), showClipping, record);
    return baseCounter.getMismatchBasePositions();
}
 
开发者ID:react-dev26,项目名称:NGB-master,代码行数:15,代码来源:SAMRecordHandler.java

示例2: getReadsFromFile

import htsjdk.samtools.SAMRecord; //导入方法依赖的package包/类
private Map<Sequence, List<SAMRecord>> getReadsFromFile(final Chromosome chromosome, final Track<Sequence> track,
                                                        final BamFile bamFile, final List<Sequence> blocks)
        throws IOException {
    final Map<Sequence, List<SAMRecord>> records = new HashMap<>();
    try (SamReader reader = makeSamReader(bamFile, Collections.singletonList(chromosome),
            chromosome.getReferenceId())) {
        LOG.debug(getMessage(MessagesConstants.DEBUG_FILE_OPENING, bamFile.getPath()));
        String chromosomeName = chromosome.getName();
        final int startIndex = track.getStartIndex();
        final int endIndex = track.getEndIndex();

        if (reader.getFileHeader().getSequence(chromosomeName) == null) {
            chromosomeName = Utils.changeChromosomeName(chromosomeName);
        }
        final SAMRecordIterator iterator = reader.queryOverlapping(chromosomeName, startIndex, endIndex);

        LOG.debug(getMessage(MessagesConstants.DEBUG_GET_ITERATOR_QUERY, iterator.toString()));
        while (iterator.hasNext()) {
            final SAMRecord samRecord = iterator.next();
            //if read unmapped
            if (!samRecord.getSAMFlags().contains(SAMFlag.READ_UNMAPPED) && !samRecord.getCigar().isEmpty() &&
                    samRecord.getEnd() > samRecord.getStart()) {
                addRecordToBlock(blocks, records, samRecord);
            }
        }
    }
    return records;
}
 
开发者ID:react-dev26,项目名称:NGB-master,代码行数:29,代码来源:BamHelper.java

示例3: add

import htsjdk.samtools.SAMRecord; //导入方法依赖的package包/类
/**
 * @param record for processing
 * @throws IOException
 */
@Override
public void add(final SAMRecord record) throws IOException {
    int start = record.getStart();
    int end = record.getEnd();
    final List<CigarElement> cigarList = record.getCigar().getCigarElements();
    final int flags = record.getFlags();
    String head = null;
    String tail = null;

    if (BamUtil.validateReadParams(flags, cigarList, end, start)) {
        coverageAdd(start, end, coverageArray, true);
        final String readString = record.getReadString();

        if (showClipping) {
            final CigarElement first = cigarList.get(0);
            final CigarElement last = cigarList.get(cigarList.size() - 1);

            if (first.getOperator().equals(CigarOperator.S)) {
                start -= first.getLength();
                head = readString.substring(0, first.getLength());
            }
            if (last.getOperator().equals(CigarOperator.S)) {
                end += last.getLength();
                tail = readString.substring(readString.length() - last.getLength(), readString.length());
            }
        }
        if (start < min) {
            refreshHeadReferenceBuffer(start);
        }
        if (end > max) {
            refreshTailReferenceBuffer(end);
        }

        List<BasePosition> differentBase = computeDifferentBase(readString,
                referenceBuffer != null ? referenceBuffer.getBuffer() : null, start, min, cigarList, showClipping,
                record);

        filter.add(record, start, end, mode == BamTrackMode.FULL ? differentBase : null, head, tail);
    }
}
 
开发者ID:react-dev26,项目名称:NGB-master,代码行数:45,代码来源:SAMRecordHandler.java


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