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


Java IntervalList.unique方法代码示例

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


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

示例1: run

import net.sf.picard.util.IntervalList; //导入方法依赖的package包/类
@Override
public void run() {
    
    IoUtil.assertFileIsReadable(coordsFile);
    IoUtil.assertFileIsReadable(referenceSequence);
    IoUtil.assertFileIsWritable(outFile);
    
    final ReferenceSequenceFile ref = ReferenceSequenceFileFactory
            .getReferenceSequenceFile(referenceSequence);
    
    final SAMFileHeader header = new SAMFileHeader();
    header.setSequenceDictionary(ref.getSequenceDictionary());
    final IntervalList intervalList = new IntervalList(header);
    
    Iterator<Interval> iter = new CoordsDups(coordsFile);
    while(iter.hasNext()){
        intervalList.add(iter.next());
    }
    CloserUtil.close(iter);
    
    intervalList.unique();
    intervalList.write(outFile);
}
 
开发者ID:TGenNorth,项目名称:ISGPipeline,代码行数:24,代码来源:CoordsDupsInProcessFunction.java

示例2: run

import net.sf.picard.util.IntervalList; //导入方法依赖的package包/类
@Override
public void run() {
    final ReferenceSequenceFile ref = ReferenceSequenceFileFactory
            .getReferenceSequenceFile(referenceSequence);

    final SAMFileHeader header = new SAMFileHeader();
    header.setSequenceDictionary(ref.getSequenceDictionary());
    final IntervalList intervalList = new IntervalList(header);
    
    Iterator<Interval> iter = new CoordsCoverage(coordsFile, referenceSequence);
    while(iter.hasNext()){
        intervalList.add(iter.next());
    }
    CloserUtil.close(iter);
    
    intervalList.unique();
    intervalList.write(outFile);
}
 
开发者ID:TGenNorth,项目名称:ISGPipeline,代码行数:19,代码来源:CoordsCoverageInProcessFunction.java

示例3: doWork

import net.sf.picard.util.IntervalList; //导入方法依赖的package包/类
@Override
protected int doWork() {

    // read in self coords file and create overlap detector
    // process coords and query overlap detector using query coord
    // if overlaps are found, grab overlapping region from reference coord
    // add coord to interval list
    // make interval list unique

    IoUtil.assertFileIsReadable(SELF_COORDS);
    IoUtil.assertFileIsReadable(REF_COORDS);
    IoUtil.assertFileIsReadable(REFERENCE_SEQUENCE);
    IoUtil.assertFileIsWritable(OUTPUT);

    final ReferenceSequenceFile ref = ReferenceSequenceFileFactory.getReferenceSequenceFile(REFERENCE_SEQUENCE);
    assertDictionaryExists(ref);
    assertFastaIsIndexed(ref);

    final SAMFileHeader header = new SAMFileHeader();
    header.setSequenceDictionary(ref.getSequenceDictionary());
    final IntervalList intervalList = new IntervalList(header);

    OverlapDetector<Interval> overlapDetector = new OverlapDetector<Interval>(0, 0);
    {
        Iterator<Interval> coordsDupsIter = new CoordsDups(SELF_COORDS);
        while (coordsDupsIter.hasNext()) {
            Interval interval = coordsDupsIter.next();
            overlapDetector.addLhs(interval, interval);
        }
    }

    Iterator<CoordsRecord> coordsIter = new CoordsRecordIterator(REF_COORDS);
    int refIndex = -1;
    int queryIndex = -1;

    //create overlap detector 
    while (coordsIter.hasNext()) {
        CoordsRecord coord = coordsIter.next();
        if (refIndex == -1) {
            refIndex = determineReferenceCoordIndex(coord, ref.getSequenceDictionary());
            queryIndex = refIndex == 1 ? 0 : 1;
        }
        final Interval refCoord = toInterval(coord.getCoord(refIndex));
        final Interval qryCoord = toInterval(coord.getCoord(queryIndex));
        if (refCoord.isNegativeStrand() && qryCoord.isNegativeStrand()) {
            throw new IllegalStateException("Ref and Qry coords are both reversed");
        }

        final Collection<Interval> overlaps = overlapDetector.getOverlaps(qryCoord);

        for (Interval overlap : overlaps) {
            intervalList.add(translate(overlap, qryCoord, refCoord));
        }
    }

    intervalList.unique();
    intervalList.sort();
    intervalList.write(OUTPUT);

    return 0;
}
 
开发者ID:TGenNorth,项目名称:ISGPipeline,代码行数:62,代码来源:FindParalogs.java


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