X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FAlignmentUtils.java;h=081f446f0dcbd13ca7676ec949be1a16d27ff918;hb=6b8f46dd2ffc7f73948f0523c9b45336d2bd8128;hp=42a1201e8bb0754ce382c92724d76edb3c78d62a;hpb=7ae76399fefb94ffa0bd7c5e890bc5a17e457f66;p=jalview.git diff --git a/src/jalview/analysis/AlignmentUtils.java b/src/jalview/analysis/AlignmentUtils.java index 42a1201..081f446 100644 --- a/src/jalview/analysis/AlignmentUtils.java +++ b/src/jalview/analysis/AlignmentUtils.java @@ -40,6 +40,7 @@ import jalview.schemes.ResidueProperties; import jalview.util.Comparison; import jalview.util.MapList; import jalview.util.MappingUtils; +import jalview.util.StringUtils; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; @@ -1927,11 +1928,15 @@ public class AlignmentUtils .codonTranslate(codon)); if (trans != null && !trans.equals(residue)) { - String desc = residue + "->" + trans; + String residue3Char = StringUtils + .toSentenceCase(ResidueProperties.aa2Triplet.get(residue)); + String trans3Char = StringUtils + .toSentenceCase(ResidueProperties.aa2Triplet.get(trans)); + String desc = "p." + residue3Char + peptidePos + trans3Char; // set score to 0f so 'graduated colour' option is offered! JAL-2060 SequenceFeature sf = new SequenceFeature( SequenceOntologyI.SEQUENCE_VARIANT, desc, peptidePos, - peptidePos, 0f, null); + peptidePos, 0f, "Jalview"); StringBuilder attributes = new StringBuilder(32); String id = (String) var.variant.getValue(ID); if (id != null) @@ -2109,6 +2114,26 @@ public class AlignmentUtils { AlignmentI copy = new Alignment(new Alignment(seqs)); + /* + * add mappings between sequences to the new alignment + */ + AlignedCodonFrame mappings = new AlignedCodonFrame(); + copy.addCodonFrame(mappings); + for (int i = 0; i < copy.getHeight(); i++) + { + SequenceI from = seqs[i]; + SequenceI to = copy.getSequenceAt(i); + if (to.getDatasetSequence() != null) + { + to = to.getDatasetSequence(); + } + int start = from.getStart(); + int end = from.getEnd(); + MapList map = new MapList(new int[] { start, end }, new int[] { + start, end }, 1, 1); + mappings.addMap(to, from, map); + } + SequenceIdMatcher matcher = new SequenceIdMatcher(seqs); if (xrefs != null) {