Action |
Windows |
@@ -162,7 +162,7 @@ be measured from it to any other atom in the structure.
Select all views
This is only enabled when Select many views is also enabled, and will add all associated views to the set used to colour the structure display.
Invert selection
This is only enabled when Select many views is also enabled, and will replace the current set of views with any remaining views not currently used to colour the structure display.
-
+
Colours
diff --git a/help/html/features/preferences.html b/help/html/features/preferences.html
index 1831c3e..b2d8b93 100755
--- a/help/html/features/preferences.html
+++ b/help/html/features/preferences.html
@@ -121,6 +121,8 @@ annotation will be shown on the alignment when available.
Add Temperature Factor annotation to alignment - if selected, PDB Temperature Factor
annotation will be shown on the alignment when available.
Default structure viewer - choose JMOL or CHIMERA for viewing 3D structures.
+
Path to Chimera program - Optional, as Jalview will search standard installation paths for Windows, Linux or MacOS.
+If you have installed Chimera in a non-standard location, you can specify it here. Enter the full path to the Chimera executable program.
"Connections"
Preferences tab
diff --git a/help/html/features/viewingpdbs.html b/help/html/features/viewingpdbs.html
index 1f49498..8fc557e 100755
--- a/help/html/features/viewingpdbs.html
+++ b/help/html/features/viewingpdbs.html
@@ -28,6 +28,9 @@
Jalview can view protein structures associated with a sequence
via the "Structure→" submenu from a
sequence's pop-up menu.
+A Jmol viewer has been included since Jalview 2.3. Jalview 2.8.2 added support for Chimera,
+provided this has been separately installed. Choice of default viewer is configurable in the Preferences Structure tab.
+
The following menu entries are provided for viewing structure data
- The "Structure→View
@@ -40,14 +43,13 @@ sequence's pop-up menu.
with the current selection, superposed according to the currently selected region of the alignment.
This
capability was added in Jalview 2.7
- - The "Structure→View all N
+
- The "Structure→View all N
representative structures
option will open a new window containing exactly one structure per
currently selected sequence.
The View representative structures option was introduced in
Jalview 2.8.1
-
If a single pdb
@@ -55,19 +57,19 @@ structure is selected, one of the following will happen:
- If no structures are open, then an interactive display of the
- structure will be opened in a new window
+ structure will be opened in a new window.
If another structure is already shown for the current
alignment, then you will be asked if you want to add and align this structure to the structure in
- the existing view. (new feature in Jalview 2.6)
+ the existing view. (new feature in Jalview 2.6).
If the structure is already shown, then you will be prompted
to associate the sequence with an existing view of the selected
structure. This is useful when working with multi-domain or multi-chain PDB files.
See the Jmol
- PDB viewer help page for more information about the display.
+ and Chimera PDB viewer help pages for more information about the display.
Associating PDB files with Sequences
To associate PDB files with a sequence, right click on a sequence
diff --git a/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java b/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java
index 7033ba7..090b61d 100644
--- a/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java
+++ b/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java
@@ -74,13 +74,14 @@ public abstract class JalviewChimeraBinding extends
private boolean loadingFromArchive = false;
/**
- * second flag to indicate if the jmol viewer should ignore sequence colouring
- * events from the structure manager because the GUI is still setting up
+ * second flag to indicate if the Chimera viewer should ignore sequence
+ * colouring events from the structure manager because the GUI is still
+ * setting up
*/
private boolean loadingFinished = true;
/**
- * state flag used to check if the Jmol viewer's paint method can be called
+ * state flag used to check if the Chimera viewer's paint method can be called
*/
private boolean finishedInit = false;
@@ -173,7 +174,7 @@ public abstract class JalviewChimeraBinding extends
} catch (Error e)
{
}
- // Explicitly map to the filename used by Jmol ;
+ // Explicitly map to the filename used by Chimera ;
// pdbentry[pe].getFile(), protocol);
if (ssm != null)
@@ -236,13 +237,6 @@ public abstract class JalviewChimeraBinding extends
}
viewer = new ChimeraManager(
csm = new ext.edu.ucsf.rbvi.strucviz2.StructureManager(true));
- /*
- * viewer = JmolViewer.allocateViewer(renderPanel, new SmarterJmolAdapter(),
- * "jalviewJmol", ap.av.applet .getDocumentBase(),
- * ap.av.applet.getCodeBase(), "", this);
- *
- * jmolpopup = JmolPopup.newJmolPopup(viewer, true, "Jmol", true);
- */
}
public JalviewChimeraBinding(StructureSelectionManager ssm,
@@ -335,15 +329,13 @@ public abstract class JalviewChimeraBinding extends
{
viewer.exitChimera();
}
- // viewer.evalStringQuiet("zap");
- // viewer.setJmolStatusListener(null);
lastCommand = null;
viewer = null;
releaseUIResources();
}
/**
- * called by JalviewJmolbinding after closeViewer is called - release any
+ * called by JalviewChimerabinding after closeViewer is called - release any
* resources and references so they can be garbage collected.
*/
protected abstract void releaseUIResources();
@@ -351,17 +343,16 @@ public abstract class JalviewChimeraBinding extends
public void colourByChain()
{
colourBySequence = false;
- // TODO: colour by chain should colour each chain distinctly across all
- // visible models
- // TODO: http://issues.jalview.org/browse/JAL-628
+ // this is not a valid Chimera command; is there one? Menu option hidden
evalStateCommand("select *;color chain",false);
}
public void colourByCharge()
{
colourBySequence = false;
- evalStateCommand("colour *;color white;select ASP,GLU;color red;"
- + "select LYS,ARG;color blue;select CYS;color yellow", false);
+ evalStateCommand(
+ "color white;color red ::ASP;color red ::GLU;color blue ::LYS;color blue ::ARG;color yellow ::CYS",
+ false);
}
/**
@@ -411,7 +402,7 @@ public abstract class JalviewChimeraBinding extends
assert (_alignment.length == _refStructure.length && _alignment.length != _hiddenCols.length);
StringBuilder allComs = new StringBuilder(128); // Chimera superposition cmd
String[] files = getPdbFile();
- // check to see if we are still waiting for Jmol files
+ // check to see if we are still waiting for Chimera files
long starttime = System.currentTimeMillis();
boolean waiting = true;
do
@@ -1225,10 +1216,13 @@ public abstract class JalviewChimeraBinding extends
String res;
int index;
Color col;
+ // Chimera expects RBG values in the range 0-1
+ final double normalise = 255D;
viewerCommandHistory(false);
// TODO: Switch between nucleotide or aa selection expressions
Enumeration en = ResidueProperties.aa3Hash.keys();
- StringBuffer command = new StringBuffer("select *;color white;");
+ StringBuilder command = new StringBuilder(128);
+ command.append("color white;");
while (en.hasMoreElements())
{
res = en.nextElement().toString();
@@ -1239,32 +1233,19 @@ public abstract class JalviewChimeraBinding extends
}
col = cs.findColour(ResidueProperties.aa[index].charAt(0));
- // TODO: need colour string function and res selection here
- command.append("select " + res + ";color[" + col.getRed() + ","
- + col.getGreen() + "," + col.getBlue() + "];");
+ command.append("color " + col.getRed() / normalise + ","
+ + col.getGreen() / normalise + "," + col.getBlue()
+ / normalise + " ::" + res + ";");
}
evalStateCommand(command.toString(),false);
viewerCommandHistory(true);
}
- public void showHelp()
- {
- // chimera help
- showUrl("http://jmol.sourceforge.net/docs/JmolUserGuide/", "jmolHelp");
- }
-
/**
- * open the URL somehow
- *
- * @param target
- */
- public abstract void showUrl(String url, String target);
-
- /**
- * called when the binding thinks the UI needs to be refreshed after a Jmol
+ * called when the binding thinks the UI needs to be refreshed after a Chimera
* state change. this could be because structures were loaded, or because an
- * error has occured.
+ * error has occurred.
*/
public abstract void refreshGUI();
@@ -1293,8 +1274,8 @@ public abstract class JalviewChimeraBinding extends
/**
*
- * @return true if Jmol is still restoring state or loading is still going on
- * (see setFinsihedLoadingFromArchive)
+ * @return true if Chimeral is still restoring state or loading is still going
+ * on (see setFinsihedLoadingFromArchive)
*/
public boolean isLoadingFromArchive()
{
@@ -1312,13 +1293,22 @@ public abstract class JalviewChimeraBinding extends
loadingFinished = finishedLoading;
}
- public void setBackgroundColour(java.awt.Color col)
+ /**
+ * Send the Chimera 'background solid " command.
+ *
+ * @see https
+ * ://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/midas/background
+ * .html
+ * @param col
+ */
+ public void setBackgroundColour(Color col)
{
viewerCommandHistory(false);
- // todo set background colour
- viewer.sendChimeraCommand(
- "background [" + col.getRed() + "," + col.getGreen() + ","
- + col.getBlue() + "];", false);
+ double normalise = 255D;
+ final String command = "background solid " + col.getRed() / normalise + ","
+ + col.getGreen() / normalise + "," + col.getBlue()
+ / normalise + ";";
+ viewer.sendChimeraCommand(command, false);
viewerCommandHistory(true);
}
diff --git a/src/jalview/gui/ChimeraViewFrame.java b/src/jalview/gui/ChimeraViewFrame.java
index 3c53762..cfac4ef 100644
--- a/src/jalview/gui/ChimeraViewFrame.java
+++ b/src/jalview/gui/ChimeraViewFrame.java
@@ -144,6 +144,12 @@ public class ChimeraViewFrame extends GStructureViewer implements Runnable,
_alignwith = new Vector();
}
+ // no colour by chain command in Chimera?
+ chainColour.setVisible(false);
+
+ // save As not yet implemented
+ savemenu.setVisible(false);
+
ViewSelectionMenu seqColourBy = new ViewSelectionMenu(
MessageManager.getString("label.colour_by"), this, _colourwith,
new ItemListener()
diff --git a/src/jalview/gui/JalviewChimeraBindingModel.java b/src/jalview/gui/JalviewChimeraBindingModel.java
index c582c5d..f68b585 100644
--- a/src/jalview/gui/JalviewChimeraBindingModel.java
+++ b/src/jalview/gui/JalviewChimeraBindingModel.java
@@ -94,11 +94,4 @@ public class JalviewChimeraBindingModel extends JalviewChimeraBinding
// TODO Auto-generated method stub
}
-
- @Override
- public void showUrl(String url, String target)
- {
- // TODO Auto-generated method stub
-
- }
}
diff --git a/src/jalview/jbgui/GStructureViewer.java b/src/jalview/jbgui/GStructureViewer.java
index 7e1be58..58b2eb1 100644
--- a/src/jalview/jbgui/GStructureViewer.java
+++ b/src/jalview/jbgui/GStructureViewer.java
@@ -283,7 +283,7 @@ public class GStructureViewer extends JInternalFrame
JMenu fileMenu = new JMenu();
- JMenu savemenu = new JMenu();
+ protected JMenu savemenu = new JMenu();
JMenuItem pdbFile = new JMenuItem();
--
1.7.10.2