X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2FMappingUtils.java;h=da83338d06d8f33bb6ceaccdd7c7ad89f072bff3;hb=c73c8c28e34bdcac21e89aa89b69e85dad9e0189;hp=515ff51f7795babb6408bc5f044c2af936dc93b7;hpb=81dc9ebd9bd93355897a9c5c87733c0bdb3e5f3b;p=jalview.git diff --git a/src/jalview/util/MappingUtils.java b/src/jalview/util/MappingUtils.java index 515ff51..da83338 100644 --- a/src/jalview/util/MappingUtils.java +++ b/src/jalview/util/MappingUtils.java @@ -757,9 +757,19 @@ public final class MappingUtils return findMappingsForSequenceAndOthers(sequence, mappings, null); } + /** + * Returns a list of any mappings that are from or to the given (aligned or + * dataset) sequence, optionally limited to mappings involving one of a given + * list of sequences. + * + * @param sequence + * @param mappings + * @param filterList + * @return + */ public static List findMappingsForSequenceAndOthers( SequenceI sequence, List mappings, - AlignmentI alignment) + List filterList) { List result = new ArrayList(); if (sequence == null || mappings == null) @@ -770,14 +780,14 @@ public final class MappingUtils { if (mapping.involvesSequence(sequence)) { - if (alignment != null) + if (filterList != null) { - for (SequenceI otherseq : alignment.getSequences()) + for (SequenceI otherseq : filterList) { + SequenceI otherDataset = otherseq.getDatasetSequence(); if (otherseq == sequence - || (otherseq.getDatasetSequence() != null && (otherseq - .getDatasetSequence() == sequence || otherseq - .getDatasetSequence() == sequence + || otherseq == sequence.getDatasetSequence() + || (otherDataset != null && (otherDataset == sequence || otherDataset == sequence .getDatasetSequence()))) { // skip sequences in subset which directly relate to sequence