}
/**
+ * Returns the first mapping found which is to or from the given sequence, or
+ * null.
+ *
+ * @param seq
+ * @return
+ */
+ public Mapping getMappingForSequence(SequenceI seq)
+ {
+ if (dnaSeqs == null)
+ {
+ return null;
+ }
+ SequenceI seqDs = seq.getDatasetSequence();
+ seqDs = seqDs != null ? seqDs : seq;
+
+ for (int ds = 0; ds < dnaSeqs.length; ds++)
+ {
+ if (dnaSeqs[ds] == seqDs || dnaToProt[ds].to == seqDs)
+ {
+ return dnaToProt[ds];
+ }
+ }
+ return null;
+ }
+
+ /**
* Return the corresponding aligned or dataset aa sequence for given dna
* sequence, null if not found.
*