blc header lines inserted as 'comment' alignment property
authorjprocter <Jim Procter>
Fri, 27 Apr 2007 12:24:09 +0000 (12:24 +0000)
committerjprocter <Jim Procter>
Fri, 27 Apr 2007 12:24:09 +0000 (12:24 +0000)
src/jalview/io/BLCFile.java

index 8f91aa2..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 {
@@ -124,6 +126,11 @@ extends AlignFile
 
           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);
+    }
   }
 
   /**