Repair code that sorts and merges intervals.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3317 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
hanna 2010-05-06 22:37:25 +00:00
parent 72e030a670
commit 4e0019b04f
2 changed files with 7 additions and 9 deletions

View File

@ -227,7 +227,7 @@ public class GenomeAnalysisEngine {
if (rawIntervals.size() == 0) if (rawIntervals.size() == 0)
return null; return null;
return IntervalUtils.sortAndMergeIntervals(GenomeLocSortedSet.createSetFromList(rawIntervals),mergingRule); return IntervalUtils.sortAndMergeIntervals(rawIntervals,mergingRule);
} }
/** /**

View File

@ -27,7 +27,7 @@ public class IntervalUtils {
* @param argList A list of strings containing interval data. * @param argList A list of strings containing interval data.
* @return an unsorted, unmerged representation of the given intervals. Null is used to indicate that all intervals should be used. * @return an unsorted, unmerged representation of the given intervals. Null is used to indicate that all intervals should be used.
*/ */
public static GenomeLocSortedSet parseIntervalArguments(List<String> argList) { public static List<GenomeLoc> parseIntervalArguments(List<String> argList) {
List<GenomeLoc> rawIntervals = new ArrayList<GenomeLoc>(); // running list of raw GenomeLocs List<GenomeLoc> rawIntervals = new ArrayList<GenomeLoc>(); // running list of raw GenomeLocs
if (argList != null) { // now that we can be in this function if only the ROD-to-Intervals was provided, we need to if (argList != null) { // now that we can be in this function if only the ROD-to-Intervals was provided, we need to
@ -58,7 +58,7 @@ public class IntervalUtils {
} }
} }
return GenomeLocSortedSet.createSetFromList(rawIntervals); return rawIntervals;
} }
/** /**
@ -70,15 +70,13 @@ public class IntervalUtils {
* @param mergingRule A descriptor for the type of merging to perform. * @param mergingRule A descriptor for the type of merging to perform.
* @return A sorted, merged version of the intervals passed in. * @return A sorted, merged version of the intervals passed in.
*/ */
public static GenomeLocSortedSet sortAndMergeIntervals(GenomeLocSortedSet intervals, IntervalMergingRule mergingRule) { public static GenomeLocSortedSet sortAndMergeIntervals(List<GenomeLoc> intervals, IntervalMergingRule mergingRule) {
List<GenomeLoc> intervalList = intervals.toList();
// sort raw interval list // sort raw interval list
Collections.sort(intervalList); Collections.sort(intervals);
// now merge raw interval list // now merge raw interval list
intervalList = GenomeLocParser.mergeIntervalLocations(intervalList, mergingRule); intervals = GenomeLocParser.mergeIntervalLocations(intervals, mergingRule);
return GenomeLocSortedSet.createSetFromList(intervalList); return GenomeLocSortedSet.createSetFromList(intervals);
} }
/** /**