- StringBuffer name = new StringBuffer(">UniProt/Swiss-Prot");
- Enumeration en2 = entry.getAccession().elements();
- while (en2.hasMoreElements())
- {
- name.append("|");
- name.append(en2.nextElement());
- }
- en2 = entry.getName().elements();
- while (en2.hasMoreElements())
- {
- name.append("|");
- name.append(en2.nextElement());
- }
+ /*
+ * create features; they have either begin and end, or position, in XML
+ */
+ sequence.setPDBId(pdbRefs);
+ if (entry.getFeature() != null)
+ {
+ for (FeatureType uf : entry.getFeature())
+ {
+ LocationType location = uf.getLocation();
+ int start = 0;
+ int end = 0;
+ if (location.getPosition() != null)
+ {
+ start = location.getPosition().getPosition().intValue();
+ end = start;
+ }
+ else
+ {
+ start = location.getBegin().getPosition().intValue();
+ end = location.getEnd().getPosition().intValue();
+ }
+ SequenceFeature sf = new SequenceFeature(uf.getType(),
+ getDescription(uf), start, end, "Uniprot");
+ sf.setStatus(uf.getStatus());
+ sequence.addSequenceFeature(sf);
+ }
+ }
+ for (DBRefEntry dbr : dbRefs)
+ {
+ sequence.addDBRef(dbr);
+ }
+ return sequence;
+ }
+
+ /**
+ * A helper method that builds a sequence feature description
+ *
+ * @param feature
+ * @return
+ */
+ static String getDescription(FeatureType feature)
+ {
+ String orig = feature.getOriginal();
+ List<String> variants = feature.getVariation();
+ StringBuilder sb = new StringBuilder();