int p = 0;
for (String var : variants)
{
+ // TODO proper HGVC nomenclature for delins structural variations
sb.append("p.");
- String orig3 = ResidueProperties.aa2Triplet.get(orig);
- sb.append(orig3 == null ? orig : StringUtils.toSentenceCase(orig3));
+ for (int c = 0, clen = orig.length(); c < clen; c++)
+ {
+ char origchar = orig.charAt(c);
+ String orig3 = ResidueProperties.aa2Triplet.get("" + origchar);
+ sb.append(orig3 == null ? origchar
+ : StringUtils.toSentenceCase(orig3));
+ }
+
sb.append(Integer.toString(uf.getPosition()));
+
for (int c = 0, clen = var.length(); c < clen; c++)
{
char varchar = var.charAt(c);
}
if (++p != variants.size())
{
- sb.append("<br/>");
+ sb.append("\n");
}
else
{
+ "<feature type=\"sequence variant\" description=\"Pathogenic\"><original>M</original><variation>L</variation><location><position position=\"41\"/></location></feature>"
+ "<feature type=\"sequence variant\" description=\"Pathogenic\"><original>M</original><location><position position=\"41\"/></location></feature>"
+ "<feature type=\"sequence variant\" description=\"Foo\"><variation>L</variation><variation>LMV</variation><original>M</original><location><position position=\"42\"/></location></feature>"
+ + "<feature type=\"sequence variant\" description=\"Foo\"><variation>LL</variation><variation>LMV</variation><original>ML</original><location><begin position=\"42\"/><end position=\"43\"/></location></feature>"
+ "<sequence length=\"10\" mass=\"27410\" checksum=\"8CB760AACF88FE6C\" modified=\"2008-01-15\" version=\"1\">MHAPL VSKDL</sequence></entry>"
+ "</uniprot>";
* Check sequence features
*/
Vector<UniprotFeature> features = entry.getFeature();
- assertEquals(7, features.size());
+ assertEquals(8, features.size());
UniprotFeature sf = features.get(0);
assertEquals("signal peptide", sf.getType());
assertNull(sf.getDescription());
assertEquals(42, sf.getBegin());
assertEquals(42, sf.getEnd());
Assert.assertEquals(Uniprot.getDescription(sf),
- "p.Met42Leu<br/>p.Met42LeuMetVal Foo");
- /*
- * Check cross-references
- */
+ "p.Met42Leu" + "\n" + "p.Met42LeuMetVal Foo");
+
+ sf = features.get(7);
+ assertEquals(42, sf.getBegin());
+ assertEquals(43, sf.getEnd());
+ Assert.assertEquals(Uniprot.getDescription(sf),
+ "p.MetLeu42LeuLeu" + "\n" + "p.MetLeu42LeuMetVal Foo"); /*
+ * Check cross-references
+ */
Vector<PDBEntry> xrefs = entry.getDbReference();
assertEquals(3, xrefs.size());