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:
parent
0097106938
commit
3767adb0bb
|
|
@ -252,7 +252,6 @@ public class GenomeLocParser {
|
||||||
* @return the list of merged locations
|
* @return the list of merged locations
|
||||||
*/
|
*/
|
||||||
public static List<GenomeLoc> mergeIntervalLocations(final List<GenomeLoc> raw, IntervalMergingRule rule) {
|
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)
|
if (raw.size() <= 1 || rule == IntervalMergingRule.NONE)
|
||||||
return raw;
|
return raw;
|
||||||
else {
|
else {
|
||||||
|
|
@ -355,11 +354,18 @@ public class GenomeLocParser {
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
try {
|
try {
|
||||||
|
ret = new ArrayList<GenomeLoc>();
|
||||||
xReadLines reader = new xReadLines(new File(file_name));
|
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();
|
reader.close();
|
||||||
String locStr = Utils.join(";", lines);
|
|
||||||
ret = parseGenomeLocs(locStr, rule);
|
if(ret.isEmpty())
|
||||||
|
return null;
|
||||||
|
|
||||||
for(GenomeLoc locus: ret)
|
for(GenomeLoc locus: ret)
|
||||||
exceptionOnInvalidGenomeLocBounds(locus);
|
exceptionOnInvalidGenomeLocBounds(locus);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue