JAL-3700 JAL-3748 JAL-3763 don’t add stop codon via alignAs if guide peptide doesn...
authorJim Procter <jprocter@issues.jalview.org>
Tue, 27 Oct 2020 10:54:58 +0000 (10:54 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Tue, 27 Oct 2020 13:02:59 +0000 (13:02 +0000)
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(