X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fanalysis%2FAlignmentUtils.java;h=42a1201e8bb0754ce382c92724d76edb3c78d62a;hb=7ae76399fefb94ffa0bd7c5e890bc5a17e457f66;hp=fa135f8be09f1af44cff09025ee6332ba6725b70;hpb=5aa038bdff10329d3b895dceb8d6f5161820a55c;p=jalview.git diff --git a/src/jalview/analysis/AlignmentUtils.java b/src/jalview/analysis/AlignmentUtils.java index fa135f8..42a1201 100644 --- a/src/jalview/analysis/AlignmentUtils.java +++ b/src/jalview/analysis/AlignmentUtils.java @@ -20,6 +20,8 @@ */ package jalview.analysis; +import static jalview.io.gff.GffConstants.CLINICAL_SIGNIFICANCE; + import jalview.datamodel.AlignedCodon; import jalview.datamodel.AlignedCodonFrame; import jalview.datamodel.Alignment; @@ -69,7 +71,6 @@ public class AlignmentUtils private static final String SEQUENCE_VARIANT = "sequence_variant:"; private static final String ID = "ID"; - private static final String CLINICAL_SIGNIFICANCE = "clinical_significance"; /** * A data model to hold the 'normal' base value at a position, and an optional @@ -1927,10 +1928,11 @@ public class AlignmentUtils if (trans != null && !trans.equals(residue)) { String desc = residue + "->" + trans; - // set score to 0f so 'graduated colour' option is offered! + // set score to 0f so 'graduated colour' option is offered! JAL-2060 SequenceFeature sf = new SequenceFeature( SequenceOntologyI.SEQUENCE_VARIANT, desc, peptidePos, peptidePos, 0f, null); + StringBuilder attributes = new StringBuilder(32); String id = (String) var.variant.getValue(ID); if (id != null) { @@ -1939,6 +1941,7 @@ public class AlignmentUtils id = id.substring(SEQUENCE_VARIANT.length()); } sf.setValue(ID, id); + attributes.append(ID).append("=").append(id); // TODO handle other species variants StringBuilder link = new StringBuilder(32); try @@ -1957,8 +1960,14 @@ public class AlignmentUtils if (clinSig != null) { sf.setValue(CLINICAL_SIGNIFICANCE, clinSig); + attributes.append(";").append(CLINICAL_SIGNIFICANCE).append("=") + .append(clinSig); } peptide.addSequenceFeature(sf); + if (attributes.length() > 0) + { + sf.setAttributes(attributes.toString()); + } return true; } return false;