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