X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignment.java;h=95f578051e5b41c685feb674b683b077c3df8317;hb=85299bc2db43c8b108169661ebc1c4d9b2d3d2e5;hp=514a32662fdf2318a146249c0c9346daf7e01c0f;hpb=80b889f0cca49103e1b20ed806755a0719789906;p=jalview.git diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 514a326..95f5780 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(this,al); } /** @@ -2057,7 +2063,7 @@ public class Alignment implements AlignmentI, AutoCloseable if (cm == null && _aa.sequenceRef != null) { cm = _aa.sequenceRef.getContactMatrixFor(_aa); - if (cm == 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) {