Merge branch 'develop' of https://source.jalview.org/git/jalview into develop
authorCharles Ofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 26 Nov 2014 15:53:21 +0000 (15:53 +0000)
committerCharles Ofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 26 Nov 2014 15:53:21 +0000 (15:53 +0000)
.classpath
src/MCview/PDBChain.java
src/MCview/PDBfile.java
src/jalview/ext/jmol/PDBFileWithJmol.java
src/jalview/gui/AlignViewport.java
src/jalview/gui/AnnotationLabels.java
src/jalview/gui/SeqCanvas.java
src/jalview/io/RnamlFile.java

index 4c39421..114ee10 100644 (file)
@@ -54,6 +54,5 @@
        <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
        <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Plugin.jar"/>
-       <classpathentry kind="lib" path="lib/jfreesvg-2.1.jar"/>
        <classpathentry kind="output" path="classes"/>
 </classpath>
index e8f1bc9..408108b 100755 (executable)
@@ -392,8 +392,8 @@ public class PDBChain
       }
 
       AlignmentAnnotation tfactorann = new AlignmentAnnotation(
-              "PDB.TempFactor", "Temperature Factor for "
-                      + sequence.getName(), annots, 0, max,
+              "Temperature Factor", "Temperature Factor for " + pdbid + id,
+              annots, 0, max,
               AlignmentAnnotation.LINE_GRAPH);
       tfactorann.setSequenceRef(sequence);
       sequence.addAlignmentAnnotation(tfactorann);
@@ -552,34 +552,37 @@ public class PDBChain
         }
       }
       }
-      float min = -1, max = 0;
-      Annotation[] an = new Annotation[sq.getEnd() - sq.getStart() + 1];
-      for (int i = sq.getStart(), j = sq.getEnd(), k = 0; i <= j; i++, k++)
+      if (false)
       {
-        int prn = mapping.getPDBResNum(k + 1);
-
-        an[k] = new Annotation(prn);
-        if (min == -1)
+        // Useful for debugging mappings - adds annotation for mapped position
+        float min = -1, max = 0;
+        Annotation[] an = new Annotation[sq.getEnd() - sq.getStart() + 1];
+        for (int i = sq.getStart(), j = sq.getEnd(), k = 0; i <= j; i++, k++)
         {
-          min = k;
-          max = k;
-        }
-        else
-        {
-          if (min > k)
+          int prn = mapping.getPDBResNum(k + 1);
+
+          an[k] = new Annotation(prn);
+          if (min == -1)
           {
             min = k;
+            max = k;
           }
-          else if (max < k)
+          else
           {
-            max = k;
+            if (min > k)
+            {
+              min = k;
+            }
+            else if (max < k)
+            {
+              max = k;
+            }
           }
         }
+        sq.addAlignmentAnnotation(new AlignmentAnnotation("PDB.RESNUM",
+                "PDB Residue Numbering for " + this.pdbid + ":" + this.id,
+                an, min, max, AlignmentAnnotation.LINE_GRAPH));
       }
-      sq.addAlignmentAnnotation(new AlignmentAnnotation("PDB.RESNUM",
-              "PDB Residue Numbering for " + this.pdbid + ":" + this.id,
-              an, min, max, AlignmentAnnotation.LINE_GRAPH));
-
     }
   }
 }
