import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
-import jalview.gui.AlignViewport;
import java.util.ArrayList;
import java.util.HashMap;
}
/*
- * 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()]);
* @return
*/
public static ColumnSelection mapColumnSelection(ColumnSelection colsel,
- AlignViewportI mapFrom, AlignViewport mapTo)
+ AlignViewportI mapFrom, AlignViewportI mapTo)
{
boolean targetIsNucleotide = mapTo.isNucleotide();
AlignViewportI protein = targetIsNucleotide ? mapFrom : mapTo;
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();
// 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++)
{