Merge branch 'develop' into features/JAL-2094_colourInterface
[jalview.git] / src / MCview / PDBChain.java
index e048cd6..67ff286 100755 (executable)
@@ -31,8 +31,8 @@ import jalview.datamodel.SequenceI;
 import jalview.schemes.Colour;
 import jalview.schemes.ColourSchemeI;
 import jalview.schemes.ResidueProperties;
+import jalview.structure.StructureImportSettings;
 import jalview.structure.StructureMapping;
-import jalview.structure.StructureViewSettings;
 
 import java.awt.Color;
 import java.util.List;
@@ -84,7 +84,7 @@ public class PDBChain
 
   public PDBChain(String pdbid, String id)
   {
-    this.pdbid = pdbid.toLowerCase();
+    this.pdbid = pdbid == null ? pdbid : pdbid.toLowerCase();
     this.id = id;
   }
 
@@ -359,18 +359,6 @@ public class PDBChain
       else
       {
 
-        // boolean baseDetected = false;
-        // for (Atom resAtom : resAtoms)
-        // {
-        // if (resAtom.insCode == ' ')
-        // {
-        // baseDetected = true;
-        // }
-        // }
-        // if (!baseDetected)
-        // {
-        // continue;
-        // }
       // Make a new Residue object with the new atoms vector
       residues.addElement(new Residue(resAtoms, resNumber - 1, count));
 
@@ -380,7 +368,6 @@ public class PDBChain
         SequenceFeature sf = new SequenceFeature("RESNUM", tmpat.resName
               + ":" + tmpat.resNumIns + " " + pdbid + id, "", offset
               + count, offset + count, pdbid);
-      // MCview.PDBChain.PDBFILEFEATURE);
       resFeatures.addElement(sf);
       resAnnotation.addElement(new Annotation(tmpat.tfactor));
       // Keep totting up the sequence
@@ -438,7 +425,7 @@ public class PDBChain
     // System.out.println("PDB Sequence is :\nSequence = " + seq);
     // System.out.println("No of residues = " + residues.size());
 
-    if (StructureViewSettings.isShowSeqFeatures())
+    if (StructureImportSettings.isShowSeqFeatures())
     {
     for (i = 0, iSize = resFeatures.size(); i < iSize; i++)
     {
@@ -599,12 +586,13 @@ public class PDBChain
         {
           for (AlignmentAnnotation ana : sequence.getAnnotation())
           {
-            List<AlignmentAnnotation> transfer = sq
+            List<AlignmentAnnotation> transfer = dsq
                     .getAlignmentAnnotations(ana.getCalcId(), ana.label);
             if (transfer == null || transfer.size() == 0)
             {
               ana = new AlignmentAnnotation(ana);
               ana.liftOver(dsq, sqmpping);
+              dsq.addAlignmentAnnotation(ana);
               // mapping.transfer(ana);
             }
             else