index e1c4dc5..691fdcd 100755 (executable)
@@ -361,8 +361,8 @@ public class PDBfile extends jalview.io.AlignFile
           AlignmentI al, String pep, boolean b)
   {
     List<List<? extends Object>> replaced = AlignSeq
-            .replaceMatchingSeqsWith(seqs, annotations, prot, al,
-                    AlignSeq.PEP, false);
+            .replaceMatchingSeqsWith(seqs, annotations, prot, al, pep,
+                    false);
     for (PDBChain ch : chains)
     {
       int p = 0;
index 9fa6bf4..f5710d3 100644 (file)
@@ -186,9 +186,12 @@ public class PDBFileWithJmol extends AlignFile implements
                   seqs.add(sq);
                   if (!isNa)
                   {
+                    String mt = model.getModelTitle() == null ? getDataName()
+                            : model.getModelTitle();
+                    mt += _lastChainId;
                     AlignmentAnnotation ann = new AlignmentAnnotation(
                             "Secondary Structure",
-                            "Secondary Structure from PDB File", asecstr);
+                            "Secondary Structure for " + mt, asecstr);
                     ann.belowAlignment=true;
                     ann.visible=true;
                     ann.autoCalculated=false;
index 0b3fa70..632d2b2 100644 (file)
@@ -43,9 +43,7 @@ import jalview.analysis.NJTree;
 import jalview.api.AlignViewportI;
 import jalview.bin.Cache;
 import jalview.commands.CommandI;
-import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
-import jalview.datamodel.Annotation;
 import jalview.datamodel.ColumnSelection;
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.Sequence;
@@ -338,10 +336,6 @@ public class AlignViewport extends AlignmentViewport implements
               false);
       showGroupConsensus = Cache.getDefault("SHOW_GROUP_CONSENSUS", false);
       showConsensus = Cache.getDefault("SHOW_IDENTITY", true);
-      consensus = new AlignmentAnnotation("Consensus", "PID",
-              new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
-      consensus.hasText = true;
-      consensus.autoCalculated = true;
     }
     initAutoAnnotation();
     if (jalview.bin.Cache.getProperty("DEFAULT_COLOUR") != null)
index ad6f9e5..6e8417f 100755 (executable)
@@ -478,20 +478,29 @@ public class AnnotationLabels extends JPanel implements MouseListener,
         {
           desc.append("<br/>");
         }
-
+        // if (aa.hasProperties())
+        // {
+        // desc.append("<table>");
+        // for (String prop : aa.getProperties())
+        // {
+        // desc.append("<tr><td>" + prop + "</td><td>"
+        // + aa.getProperty(prop) + "</td><tr>");
+        // }
+        // desc.append("</table>");
+        // }
       }
       else
       {
         // begin the tooltip's html fragment
         desc.append("<html>");
+        if (aa.hasScore())
+        {
+          // TODO: limit precision of score to avoid noise from imprecise
+          // doubles
+          // (64.7 becomes 64.7+/some tiny value).
+          desc.append(" Score: " + aa.score);
+        }
       }
-      if (aa.hasScore())
-      {
-        // TODO: limit precision of score to avoid noise from imprecise doubles
-        // (64.7 becomes 64.7+/some tiny value).
-        desc.append(" Score: " + aa.score);
-      }
-
       if (desc.length() > 6)
       {
         desc.append("</html>");
@@ -502,7 +511,6 @@ public class AnnotationLabels extends JPanel implements MouseListener,
         this.setToolTipText(null);
       }
     }
-
   }
 
   /**
index d5b81f1..d73ee70 100755 (executable)
  */
 package jalview.gui;
 
-import java.awt.*;
-import java.awt.image.*;
-import javax.swing.*;
-
-import jalview.datamodel.*;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.SearchResults;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+
+import java.awt.BasicStroke;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.Shape;
+import java.awt.image.BufferedImage;
+
+import javax.swing.JComponent;
 
 /**
  * DOCUMENT ME!
@@ -247,16 +258,11 @@ public class SeqCanvas extends JComponent
    */
   public void fastPaint(int horizontal, int vertical)
   {
-    if (fastpainting)
+    if (fastpainting || gg == null)
     {
       return;
     }
     fastpainting = true;
-    if (gg == null)
-    {
-      return;
-    }
-
     fastPaint = true;
 
     gg.copyArea(horizontal * av.charWidth, vertical * av.charHeight,
@@ -575,7 +581,7 @@ public class SeqCanvas extends JComponent
           annotations = new AnnotationPanel(av);
         }
 
-        annotations.renderer.drawComponent(annotations, av, (Graphics2D) g,
+        annotations.renderer.drawComponent(annotations, av, g,
                 -1, startRes, endx + 1);
         g.translate(0, -cHeight - ypos - 3);
       }
@@ -763,7 +769,7 @@ public class SeqCanvas extends JComponent
 
     if ((group == null) && (av.getAlignment().getGroups().size() > 0))
     {
-      group = (SequenceGroup) av.getAlignment().getGroups().get(0);
+      group = av.getAlignment().getGroups().get(0);
       groupIndex = 0;
     }
 
@@ -924,7 +930,7 @@ public class SeqCanvas extends JComponent
           break;
         }
 
-        group = (SequenceGroup) av.getAlignment().getGroups()
+        group = av.getAlignment().getGroups()
                 .get(groupIndex);
 
       } while (groupIndex < av.getAlignment().getGroups().size());
index 9f0c8d5..c075fda 100644 (file)
@@ -167,8 +167,11 @@ public class RnamlFile extends AlignFile
                         annot[k]).charAt(0), 0f);
       }
 
-      AlignmentAnnotation align = new AlignmentAnnotation("Sec. str.",
-              current.getID(), ann);
+      AlignmentAnnotation align = new AlignmentAnnotation(
+              "Secondary Structure",
+              current.getID().trim().length() > 0 ? "Secondary Structure for "
+                      + current.getID()
+                      : "", ann);
 
       seqs[i].addAlignmentAnnotation(align);
       seqs[i].setRNA(result.get(i));