X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignment.java;h=6532a2dbeb0d57724bc457dfbce176377a416fec;hb=b028e684c807365decd0c6e6111aa4bf368a6fa8;hp=cfd6aee05b6f61624b167b24dfa6c553f5368537;hpb=c1d8867e99833bcb9019aaebddfabb99dd852f66;p=jalview.git diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index cfd6aee..6532a2d 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -1830,7 +1830,13 @@ public class Alignment implements AlignmentI, AutoCloseable { return AlignmentUtils.alignCdsAsProtein(this, al); } - return AlignmentUtils.alignAs(this, al); + else if (thatIsProtein && !thisIsNucleotide) + { + // honour sense we were called - align this according to al + return AlignmentUtils.alignAs(this, al); + } + // otherwise doing a DNA to DNA alignment - so use legacy obverse sense + return AlignmentUtils.alignAs(al, this); } /** @@ -2057,7 +2063,7 @@ public class Alignment implements AlignmentI, AutoCloseable if (cm == null && _aa.sequenceRef != null) { cm = _aa.sequenceRef.getContactMatrixFor(_aa); - if (cm == null && _aa.sequenceRef.getDatasetSequence()!=null) + if (cm == null && _aa.sequenceRef.getDatasetSequence() != null) { // TODO fix up this logic and unify with getContactListFor cm = _aa.sequenceRef.getDatasetSequence().getContactMatrixFor(_aa); @@ -2069,6 +2075,11 @@ public class Alignment implements AlignmentI, AutoCloseable @Override public ContactListI getContactListFor(AlignmentAnnotation _aa, int column) { + if (_aa.annotations == null || column >= _aa.annotations.length + || column < 0) + { + return null; + } ContactListI cl = cmholder.getContactListFor(_aa, column); if (cl == null && _aa.groupRef != null) {