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


Java Feature.getContig方法代码示例

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


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

示例1: checkNextChromosome

import htsjdk.tribble.Feature; //导入方法依赖的package包/类
private String checkNextChromosome(Feature feature, String currentChromosomeName,
                                   Map<String, Chromosome> chromosomeMap, List<FeatureIndexEntry> allEntries,
                                   GeneFile geneFile) throws IOException {
    if (!feature.getContig().equals(currentChromosomeName)) {
        if (currentChromosomeName != null && (chromosomeMap.containsKey(currentChromosomeName) ||
                                  chromosomeMap.containsKey(Utils.changeChromosomeName(currentChromosomeName)))) {

            featureIndexDao.writeLuceneIndexForFile(geneFile, allEntries);
            LOGGER.info(MessageHelper.getMessage(
                MessagesConstants.INFO_FEATURE_INDEX_CHROMOSOME_WROTE, currentChromosomeName));
            allEntries.clear();
        }

        return feature.getContig();
    }

    return currentChromosomeName;
}
 
开发者ID:react-dev26,项目名称:NGB-master,代码行数:19,代码来源:FeatureIndexManager.java

示例2: getNextContig

import htsjdk.tribble.Feature; //导入方法依赖的package包/类
private String getNextContig(String currentContig, CloseableIterator<? extends Feature> iterator,
                             Map<String, Chromosome> chromosomeMap) {
    Chromosome currentChromosome = Utils.getFromChromosomeMap(chromosomeMap, currentContig);
    if (currentChromosome == null) {
        while (iterator.hasNext()) {
            Feature feature = iterator.next();
            if (Utils.chromosomeMapContains(chromosomeMap, feature.getContig())) {
                return feature.getContig();
            }
        }

        return null;
    }

    return currentContig;
}
 
开发者ID:react-dev26,项目名称:NGB-master,代码行数:17,代码来源:BedManager.java

示例3: checkSorted

import htsjdk.tribble.Feature; //导入方法依赖的package包/类
public static void checkSorted(final File inputFile, final Feature lastFeature,
        final Feature currentFeature, Map<String, Feature> visitedChromos) {
    // if the last currentFeature is after the current currentFeature, exception out
    if (lastFeature != null && currentFeature.getStart() < lastFeature.getStart() && lastFeature
            .getContig().equals(currentFeature.getContig())) {
        throw new TribbleException.MalformedFeatureFile(
                "Input file is not sorted by start position. \n"
                        + "We saw a record with a start of " + currentFeature.getContig() + ":"
                        + currentFeature.getStart() + " after a record with a start of "
                        + lastFeature.getContig() + ":" + lastFeature.getStart(),
                inputFile.getAbsolutePath());
    }

    //should only visit chromosomes once
    final String curChr = currentFeature.getContig();
    final String lastChr = lastFeature != null ? lastFeature.getContig() : null;
    if (!curChr.equals(lastChr)) {
        if (visitedChromos.containsKey(curChr)) {
            String msg = "Input file must have contiguous chromosomes.";
            throw new TribbleException.MalformedFeatureFile(msg,
                    inputFile.getAbsolutePath());
        } else {
            visitedChromos.put(curChr, currentFeature);
        }
    }

}
 
开发者ID:react-dev26,项目名称:NGB-master,代码行数:28,代码来源:IndexUtils.java

示例4: checkSorted

import htsjdk.tribble.Feature; //导入方法依赖的package包/类
/**
 * Checks if two features of a FeatureFile are sorted
 * @param feature a current feature of a file to check
 * @param lastFeature a previous feature of a file to check
 * @param featureFile a file, thai is being checked
 */
public static void checkSorted(Feature feature, Feature lastFeature, FeatureFile featureFile) {
    if (feature.getStart() < lastFeature.getStart() && // Check if file is sorted
        lastFeature.getContig().equals(feature.getContig())) {
        throw new TribbleException.MalformedFeatureFile(
            "Input file is not sorted by start position. \n" +
            "We saw a record with a start of " + feature.getContig() + ":" +
            feature.getStart() + " after a record with a start of " +
            lastFeature.getContig() + ":" + lastFeature.getStart(), featureFile.getName());
    }
}
 
开发者ID:react-dev26,项目名称:NGB-master,代码行数:17,代码来源:Utils.java


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