JAL-3700 JAL-3748 JAL-3763 don’t add stop codon via alignAs if guide peptide doesn...
[jalview.git] / src / jalview / analysis / AlignmentUtils.java
index d8c1cdf..d04d810 100644 (file)
@@ -979,10 +979,10 @@ public class AlignmentUtils
                   .getFromRanges());
           int mappedToLength = MappingUtils
                   .getLength(mapList.getToRanges());
-          boolean addStopCodon = (cdsLength == mappedFromLength
+          boolean addStopCodon = peptide.getDatasetSequence().getEnd()==peptide.getEnd() && ((cdsLength == mappedFromLength
                   * CODON_LENGTH + CODON_LENGTH)
                   || (peptide.getDatasetSequence()
-                          .getLength() == mappedFromLength - 1);
+                          .getLength() == mappedFromLength - 1));
           if (cdsLength != mappedToLength && !addStopCodon)
           {
             System.err.println(String.format(