@Override IntervalList act(final List<IntervalList> list, final List<IntervalList> unused) { return IntervalList.union(list); } },
@Override IntervalList act(final List<IntervalList> list, final List<IntervalList> unused) { return IntervalList.union(list); } },
/** * Calls {@link #fromFile(java.io.File)} on the provided files, and returns their {@link #union(java.util.Collection)}. */ public static IntervalList fromFiles(final Collection<File> intervalListFiles) { final Collection<IntervalList> intervalLists = new ArrayList<>(); for (final File file : intervalListFiles) { intervalLists.add(IntervalList.fromFile(file)); } return IntervalList.union(intervalLists); }
/** * Calls {@link #fromFile(java.io.File)} on the provided files, and returns their {@link #union(java.util.Collection)}. */ public static IntervalList fromFiles(final Collection<File> intervalListFiles) { final Collection<IntervalList> intervalLists = new ArrayList<>(); for (final File file : intervalListFiles) { intervalLists.add(IntervalList.fromFile(file)); } return IntervalList.union(intervalLists); }
/** * A utility function for subtracting a collection of IntervalLists from another. Resulting loci are those that are in the first collection * but not the second. * * @param lhs the collection of IntervalList from which to subtract intervals * @param rhs the collection of intervals to subtract * @return an IntervalList comprising all loci that are in the first collection but not the second lhs-rhs=answer. */ public static IntervalList subtract(final Collection<IntervalList> lhs, final Collection<IntervalList> rhs) { return intersection( union(lhs), invert(union(rhs))); }
/** * Calls {@link #fromFile(java.io.File)} on the provided files, and returns their {@link #union(java.util.Collection)}. */ public static IntervalList fromFiles(final Collection<File> intervalListFiles) { final Collection<IntervalList> intervalLists = new ArrayList<IntervalList>(); for (final File file : intervalListFiles) { intervalLists.add(IntervalList.fromFile(file)); } return IntervalList.union(intervalLists); }
public static IntervalList union(final IntervalList list1, final IntervalList list2) { final Collection<IntervalList> duo = CollectionUtil.makeList(list1, list2); return IntervalList.union(duo); }
/** * A utility function for subtracting a collection of IntervalLists from another. Resulting loci are those that are in the first collection * but not the second. * * @param lhs the collection of IntervalList from which to subtract intervals * @param rhs the collection of intervals to subtract * @return an IntervalList comprising all loci that are in the first collection but not the second lhs-rhs=answer. */ public static IntervalList subtract(final Collection<IntervalList> lhs, final Collection<IntervalList> rhs) { return intersection( union(lhs), invert(union(rhs))); }
public static IntervalList union(final IntervalList list1, final IntervalList list2) { final Collection<IntervalList> duo = CollectionUtil.makeList(list1, list2); return IntervalList.union(duo); }
public static IntervalList union(final IntervalList list1, final IntervalList list2) { final Collection<IntervalList> duo = CollectionUtil.makeList(list1, list2); return IntervalList.union(duo); }
/** * A utility function for subtracting a collection of IntervalLists from another. Resulting loci are those that are in the first collection * but not the second. * * @param listsToSubtractFrom the collection of IntervalList from which to subtract intervals * @param listsToSubtract the collection of intervals to subtract * @return an IntervalLists comprising all loci that are in first collection but not second. */ public static IntervalList subtract(final Collection<IntervalList> listsToSubtractFrom, final Collection<IntervalList> listsToSubtract) { return intersection( union(listsToSubtractFrom), invert(union(listsToSubtract))); }
/** * A utility function for finding the difference between two IntervalLists. * * @param lists1 the first collection of IntervalLists * @param lists2 the second collection of IntervalLists * @return the difference between the two intervals, i.e. the loci that are only in one IntervalList but not both */ public static IntervalList difference(final Collection<IntervalList> lists1, final Collection<IntervalList> lists2) { return union( subtract(lists1, lists2), subtract(lists2, lists1)); }
/** * A utility function for finding the difference between two IntervalLists. * * @param lists1 the first collection of IntervalLists * @param lists2 the second collection of IntervalLists * @return the difference between the two intervals, i.e. the loci that are only in one IntervalList but not both */ public static IntervalList difference(final Collection<IntervalList> lists1, final Collection<IntervalList> lists2) { return union( subtract(lists1, lists2), subtract(lists2, lists1)); }
/** * A utility function for finding the difference between two IntervalLists. * * @param lists1 the first collection of IntervalLists * @param lists2 the second collection of IntervalLists * @return the difference between the two intervals, i.e. the loci that are only in one IntervalList but not both */ public static IntervalList difference(final Collection<IntervalList> lists1, final Collection<IntervalList> lists2) { return union( subtract(lists1, lists2), subtract(lists2, lists1)); }
@Test(dataProvider = "unionData") public void testUnionIntervalLists(final List<IntervalList> lists, final IntervalList list) { Assert.assertEquals( CollectionUtil.makeCollection(IntervalList.union(lists).iterator()), CollectionUtil.makeCollection(list.iterator())); }
else intervals = IntervalList.union(intervals, tmpIntervalList);
else intervals = IntervalList.union(intervals, tmpIntervalList);