git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-845 only 'follow' sort command in coding complement alignment
[jalview.git]
/
src
/
jalview
/
util
/
MappingUtils.java
diff --git
a/src/jalview/util/MappingUtils.java
b/src/jalview/util/MappingUtils.java
index
4aed258
..
df21355
100644
(file)
--- a/
src/jalview/util/MappingUtils.java
+++ b/
src/jalview/util/MappingUtils.java
@@
-413,18
+413,18
@@
public final class MappingUtils
SequenceI[] sortOrder = command.getSequenceOrder(undo);
List<SequenceI> mappedOrder = new ArrayList<SequenceI>();
int j = 0;
SequenceI[] sortOrder = command.getSequenceOrder(undo);
List<SequenceI> mappedOrder = new ArrayList<SequenceI>();
int j = 0;
+
+ /*
+ * Assumption: we are only interested in a cDNA/protein mapping; refactor in
+ * future if we want to support sorting (c)dna as (c)dna or protein as
+ * protein
+ */
+ boolean mappingToNucleotide = mapTo.isNucleotide();
for (SequenceI seq : sortOrder)
{
for (AlignedCodonFrame acf : mappings)
{
for (SequenceI seq : sortOrder)
{
for (AlignedCodonFrame acf : mappings)
{
- /*
- * Try protein-to-Dna, failing that try dna-to-protein
- */
- SequenceI mappedSeq = acf.getDnaForAaSeq(seq);
- if (mappedSeq == null)
- {
- mappedSeq = acf.getAaForDnaSeq(seq);
- }
+ SequenceI mappedSeq = mappingToNucleotide ? acf.getDnaForAaSeq(seq) : acf.getAaForDnaSeq(seq);
if (mappedSeq != null)
{
for (SequenceI seq2 : mapTo.getSequences())
if (mappedSeq != null)
{
for (SequenceI seq2 : mapTo.getSequences())