String chr = "chr2";
int start = 178707289 / 2;
int end = 179973464 * 2;
AbstractFeatureReader bfr = AbstractFeatureReader.getFeatureReader(bedFile, codec);
Iterator<Feature> iter = bfr.query(chr, start, end);
int count = 0;
while (iter.hasNext()) {
Feature feat = iter.next();
if (count == 0) {
//Check we don't skip first line
assertEquals(178707289, feat.getStart() - startOffset);
}
check_feat_unigene(feat, chr, start, end);
count++;
}
assertEquals(71, count);
//Re-query with some restrictions
count = 0;
start = 178709699;
end = 179721089;
iter = bfr.query(chr, start, end);
while (iter.hasNext()) {
Feature feat = iter.next();
check_feat_unigene(feat, chr, start, end);
count++;
}