/*
* append variant in standard format if present
* e.g. p.Arg59Lys
+ * multiple variants are split over lines using <br>
*/
+ boolean asHtml = false;
if (orig != null && !orig.isEmpty() && variants != null
&& !variants.isEmpty())
{
}
if (++p != variants.size())
{
- sb.append("\n");
+ sb.append("<br/> ");
+ asHtml = true;
}
else
{
{
sb.append(description);
}
+ if (asHtml)
+ {
+ sb.insert(0, "<html>");
+ sb.append("</html>");
+ }
return sb.toString();
}
assertEquals(42, sf.getBegin());
assertEquals(42, sf.getEnd());
Assert.assertEquals(Uniprot.getDescription(sf),
- "p.Met42Leu" + "\n" + "p.Met42LeuMetVal Foo");
+ "<html>p.Met42Leu" + "<br/> "
+ + "p.Met42LeuMetVal Foo</html>");
sf = features.get(7);
assertEquals(42, sf.getBegin());
assertEquals(43, sf.getEnd());
Assert.assertEquals(Uniprot.getDescription(sf),
- "p.MetLeu42LeuLeu" + "\n" + "p.MetLeu42LeuMetVal Foo");
+ "<html>p.MetLeu42LeuLeu" + "<br/> "
+ + "p.MetLeu42LeuMetVal Foo</html>");
sf = features.get(8);
assertEquals(42, sf.getBegin());
assertEquals(45, sf.getEnd());
Assert.assertEquals(Uniprot.getDescription(sf),
- "p.MLML42LeuLeu" + "\n" + "p.MLML42LMVK Foo Too");
+ "<html>p.MLML42LeuLeu" + "<br/> "
+ + "p.MLML42LMVK Foo Too</html>");
/*
* Check cross-references
uf.setVariation(vars);
assertEquals("p.Lys23Tyr Hello", Uniprot.getDescription(uf));
+ // multiple variants generate an html description over more than one line
vars.add("W");
- assertEquals("p.Lys23Tyr\np.Lys23Trp Hello",
+ assertEquals("<html>p.Lys23Tyr<br/> p.Lys23Trp Hello</html>",
Uniprot.getDescription(uf));
/*