@Override public long listWeight(final IntervalList intervalList) { return intervalList.getBaseCount(); }
@Override public long listWeight(final IntervalList intervalList) { return intervalList.getBaseCount(); }
/** * Gets the count of unique bases represented by the intervals in the list. */ public long getUniqueBaseCount() { return uniqued().getBaseCount(); }
/** * Gets the count of unique bases represented by the intervals in the list. */ public long getUniqueBaseCount() { return uniqued().getBaseCount(); }
/** Gets the count of unique bases represented by the intervals in the list. */ public long getUniqueBaseCount() { return uniqued().getBaseCount(); }
@Test(dataProvider = "actionAndTotalBasesWithInvertData") public void testActionsWithInvert(final IntervalListTools.Action action, final long bases, final int intervals) throws IOException { final IntervalList il = tester(action, true); Assert.assertEquals(il.getBaseCount(), bases, "unexpected number of bases found."); Assert.assertEquals(il.getIntervals().size(), intervals, "unexpected number of intervals found."); }
@Test(dataProvider = "actionAndTotalBasesData") public void testActions(final IntervalListTools.Action action, final long bases, final int intervals) throws IOException { final IntervalList il = tester(action); Assert.assertEquals(il.getBaseCount(), bases, "unexpected number of bases found."); Assert.assertEquals(il.getIntervals().size(), intervals, "unexpected number of intervals found."); }
final long genomeTerritory = this.intervals.getBaseCount() + otherMetric.intervals.getBaseCount(); this.intervals.addall(otherMetric.intervals.getIntervals()); this.intervals = this.intervals.uniqued(); if (this.intervals.getBaseCount() != genomeTerritory) { throw new PicardException("Trying to merge WgsMetrics calculated on intervals that overlap.");
final long genomeTerritory = this.intervals.getBaseCount() + otherMetric.intervals.getBaseCount(); this.intervals.addall(otherMetric.intervals.getIntervals()); this.intervals = this.intervals.uniqued(); if (this.intervals.getBaseCount() != genomeTerritory) { throw new PicardException("Trying to merge WgsMetrics calculated on intervals that overlap.");
long intervalCount = 0; for (final IntervalList finalInterval : resultIntervals) { totalBaseCount += finalInterval.getBaseCount(); intervalCount += finalInterval.size();
long intervalCount = 0; for (final IntervalList finalInterval : resultIntervals) { totalBaseCount += finalInterval.getBaseCount(); intervalCount += finalInterval.size();
final IntervalList rejects = new IntervalList(intervalList.getHeader()); final long baseCount = intervalList.getBaseCount(); LOG.info("Lifting over " + intervalList.getIntervals().size() + " intervals, encompassing " + baseCount + " bases."); rejects.write(REJECT); final long rejectBaseCount = rejects.getBaseCount();
final IntervalList rejects = new IntervalList(intervalList.getHeader()); final long baseCount = intervalList.getBaseCount(); LOG.info("Lifting over " + intervalList.getIntervals().size() + " intervals, encompassing " + baseCount + " bases."); rejects.write(REJECT); final long rejectBaseCount = rejects.getBaseCount();
/** Calculates a few statistics about the bait design that can then be output. */ void calculateStatistics(final IntervalList targets, final IntervalList baits) { this.TARGET_TERRITORY = (int) targets.getUniqueBaseCount(); this.TARGET_COUNT = targets.size(); this.BAIT_TERRITORY = (int) baits.getUniqueBaseCount(); this.BAIT_COUNT = baits.size(); this.DESIGN_EFFICIENCY = this.TARGET_TERRITORY / (double) this.BAIT_TERRITORY; // Figure out the intersection between all targets and all baits final IntervalList tmp = new IntervalList(targets.getHeader()); final OverlapDetector<Interval> detector = new OverlapDetector<Interval>(0, 0); detector.addAll(baits.getIntervals(), baits.getIntervals()); for (final Interval target : targets) { final Collection<Interval> overlaps = detector.getOverlaps(target); if (overlaps.isEmpty()) { this.ZERO_BAIT_TARGETS++; } else { for (final Interval i : overlaps) tmp.add(target.intersect(i)); } } tmp.uniqued(); this.BAIT_TARGET_TERRITORY_INTERSECTION = (int) tmp.getBaseCount(); }
/** Calculates a few statistics about the bait design that can then be output. */ void calculateStatistics(final IntervalList targets, final IntervalList baits) { this.TARGET_TERRITORY = (int) targets.getUniqueBaseCount(); this.TARGET_COUNT = targets.size(); this.BAIT_TERRITORY = (int) baits.getUniqueBaseCount(); this.BAIT_COUNT = baits.size(); this.DESIGN_EFFICIENCY = this.TARGET_TERRITORY / (double) this.BAIT_TERRITORY; // Figure out the intersection between all targets and all baits final IntervalList tmp = new IntervalList(targets.getHeader()); final OverlapDetector<Interval> detector = new OverlapDetector<Interval>(0, 0); detector.addAll(baits.getIntervals(), baits.getIntervals()); for (final Interval target : targets) { final Collection<Interval> overlaps = detector.getOverlaps(target); if (overlaps.isEmpty()) { this.ZERO_BAIT_TARGETS++; } else { for (final Interval i : overlaps) tmp.add(target.intersect(i)); } } tmp.uniqued(); this.BAIT_TARGET_TERRITORY_INTERSECTION = (int) tmp.getBaseCount(); }
final long baseCount = (intervals != null) ? intervals.getBaseCount() : truthReader.getFileHeader().getSequenceDictionary().getReferenceLength(); addMissingTruthAndMissingCallStates(snpCounter.getCounterSize(), baseCount, snpCounter); addMissingTruthAndMissingCallStates(indelCounter.getCounterSize(), baseCount, indelCounter);
final long baseCount = (intervals != null) ? intervals.getBaseCount() : truthReader.getFileHeader().getSequenceDictionary().getReferenceLength(); addMissingTruthAndMissingCallStates(snpCounter.getCounterSize(), baseCount, snpCounter); addMissingTruthAndMissingCallStates(indelCounter.getCounterSize(), baseCount, indelCounter);