{
for (String base : alleles.split(","))
{
- if (!base1.equals(base))
+ if (!base1.equalsIgnoreCase(base))
{
- String codon = base + base2 + base3;
+ String codon = base.toUpperCase() + base2.toLowerCase()
+ + base3.toLowerCase();
+ String canonical = base1.toUpperCase() + base2.toLowerCase()
+ + base3.toLowerCase();
if (addPeptideVariant(peptide, peptidePos, residue, var,
- codon))
+ codon, canonical))
{
count++;
}
{
for (String base : alleles.split(","))
{
- if (!base2.equals(base))
+ if (!base2.equalsIgnoreCase(base))
{
- String codon = base1 + base + base3;
+ String codon = base1.toLowerCase() + base.toUpperCase()
+ + base3.toLowerCase();
+ String canonical = base1.toLowerCase() + base2.toUpperCase()
+ + base3.toLowerCase();
if (addPeptideVariant(peptide, peptidePos, residue, var,
- codon))
+ codon, canonical))
{
count++;
}
{
for (String base : alleles.split(","))
{
- if (!base3.equals(base))
+ if (!base3.equalsIgnoreCase(base))
{
- String codon = base1 + base2 + base;
+ String codon = base1.toLowerCase() + base2.toLowerCase()
+ + base.toUpperCase();
+ String canonical = base1.toLowerCase() + base2.toLowerCase()
+ + base3.toUpperCase();
if (addPeptideVariant(peptide, peptidePos, residue, var,
- codon))
+ codon, canonical))
{
count++;
}
}
/**
- * Helper method that adds a peptide variant feature, provided the given codon
- * translates to a value different to the current residue (is a non-synonymous
- * variant). ID and clinical_significance attributes of the dna variant (if
- * present) are copied to the new feature.
+ * Helper method that adds a peptide variant feature. ID and
+ * clinical_significance attributes of the dna variant (if present) are copied
+ * to the new feature.
*
* @param peptide
* @param peptidePos
* @param residue
* @param var
* @param codon
+ * the variant codon e.g. aCg
+ * @param canonical
+ * the 'normal' codon e.g. aTg
* @return true if a feature was added, else false
*/
static boolean addPeptideVariant(SequenceI peptide, int peptidePos,
- String residue, DnaVariant var, String codon)
+ String residue, DnaVariant var, String codon, String canonical)
{
/*
* get peptide translation of codon e.g. GAT -> D
{
return false;
}
- String desc = codon;
+ String desc = canonical + "/" + codon;
String featureType = "";
if (trans.equals(residue))
{
assertEquals(1, sf.getBegin());
assertEquals(1, sf.getEnd());
assertEquals("stop_gained", sf.getType());
- assertEquals("TAA", sf.getDescription());
+ assertEquals("Aaa/Taa", sf.getDescription());
assertEquals("var3", sf.getValue("ID"));
assertEquals("Bad", sf.getValue("clinical_significance"));
assertEquals("ID=var3;clinical_significance=Bad", sf.getAttributes());
assertEquals(1, sf.links.size());
assertEquals(
- "TAA var3|http://www.ensembl.org/Homo_sapiens/Variation/Summary?v=var3",
+ "Aaa/Taa var3|http://www.ensembl.org/Homo_sapiens/Variation/Summary?v=var3",
sf.links.get(0));
assertEquals(dbSnp, sf.getFeatureGroup());
assertEquals(1, sf.getBegin());
assertEquals(1, sf.getEnd());
assertEquals("synonymous_variant", sf.getType());
- assertEquals("AAG", sf.getDescription());
+ assertEquals("aaA/aaG", sf.getDescription());
assertEquals("var4", sf.getValue("ID"));
assertEquals("None", sf.getValue("clinical_significance"));
assertEquals("ID=var4;clinical_significance=None", sf.getAttributes());
assertEquals(1, sf.links.size());
assertEquals(
- "AAG var4|http://www.ensembl.org/Homo_sapiens/Variation/Summary?v=var4",
+ "aaA/aaG var4|http://www.ensembl.org/Homo_sapiens/Variation/Summary?v=var4",
sf.links.get(0));
assertEquals(cosmic, sf.getFeatureGroup());
assertEquals(2, sf.getBegin());
assertEquals(2, sf.getEnd());
assertEquals("synonymous_variant", sf.getType());
- assertEquals("TTC", sf.getDescription());
+ assertEquals("ttT/ttC", sf.getDescription());
assertEquals("var6", sf.getValue("ID"));
assertNull(sf.getValue("clinical_significance"));
assertEquals("ID=var6", sf.getAttributes());
assertEquals(1, sf.links.size());
assertEquals(
- "TTC var6|http://www.ensembl.org/Homo_sapiens/Variation/Summary?v=var6",
+ "ttT/ttC var6|http://www.ensembl.org/Homo_sapiens/Variation/Summary?v=var6",
sf.links.get(0));
assertEquals(dbSnp, sf.getFeatureGroup());