Modified to compile applet with Jmol jar present
[jalview.git] / src / MCview / PDBChain.java
index dc3743e..76a0cde 100755 (executable)
@@ -65,7 +65,7 @@ public class PDBChain
     return tmp;
   }
 
-  void makeExactMapping(AlignSeq as, Sequence s1)
+  public void makeExactMapping(AlignSeq as, SequenceI s1)
   {
     int pdbpos = as.getSeq2Start() - 2;
     int alignpos = s1.getStart() + as.getSeq1Start() - 3;
@@ -104,13 +104,13 @@ public class PDBChain
   public SequenceFeature[] transferRESNUMFeatures(SequenceI seq, String status)
   {
     SequenceI sq = seq;
-    while (sq != null)
+    while (sq!=null && sq.getDatasetSequence()!=null)
     {
+      sq = sq.getDatasetSequence();
       if (sq == sequence)
       {
         return null;
       }
-      sq = sq.getDatasetSequence();
     }
     /**
      * Remove any existing features for this chain if they exist ?
@@ -138,7 +138,8 @@ public class PDBChain
         tx.setStatus(status +
                      ( (tx.getStatus() == null || tx.getStatus().length() == 0) ?
                       "" : ":" + tx.getStatus()));
-        seq.addSequenceFeature(tx);
+        if (tx.begin!=0 && tx.end!=0)
+          sq.addSequenceFeature(tx);
       }
     }
     return features;
@@ -252,9 +253,9 @@ public class PDBChain
       count++;
     }
 
-    if (id.length() < 1 || id.equals(" "))
+    if (id.length() < 1)
     {
-      id = "_";
+      id = " ";
     }
 
     sequence = new Sequence(id, seq.toString(), offset, resNumber - 1); // Note: resNumber-offset ~= seq.size()