+ /**
+ * Constructs a feature description from the description and (optionally)
+ * original and variant fields of the Uniprot XML feature
+ *
+ * @param uf
+ * @return
+ */
+ protected static String getDescription(UniprotFeature uf)
+ {
+ String orig = uf.getOriginal();
+ String var = uf.getVariation();
+ StringBuilder sb = new StringBuilder();
+
+ /*
+ * append variant in standard format if present
+ * e.g. p.Arg59Lys
+ */
+ if (orig != null && !orig.isEmpty() && var != null && !var.isEmpty())
+ {
+ sb.append("p.");
+ String orig3 = ResidueProperties.aa2Triplet.get(orig);
+ sb.append(orig3 == null ? orig : StringUtils.toSentenceCase(orig3));
+ sb.append(Integer.toString(uf.getPosition()));
+ String var3 = ResidueProperties.aa2Triplet.get(var);
+ sb.append(var3 == null ? var : StringUtils.toSentenceCase(var3));
+ sb.append(" ");
+ }
+
+ String description = uf.getDescription();
+ if (description != null)
+ {
+ sb.append(description);
+ }
+
+ return sb.toString();
+ }
+
+ /**
+ *
+ * @param entry
+ * UniportEntry
+ * @return protein name(s) delimited by a white space character
+ */
+ public static String getUniprotEntryDescription(UniprotEntry entry)
+ {
+ StringBuilder desc = new StringBuilder(32);
+ if (entry.getProtein() != null && entry.getProtein().getName() != null)
+ {
+ boolean first = true;
+ for (String nm : entry.getProtein().getName())