X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2FMappingUtils.java;h=1f2e8dbd26633ed7baa6aa5e15544a47aca57f43;hb=49ff786d8e7d016cac6895539e6fb0eac8aae95c;hp=6dfebfec2c27eac02246a5d2fe27e3f43e814e75;hpb=23635fe385da9ea48690349c0530739121600a00;p=jalview.git diff --git a/src/jalview/util/MappingUtils.java b/src/jalview/util/MappingUtils.java index 6dfebfe..1f2e8db 100644 --- a/src/jalview/util/MappingUtils.java +++ b/src/jalview/util/MappingUtils.java @@ -16,7 +16,6 @@ import jalview.datamodel.SearchResults.Match; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; -import jalview.gui.AlignViewport; import java.util.ArrayList; import java.util.HashMap; @@ -384,8 +383,8 @@ public final class MappingUtils } /* - * Have to align the sequences before constructing the OrderCommand - which - * then realigns them?!? + * Have to sort the sequences before constructing the OrderCommand - which + * then resorts them?!? */ final SequenceI[] mappedOrderArray = mappedOrder .toArray(new SequenceI[mappedOrder.size()]); @@ -407,7 +406,7 @@ public final class MappingUtils * @return */ public static ColumnSelection mapColumnSelection(ColumnSelection colsel, - AlignViewportI mapFrom, AlignViewport mapTo) + AlignViewportI mapFrom, AlignViewportI mapTo) { boolean targetIsNucleotide = mapTo.isNucleotide(); AlignViewportI protein = targetIsNucleotide ? mapFrom : mapTo; @@ -416,6 +415,12 @@ public final class MappingUtils ColumnSelection mappedColumns = new ColumnSelection(); char fromGapChar = mapFrom.getAlignment().getGapCharacter(); + // FIXME allow for hidden columns + + /* + * For each mapped column, find the range of columns that residues in that + * column map to. + */ for (Object obj : colsel.getSelected()) { int col = ((Integer) obj).intValue(); @@ -462,13 +467,15 @@ public final class MappingUtils // System.out.println(fromSeq.getName() + " mapped to cols " // + mappedStartCol + ":" + mappedEndCol); break; - // TODO remove break if we ever want to map one to many sequences + // note: remove break if we ever want to map one to many sequences } } } } /* - * Add mapped columns to mapped selection (converting base 1 to base 0) + * Add the range of mapped columns to the mapped selection (converting + * base 1 to base 0). Note that this may include intron-only regions which + * lie between the start and end ranges of the selection. */ for (int i = mappedToMin; i <= mappedToMax; i++) {