*/
public boolean covers(SequenceI seq)
{
+ return covers(seq,false);
+ }
+ /**
+ *
+ * @param seq
+ * @param localCover - when true - compare extent of seq's dataset sequence rather than the local extent
+ * @return true if mapping covers full length of given sequence
+ */
+ public boolean covers(SequenceI seq, boolean localCover)
+ {
List<int[]> mappedRanges = null;
MapList mapList = mapping.getMap();
+ int mstart=seq.getStart(),mend=seq.getEnd()
+ ;
if (fromSeq == seq || fromSeq == seq.getDatasetSequence())
{
+ if (localCover && fromSeq !=seq)
+ {
+ mstart=fromSeq.getStart();
+ mend=fromSeq.getEnd();
+ }
mappedRanges = mapList.getFromRanges();
}
else if (mapping.to == seq || mapping.to == seq.getDatasetSequence())
{
+ if (localCover && mapping.to !=seq)
+ {
+ mstart=mapping.to.getStart();
+ mend=mapping.to.getEnd();
+ }
mappedRanges = mapList.getToRanges();
}
else
{
int from = Math.min(range[0], range[1]);
int to = Math.max(range[0], range[1]);
- if (from < seq.getStart() || to > seq.getEnd())
+ if (from < mstart || to > mend)
{
return false;
}
length += (to - from + 1);
}
// add 1 to mapped length to allow for a mapped stop codon
- if (length + 1 < (seq.getEnd() - seq.getStart() + 1))
+ if (length + 1 < (mend - mstart + 1))
{
return false;
}