m = (Match) _m;
mfound = false;
- if (m.sequence == sequence)
+ if (m.sequence == sequence
+ || m.sequence == sequence.getDatasetSequence())
{
mfound = true;
- // locate aligned position
matchStart = sequence.findIndex(m.start) - 1;
- matchEnd = sequence.findIndex(m.end) - 1;
- }
- else if (m.sequence == sequence.getDatasetSequence())
- {
- mfound = true;
- // locate region in local context
- matchStart = sequence.findIndex(m.start) - 1;
- matchEnd = sequence.findIndex(m.end) - 1;
+ matchEnd = m.start == m.end ? matchStart : sequence
+ .findIndex(m.end) - 1;
}
+
if (mfound)
{
if (matchStart <= end && matchEnd >= start)