{
return mappings == null ? "null" : mappings.toString();
}
+
+ /**
+ * Returns the first mapping found that is from 'fromSeq' to 'toSeq', or null
+ * if none found
+ *
+ * @param fromSeq
+ * aligned or dataset sequence
+ * @param toSeq
+ * aligned or dataset sequence
+ * @return
+ */
+ public Mapping getMappingBetween(SequenceI fromSeq, SequenceI toSeq)
+ {
+ for (SequenceToSequenceMapping mapping : mappings)
+ {
+ SequenceI from = mapping.fromSeq;
+ SequenceI to = mapping.mapping.to;
+ if ((from == fromSeq || from == fromSeq.getDatasetSequence())
+ && (to == toSeq || to == toSeq.getDatasetSequence()))
+ {
+ return mapping.mapping;
+ }
+ }
+ return null;
+ }
}