CloseableIterator<SAMRecord> query(String sequence, int start, int end,
boolean contained) {
CloseableIterator<SAMRecord> iterator = queryAlignmentStart(sequence,
start);
QueryType qt = QueryType.CONTAINED;
if (!contained)
qt = QueryType.OVERLAPPING;
if (end == -1)
qt = QueryType.STARTING_AT;
return new BAMQueryFilteringIterator(iterator, sequence, start, end, qt);