@Test public void testUnionSamePosition() { final IntervalList iList= new IntervalList(fileHeader); final List<Interval> intervals = Arrays.asList( new Interval("1", 2, 100, true, "test1"), new Interval("1", 2, 100, true, "test2") ); iList.addall(intervals); final List<Interval> uniqued = iList.uniqued().getIntervals(); Assert.assertEquals(uniqued.size(),1); Assert.assertEquals(uniqued.get(0).getName(),"test1|test2"); }
/** * A utility function for merging a list of IntervalLists, checks for equal dictionaries. * Merging does not look for overlapping intervals nor uniquify * * @param lists a list of IntervalList * @return the union of all the IntervalLists in lists. */ public static IntervalList concatenate(final Collection<IntervalList> lists) { if (lists.isEmpty()) { throw new SAMException("Cannot concatenate an empty list of IntervalLists."); } // Ensure that all the sequence dictionaries agree and merge the lists final SAMFileHeader header = lists.iterator().next().getHeader().clone(); header.setSortOrder(SAMFileHeader.SortOrder.unsorted); final IntervalList merged = new IntervalList(header); for (final IntervalList in : lists) { SequenceUtil.assertSequenceDictionariesEqual(merged.getHeader().getSequenceDictionary(), in.getHeader().getSequenceDictionary()); merged.addall(in.intervals); } return merged; }
runningIntervalList.addall(intervalQueue);
runningIntervalList.addall(intervalQueue);
/** * A utility function for merging a list of IntervalLists, checks for equal dictionaries. * Merging does not look for overlapping intervals nor uniquify * * @param lists a list of IntervalList * @return the union of all the IntervalLists in lists. */ public static IntervalList concatenate(final Collection<IntervalList> lists) { if(lists.isEmpty()){ throw new SAMException("Cannot concatenate an empty list of IntervalLists."); } // Ensure that all the sequence dictionaries agree and merge the lists final SAMFileHeader header = lists.iterator().next().getHeader().clone(); header.setSortOrder(SAMFileHeader.SortOrder.unsorted); final IntervalList merged = new IntervalList(header); for (final IntervalList in : lists) { SequenceUtil.assertSequenceDictionariesEqual(merged.getHeader().getSequenceDictionary(), in.getHeader().getSequenceDictionary()); merged.addall(in.intervals); } return merged; }
/** * A utility function for merging a list of IntervalLists, checks for equal dictionaries. * Merging does not look for overlapping intervals nor uniquify * * @param lists a list of IntervalList * @return the union of all the IntervalLists in lists. */ public static IntervalList concatenate(final Collection<IntervalList> lists) { if (lists.isEmpty()) { throw new SAMException("Cannot concatenate an empty list of IntervalLists."); } // Ensure that all the sequence dictionaries agree and merge the lists final SAMFileHeader header = lists.iterator().next().getHeader().clone(); header.setSortOrder(SAMFileHeader.SortOrder.unsorted); final IntervalList merged = new IntervalList(header); for (final IntervalList in : lists) { SequenceUtil.assertSequenceDictionariesEqual(merged.getHeader().getSequenceDictionary(), in.getHeader().getSequenceDictionary()); merged.addall(in.intervals); } return merged; }
@Test(expectedExceptions = IllegalArgumentException.class) public void TestFailAddAll() { IntervalList test = new IntervalList(this.fileHeader); test.addall(CollectionUtil.makeList(new Interval("blarg", 1, 1), new Interval("bloorg", 1, 1))); }
SequenceUtil.assertSequenceDictionariesEqual(header.getSequenceDictionary(), list.getHeader().getSequenceDictionary()); overlapIntervals.addall(list.getIntervals());
SequenceUtil.assertSequenceDictionariesEqual(header.getSequenceDictionary(), list.getHeader().getSequenceDictionary()); overlapIntervals.addall(list.getIntervals());
this.intervals.addall(otherMetric.intervals.getIntervals()); this.intervals = this.intervals.uniqued(); if (this.intervals.getBaseCount() != genomeTerritory) {
this.intervals.addall(otherMetric.intervals.getIntervals()); this.intervals = this.intervals.uniqued(); if (this.intervals.getBaseCount() != genomeTerritory) {