adds annotation for display (with flag to set alignmentAnnotation as hidden initially)
authorjprocter <Jim Procter>
Fri, 20 Apr 2007 14:06:19 +0000 (14:06 +0000)
committerjprocter <Jim Procter>
Fri, 20 Apr 2007 14:06:19 +0000 (14:06 +0000)
src/MCview/PDBfile.java

index 6fdd978..227bcf7 100755 (executable)
@@ -31,6 +31,10 @@ public class PDBfile
   public Vector chains;
   public String id;
 
+  /**
+   * set to true to add chain alignment annotation as visible annotation.
+   */
+  boolean VisibleChainAnnotation=false;
   public PDBfile(String inFile, String inType)
       throws IOException
   {
@@ -128,7 +132,17 @@ public class PDBfile
           entry.setFile(inFile.getAbsolutePath());
         }
         dataset.addPDBId(entry);
-        getSeqs().addElement(dataset.deriveSequence()); // PDBChain objects maintain reference to dataset
+        SequenceI chainseq = dataset.deriveSequence(); // PDBChain objects maintain reference to dataset
+        seqs.addElement(chainseq);
+        AlignmentAnnotation[] chainannot = chainseq.getAnnotation();
+        if (chainannot!=null)
+        {
+          for (int ai=0; ai<chainannot.length; ai++)
+          {
+            chainannot[ai].visible=VisibleChainAnnotation;
+            annotations.addElement(chainannot[ai]);
+          }
+        }
       }
     }
     catch (OutOfMemoryError er)