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


Java IntervalTree.put方法代码示例

本文整理汇总了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;
}
 
开发者ID:react-dev26,项目名称:NGB-master,代码行数:27,代码来源:GffManager.java

示例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;
}
 
开发者ID:googlegenomics,项目名称:dataflow-java,代码行数:18,代码来源:AnnotateVariants.java

示例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);
    }
}
 
开发者ID:react-dev26,项目名称:NGB-master,代码行数:10,代码来源:GffManagerTest.java

示例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;
}
 
开发者ID:likelet,项目名称:DAtools,代码行数:10,代码来源:ParseIntervalTree.java

示例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;
}
 
开发者ID:likelet,项目名称:DAtools,代码行数:10,代码来源:ParseIntervalTree.java

示例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;
}
 
开发者ID:likelet,项目名称:DAtools,代码行数:10,代码来源:ParseIntervalTree.java


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