MarkReader mr= new MarkReader(f, "variableStep");
MarkEntry en;
LandscapeBuilder lb= new LandscapeBuilder();
while((en=mr.nextEntry())!=null){
String chr= en.tit.split("chrom=")[1].split("\t")[0];
if(!chr.equals("chrM")){
ArrayList<String> rs= en.chunk;
int ps= 1;
for( int i=0; i<rs.size(); i++ ){
String l=rs.get(i);
if(l.length()>0 && l.charAt(0)!='#'){
String[] ss= l.split("\t");
if(ss.length==2){
int p= Integer.parseInt(ss[0]);
double v= Double.parseDouble(ss[1]);
if(p<ps){
System.out.println(chr+" "+ p+" "+ v);
}
Region reg= new Region(ps, p);
reg.setAttribute(v);
lb.add(chr, reg);
ps= p+1;
}
}
}
}