*/
package jalview.analysis;
+import static jalview.io.gff.GffConstants.CLINICAL_SIGNIFICANCE;
+
import jalview.datamodel.AlignedCodon;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.Alignment;
import jalview.util.Comparison;
import jalview.util.MapList;
import jalview.util.MappingUtils;
+import jalview.util.StringUtils;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
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
.codonTranslate(codon));
if (trans != null && !trans.equals(residue))
{
- String desc = residue + "->" + trans;
- // set score to 0f so 'graduated colour' option is offered!
+ 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)
{
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
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;