Processing intervals as they stream in means much lower memory usage and

quicker runtime.  Making change as minimal as possible to avoid conflicts
with BT's incoming patch.


git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3061 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
hanna 2010-03-22 22:04:45 +00:00
parent 0097106938
commit 3767adb0bb
1 changed files with 10 additions and 4 deletions

View File

@ -252,7 +252,6 @@ public class GenomeLocParser {
* @return the list of merged locations
*/
public static List<GenomeLoc> mergeIntervalLocations(final List<GenomeLoc> raw, IntervalMergingRule rule) {
logger.debug(" Raw locations are: " + Utils.join(", ", raw));
if (raw.size() <= 1 || rule == IntervalMergingRule.NONE)
return raw;
else {
@ -355,11 +354,18 @@ public class GenomeLocParser {
} catch (Exception e) {
try {
ret = new ArrayList<GenomeLoc>();
xReadLines reader = new xReadLines(new File(file_name));
List<String> lines = reader.readLines();
for(String line: reader) {
List<GenomeLoc> loci = parseGenomeLocs(line, rule);
if(loci != null)
ret.addAll(loci);
}
reader.close();
String locStr = Utils.join(";", lines);
ret = parseGenomeLocs(locStr, rule);
if(ret.isEmpty())
return null;
for(GenomeLoc locus: ret)
exceptionOnInvalidGenomeLocBounds(locus);
return ret;