Merge branch 'develop' into features/r2_11_2/JAL-3829_3dbeacons
[jalview.git] / src / jalview / ws / dbsources / Uniprot.java
index d1da9de..2fc5893 100644 (file)
@@ -180,16 +180,12 @@ public class Uniprot extends DbSourceProxyImpl
   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));
@@ -199,10 +195,12 @@ public class Uniprot extends DbSourceProxyImpl
      */
     final String dbVersion = getDbVersion();
     List<DBRefEntry> dbRefs = new ArrayList<>();
+    boolean canonical=true;
     for (String accessionId : entry.getAccession())
     {
       DBRefEntry dbRef = new DBRefEntry(DBRefSource.UNIPROT, dbVersion,
-              accessionId);
+              accessionId,null,canonical);
+      canonical=false;
       dbRefs.add(dbRef);
     }