SequenceI uniprotEntryToSequence(Entry entry)
{
String id = getUniprotEntryId(entry);
- String seqString = entry.getSequence().getValue();
-
/*
- * for backwards compatibility with Castor processing,
- * remove any internal spaces
+ * Sequence should not include any whitespace, but JAXB leaves these in
*/
- if (seqString.indexOf(' ') > -1)
- {
- seqString = seqString.replace(" ", "");
- }
+ String seqString = entry.getSequence().getValue().replaceAll("\\s*",
+ "");
+
SequenceI sequence = new Sequence(id,
seqString);
sequence.setDescription(getUniprotEntryDescription(entry));
SequenceI seq = new Uniprot().uniprotEntryToSequence(entry);
assertNotNull(seq);
assertEquals(6, seq.getDBRefs().length); // 2*Uniprot, PDB, PDBsum, 2*EMBL
+ assertEquals(seq.getSequenceAsString(),
+ seq.createDatasetSequence().getSequenceAsString());
}