crossrefs have properly updated pdbId lists
[jalview.git] / src / jalview / io / BLCFile.java
index f485a49..c40e125 100755 (executable)
@@ -81,6 +81,8 @@ extends AlignFile
   public void parse()
   throws IOException
   {
+    StringBuffer headerLines=new StringBuffer();
+    int numHeaderLines = 0; // number of lines appended.
     StringBuffer[] seqstrings=null;
     if (suffix!=null) {
       try {
@@ -117,13 +119,18 @@ extends AlignFile
           if (iterationCount>0 && !newids) {
             // we have a new set of IDs to record.
             newids = true;
-            seqs.clear(); 
+            seqs.removeAllElements(); 
           }
 
           line = line.substring(abracket + 1);
 
           Sequence seq = parseId(line);
           seqs.addElement(seq);
+        } else {
+          // header lines - keep them for the alignment comments.
+          headerLines.append(line);
+          headerLines.append("\n");
+          numHeaderLines++;
         }
       }
       while (!idsFound);
@@ -169,7 +176,12 @@ extends AlignFile
 
       newSeq.setSequence(seqstrings[i].toString());
     }
-
+    if (seqs.size()>0)
+    {
+      if (headerLines.length()>1+numHeaderLines) // could see if buffer is just whitespace or not. 
+        setAlignmentProperty("Comments", headerLines.toString());
+      setAlignmentProperty("iteration", ""+iterationCount);
+    }
   }
 
   /**