本文整理汇总了Java中htsjdk.samtools.util.IntervalTree.put方法的典型用法代码示例。如果您正苦于以下问题:Java IntervalTree.put方法的具体用法?Java IntervalTree.put怎么用?Java IntervalTree.put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类htsjdk.samtools.util.IntervalTree
的用法示例。
在下文中一共展示了IntervalTree.put方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processExon
import htsjdk.samtools.util.IntervalTree; //导入方法依赖的package包/类
private int processExon(IntervalTree<Block> intervalTree, int totalLength, GeneFeature feature,
int intronLength, int centerPosition, boolean forward) {
int currentLength = 0;
if (EXON_FEATURE_NAME.equalsIgnoreCase(feature.getFeature())) {
Block exon = createExon(feature, intronLength);
Iterator<IntervalTree.Node<Block>> nodeIterator = intervalTree.overlappers(exon.getStartIndex(),
exon.getEndIndex());
if (nodeIterator.hasNext()) {
Block merged = exon;
while (nodeIterator.hasNext()) {
Block toMerge = nodeIterator.next().getValue();
merged = mergeExons(merged, toMerge);
currentLength = currentLength - calculateExonLength(toMerge, centerPosition, forward)
+ calculateExonLength(merged, centerPosition, forward);
nodeIterator.remove();
}
intervalTree.put(merged.getStartIndex(), merged.getEndIndex(), merged);
} else {
currentLength += calculateExonLength(exon, centerPosition, forward);
intervalTree.put(exon.getStartIndex(), exon.getEndIndex(), exon);
}
}
return totalLength + currentLength;
}
示例2: retrieveTranscripts
import htsjdk.samtools.util.IntervalTree; //导入方法依赖的package包/类
private IntervalTree<Annotation> retrieveTranscripts(Genomics genomics, StreamVariantsRequest request) {
Stopwatch stopwatch = Stopwatch.createStarted();
IntervalTree<Annotation> transcripts = new IntervalTree<>();
Iterable<Annotation> transcriptIter =
Paginator.Annotations.create(genomics, ShardBoundary.Requirement.OVERLAPS).search(
new SearchAnnotationsRequest()
.setAnnotationSetIds(transcriptSetIds)
.setReferenceName(canonicalizeRefName(request.getReferenceName()))
.setStart(request.getStart())
.setEnd(request.getEnd()));
for (Annotation annotation : transcriptIter) {
transcripts.put(annotation.getStart().intValue(), annotation.getEnd().intValue(), annotation);
}
LOG.info(String.format("read %d transcripts in %s (%.2f / s)", transcripts.size(),
stopwatch, (double)transcripts.size() / stopwatch.elapsed(TimeUnit.SECONDS)));
return transcripts;
}
示例3: testOverlapping
import htsjdk.samtools.util.IntervalTree; //导入方法依赖的package包/类
private void testOverlapping(List<Block> exons) {
IntervalTree<Block> intervalTree = new IntervalTree<>();
for (Block exon : exons) {
Iterator<IntervalTree.Node<Block>> nodeIterator = intervalTree.overlappers(exon.getStartIndex(),
exon.getEndIndex());
Assert.assertFalse("Should be no overlapping exons", nodeIterator.hasNext());
intervalTree.put(exon.getStartIndex(), exon.getEndIndex(), exon);
}
}
示例4: getSCNVintervalTreeWithExtendBase
import htsjdk.samtools.util.IntervalTree; //导入方法依赖的package包/类
public IntervalTree getSCNVintervalTreeWithExtendBase(ArrayList<VarscanCNVFormat> SCNVlist, int extendBaseNumber){
IntervalTree CNVIntervalTree = new IntervalTree();
VarscanCNVFormat vscnv=null;
for (int i = 0; i < SCNVlist.size(); i++) {
vscnv=SCNVlist.get(i);
CNVIntervalTree.put(Integer.parseInt(vscnv.getChr_start())-extendBaseNumber, Integer.parseInt(vscnv.getChr_stop())+extendBaseNumber, vscnv);
}
return CNVIntervalTree;
}
示例5: getSCNVintervalTree
import htsjdk.samtools.util.IntervalTree; //导入方法依赖的package包/类
public IntervalTree getSCNVintervalTree(ArrayList<VarscanCNVFormat> SCNVlist){
IntervalTree CNVIntervalTree = new IntervalTree();
VarscanCNVFormat vscnv=null;
for (int i = 0; i < SCNVlist.size(); i++) {
vscnv=SCNVlist.get(i);
CNVIntervalTree.put(Integer.parseInt(vscnv.getChr_start()), Integer.parseInt(vscnv.getChr_stop()), vscnv);
}
return CNVIntervalTree;
}
示例6: getBEDIntervalTreeWithExtendBase
import htsjdk.samtools.util.IntervalTree; //导入方法依赖的package包/类
public IntervalTree getBEDIntervalTreeWithExtendBase(ArrayList<BED> SCNVlist, int extendBaseNumber){
IntervalTree CNVIntervalTree = new IntervalTree();
BED bed=null;
for (int i = 0; i < SCNVlist.size(); i++) {
bed=SCNVlist.get(i);
CNVIntervalTree.put(bed.getChromStart()-extendBaseNumber, bed.getChromEnd()+extendBaseNumber, bed);
}
return CNVIntervalTree;
}