本文整理汇总了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;
}
示例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;
}
示例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);
}
}
}
示例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());
}
}