JAL-2113 remove spaces in sequence from unmarshalling newlines
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 23 May 2016 13:34:22 +0000 (14:34 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 23 May 2016 13:34:22 +0000 (14:34 +0100)
src/jalview/datamodel/xdb/embl/EmblSequence.java
test/jalview/datamodel/xdb/embl/EmblTestHelper.java

index 5a18929..92c424b 100644 (file)
@@ -43,6 +43,7 @@ public class EmblSequence
    */
   public void setSequence(String sequence)
   {
-    this.sequence = sequence;
+    // remove spaces introduced by unmarshalling of newline characters
+    this.sequence = sequence.replace(" ", "");
   }
 }
index 8f631df..71ca508 100644 (file)
@@ -17,7 +17,9 @@ public class EmblTestHelper
           + "<xref db=\"GOA\" id=\"P00340\" secondaryId=\"2.1\" /><xref db=\"InterPro\" id=\"IPR001236\" />"
           + "<qualifier name=\"note\"><value>L-lactate dehydrogenase A-chain</value><value>pickle</value></qualifier>"
           + "<qualifier name=\"translation\"><value>MSLKDHLIHN</value><evidence>Keith</evidence></qualifier>"
-          + "</feature>" + "<sequence>GTGACG</sequence></entry></ROOT>";
+          // emulate EMBL XML 1.2 which splits sequence data every 60 characters
+          // see EmblSequence.setSequence
+          + "</feature>" + "<sequence>GTG\nACG</sequence></entry></ROOT>";
 
   static EmblFile getEmblFile()
   {