<mapID target="pdbmcviewer" url="html/features/pdbviewer.html"/>
<mapID target="pdbjmol" url="html/features/jmol.html"/>
<mapID target="chimera" url="html/features/chimera.html"/>
+ <mapID target="pymol" url="html/features/pymol.html"/>
<mapID target="chimera.annotxfer" url="html/features/chimera.html#annotxfer"/>
<mapID target="varna" url="html/features/varna.html"/>
<mapID target="xsspannotation" url="html/features/xsspannotation.html"/>
<tocitem text="PDB Sequence Fetcher" target="pdbfetcher" />
<tocitem text="PDB & 3D-Beacons Structure Chooser" target="pdbchooser" />
<tocitem text="Jmol Viewer" target="pdbjmol" />
- <tocitem text="Chimera Viewer" target="chimera" />
+ <tocitem text="Chimera Viewer" target="chimera" />
+ <tocitem text="Pymol Viewer" target="pymol" />
</tocitem>
<tocitem text="Viewing RNA structures" target="varna" expand="false"/>
<tocitem text="Opening URLs from Jalview" target="urllinks" expand="true">
</head>
<body>
<p>
- <strong>The Chimera Viewer</strong>
+ <strong>The Chimera and ChimeraX Viewers</strong>
</p>
<p>
Since Jalview 2.8.2, <a href="http://www.cgl.ucsf.edu/chimera/">Chimera</a>
(http://www.cgl.ucsf.edu/chimera/) can be used for viewing
structures opened via the <a href="structurechooser.html"><strong>"View
- Structure Data.."</strong> dialog</a>.
+ Structure Data.."</strong> dialog</a>. In Jalview 2.11.2, support
+ was also added for ChimeraX.
</p>
<p>
You can set a default choice of Jmol or Chimera structure viewer in
--- /dev/null
+<html>
+<!--
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ -->
+<head>
+<title>The Pymol PDB Viewer</title>
+</head>
+<body>
+ <p>
+ <strong>The Pymol Viewer</strong>
+ </p>
+ <p>
+ In Jalview 2.11.2, support was added for <a href="https://pymol.org/2/">Pymol</a>
+ (https://pymol.org/2/) to be used for viewing
+ structures opened via the <a href="structurechooser.html"><strong>"View
+ Structure Data.."</strong> dialog</a>.
+ </p>
+ <p>
+ You can configure Pymol as your preferred structure viewer in
+ <a href="preferences.html#structure"> Preferences</a>. You can also
+ optionally specify the path to the Pymol program here (if it differs
+ from the standard paths searched by Jalview).<br /> <strong>Jalview
+ requires Pymol's RPC interface, which is not available in older
+ versions of the Pymol community edition.<br />Please make sure your
+ version of Pymol is up to date.
+ </strong>
+ </p>
+ <p>
+ If you save your Jalview session as a project file, the state of any
+ open Pymol windows will also be saved, and can be reopened by
+ loading the project file on any machine with Pymol installed.
+ </p>
+ <p>
+ <strong>Known Limitations</strong><br /> Jalview provides an easy way
+ to employ Pymol for linked analysis of sequences and structures in the
+ same way as <a href="chimera.html">Chimera and ChimeraX</a>. There are
+ some limitations, however:
+ </p>
+ <ul>
+ <li>Pymol does not support some forms of legacy structural data
+ (e.g. the 1A70 C-alpha only PDB file included in the Jalview example
+ project).</li>
+ <li>Pymol to Jalview communication does not support transfer of
+ properties or highlighting sequence regions corresponding to
+ structure selections or mouse-overs in Pymol.</li>
+ </ul>
+ <p>
+ Basic screen operations (see <a
+ href="https://pymol.org/dokuwiki/doku.php?id=mouse">Pymol Wiki</a> at
+ https://pymol.org/dokuwiki/doku.php?id=mouse
+ for full details).
+ <table border="1">
+ <tr>
+ <td><strong>Action</strong></td>
+ <td><strong>Windows</strong></td>
+ <td><strong>Unix</strong></td>
+ <td><strong>Mac/OSX</strong></td>
+ </tr>
+ <tr>
+ <td>Rotate View</td>
+ <td>Left Click and Drag</td>
+ <td>Left Click and Drag</td>
+ <td>Left Click and Drag</td>
+ </tr>
+ <tr>
+ <td>Zoom</td>
+ <td>Right Click<br> drag mouse up or down
+ </td>
+ <td>Right Click<br>drag mouse up or down
+ </td>
+ <td>cmd or Right + Click and drag mouse up or down, <br>or
+ use mouse scroll button
+ </td>
+ </tr>
+ <tr>
+ <td>Move Origin</td>
+ <td>Middle Button + Drag</td>
+ <td>Middle Button and drag</td>
+ <td>alt + Click<br> and drag
+ </td>
+ </tr>
+ <tr>
+ <td>Select Residues</td>
+ <td>Ctrl + Click (and drag to select a region)</td>
+ <td>Ctrl + Click (and drag)</td>
+ <td>Ctrl + Click (and drag)</td>
+ </tr>
+ </table>
+ </p>
+ <p>
+ <strong>Jalview Controls</strong>
+ <p>The Jalview Pymol View window has up to five menus:</p>
+ <ul>
+ <li><Strong>File<br>
+ </strong>
+ <ul>
+ <li><strong>View Mapping<br>
+ </strong><em> Opens a text window showing the alignment between the
+ residues corresponding to alpha-carbon atoms in the PDB
+ structure and the residues in the associated sequence.</em></li>
+ </ul></li>
+ <li><strong>View</strong>
+ <ul>
+ <li><strong>Show Chains<br>
+ </strong><em>Select which of the PDB file's chains (if more than
+ one) are to be displayed.</em></li>
+ <li><strong>Colour by ..<br></strong><em>Submenu
+ allowing specific alignment views to be selected for
+ colouring associated chains in the structure display. This
+ menu contains all the alignment views associated with the
+ structure view, with those used to colour the view indicated
+ by ticks. Addditionally, it contains the following menu
+ entries:</em>
+ <ul>
+ <li><strong>Select many views<br></strong><em>When
+ this option is enabled, selecting an alignment view adds
+ it to the set used to colour the structures. Use this
+ when colouring structures related to a number of
+ alignments involving different domains or chains which
+ are shown in the same structure view.</em></li>
+ <li><strong>Select all views<br></strong><em>This
+ is only enabled when </em><strong>Select many views</strong><em>
+ is also enabled, and will add all associated views to
+ the set used to colour the structure display.</em></li>
+ <li><strong>Invert selection<br></strong><em>This
+ is only enabled when </em><strong>Select many views</strong><em>
+ is also enabled, and will replace the current set of
+ views with any remaining views not currently used to
+ colour the structure display.</em></li>
+ </ul></li>
+ </ul>
+ <li><strong>Colours<br>
+ </strong>
+ <ul>
+ <li><strong>By Sequence<br>
+ </strong><em> Colours each residue in the structure with the colour
+ of its corresponding residue in the associated sequence as
+ rendered in the associated alignment views, including any
+ UniProt sequence features or region colourings.<br />Pick
+ which of the associated alignment views are used to colour
+ the structures using the <strong>View→Colour
+ by ..</strong> sub menu.
+ </em><br> Residues which only exist in the PDB structure are
+ coloured white if they are insertions (relative to the
+ associated sequence in the alignment) and grey if they are N
+ or C terminal flanks outside the region mapped to the
+ alignment window's sequence.</em></li>
+ <li><strong>By Chain<br>
+ </strong><em>Uses Pymol's 'spectrum(chain)' command to apply a
+ different colour to each chain.</em></li>
+ <li><strong>Charge & Cysteine<br>
+ </strong><em> Highlights cysteines in yellow, anionic (Aspartic Acid
+ or Glutamic Acid) residues in red, and cationic (Lysine or
+ Arginine) residues in blue.</em></li>
+ <li><strong>Colour with Pymol<br></strong><em>Defers
+ any colouring operations to Pymol. Select this if you want
+ to use the Pymol scripting interface or menu to modify the
+ view directly.</em></li>
+ <li><strong>Standard and User Defined Jalview
+ colourschemes.<br>
+ </strong><em>The remaining entries apply the colourschemes available
+ from the standard and user defined <a
+ href="../colourSchemes/index.html">amino acid
+ colours</a>.
+ </em></li>
+ </ul></li>
+ <li><strong>Pymol<br>
+ </strong><em>This pulldown menu provides access to Pymol's capabilities from Jalview.</em>
+ <ul>
+ <li><strong><a name="sAlign">Align</a> <br> </strong><em>
+ When selected, the associated alignment will be used to
+ superimpose all the structures in the view onto the first
+ structure in the alignment. The regions used to calculate
+ the superposition will be highlighted using the 'Cartoon'
+ rendering style, and the remaining data shown as a chain
+ trace.<br />
+ <br />
+ </em></li>
+ <li><a name="annotxfer"><strong>Write Jalview
+ features</strong></a><br /> <em>Selecting this option will create
+ new atom properties for any features currently visible in
+ the associated alignment views. This allows those atoms to
+ be selected and analysed in Pymol directly.
+ </em><br>
+ <ul><li>Feature transfer in Pymol is experimental.</li><li>To select by a particular feature use the string matching syntax:<br>
+ select foo,p.jv_helix in helix
+ </li>
+ <li>To view transferred properties use Pymol's Properties Inspector</li><li>
+ For more information see <a href="https://pymol.org/dokuwiki/doku.php?id=properties#selection_language">Property based selection in Pymol's Documentation</a>.
+ </li>
+ </ul>
+ </li>
+ </ul></li>
+ <li><strong>Help<br>
+ </strong>
+ <ul>
+ <li><strong>Pymol Help<br>
+ </strong><em>Access the Pymol Help documentation in a new browser window.
+ window.</em></li>
+ </ul></li>
+ </ul>
+ <p>
+ <strong>Pymol and Windows Firewall</strong>
+ </p>
+ Jalview and Pymol communicate using the <a href="https://pymolwiki.org/index.php/RPC">Pymol's XML-RPC over HTTP interface</a>(https://pymolwiki.org/index.php/RPC).
+
+<br> Technically this requires both Pymol and Jalview to open
+ ports on the local network, and this may be blocked by Windows
+ Firewall with a warning message such as
+ <br /> "Windows Firewall has blocked some features of this program"
+ (where the program may be java.exe or javaw.exe).
+ <br /> To allow Jalview and Pymol to interact, you may need to add
+ permission for the program to communicate over the network. This can
+ be done from the warning dialogue, or in Control Panel, Firewall
+ settings.
+</body>
+</html>
label.web_services = Web Services
label.right_click_to_edit_currently_selected_parameter = Right click to edit currently selected parameter.
label.let_jmol_manage_structure_colours = Let Jmol manage structure colours
-label.fetch_chimera_attributes = Fetch Chimera attributes
-label.fetch_chimera_attributes_tip = Copy Chimera attribute to Jalview feature
+label.fetch_viewer_attributes = Fetch {0} attributes
+label.fetch_viewer_attributes_tip = Copy {0} attribute to Jalview feature
label.marks_leaves_tree_not_associated_with_sequence = Marks leaves of tree not associated with a sequence
label.index_web_services_menu_by_host_site = Index web services in menu by the host site
label.option_want_informed_web_service_URL_cannot_be_accessed_jalview_when_starts_up = Check this option if you want to be informed<br>when a web service URL cannot be accessed by Jalview<br>when it starts up
label.insufficient_residues = Not enough aligned residues ({0}) to perform superposition
label.create_viewer_attributes = Write Jalview features
label.create_viewer_attributes_tip = Set structure residue attributes for Jalview features
-label.attributes_set = {0} attribute values set on Chimera
+label.attributes_set = {0} attribute values set on {1}
label.sort_alignment_by_tree = Sort Alignment By Tree
label.mark_unlinked_leaves = Mark Unlinked Leaves
label.associate_leaves_with = Associate Leaves With
String canonicalSourceName;
- boolean isCanonicalAccession;
+ boolean isCanonicalAccession=false;
/*
* maps from associated sequence to the database sequence's coordinate system
{
out.close();
}
+ if (Cache.log.isTraceEnabled())
+ {
+ Cache.log.trace("Sent: " + command.toString());
+ if (result != null)
+ {
+ Cache.log.trace("Received: " + result);
+ }
+ }
}
return result;
}
} catch (Exception ex)
{
}
-
if (b)
{
- alignFrame.setDisplayedView(this);
+ setAlignFrameView();
}
}
-
+ public void setAlignFrameView()
+ {
+ alignFrame.setDisplayedView(this);
+ }
+
@Override
public StructureSelectionManager getStructureSelectionManager()
{
viewerActionMenu.add(writeFeatures);
fetchAttributes = new JMenu(
- MessageManager.getString("label.fetch_chimera_attributes"));
+ MessageManager.formatMessage("label.fetch_viewer_attributes",getViewerName()));
fetchAttributes.setToolTipText(
- MessageManager.getString("label.fetch_chimera_attributes_tip"));
+ MessageManager.formatMessage("label.fetch_viewer_attributes_tip",getViewerName()));
fetchAttributes.addMouseListener(new MouseAdapter()
{
// todo pull up?
int count = jmb.sendFeaturesToViewer(getAlignmentPanel());
statusBar.setText(
- MessageManager.formatMessage("label.attributes_set", count));
+ MessageManager.formatMessage("label.attributes_set", count, getViewerName()));
}
/**
* a second parameter sets the pdbid as the loaded PyMOL object name
*/
String pdbId = pe.getId();
+ try {
+ String safePDBId = java.net.URLEncoder.encode(pdbId,"UTF-8");
+ pdbId = safePDBId.replace('%', '_');
+ pdbId = pdbId.replace("-", "__");
+ char fc = pdbId.charAt(0);
+ // put an 's' before any numerics
+ if (fc>='0' && fc<='9')
+ {
+ pdbId = 's'+pdbId;
+ }
+// pdbId.replace('-', 0)
+ } catch (Exception x)
+ {
+ Cache.log.error("Unxpected encoding exception for '"+pdbId+"'",x);
+ }
cmd.addParameter(pdbId);
executeCommand(cmd, false);
{
int count = binding.sendFeaturesToViewer(getAlignmentPanel());
statusBar.setText(
- MessageManager.formatMessage("label.attributes_set", count));
+ MessageManager.formatMessage("label.attributes_set", count, getViewerName()));
}
}
{
if (afclient.isValidReference(pdbid))
{
- pdbseq = afclient.getSequenceRecords(pdbid);
+ pdbseq = afclient.getSequenceRecords(pdbid,processingEntry.getRetrievalUrl());
} else {
if (processingEntry.hasRetrievalUrl())
{
+ String safePDBId = java.net.URLEncoder.encode(pdbid,"UTF-8");
+
// retrieve from URL to new local tmpfile
- File tmpFile = File.createTempFile(pdbid,
+ File tmpFile = File.createTempFile(safePDBId,
"." + (PDBEntry.Type.MMCIF.toString().equals(
processingEntry.getType().toString()) ? "cif"
: "pdb"));
import jalview.api.AlignmentViewPanel;
import jalview.util.MessageManager;
+import jalview.util.Platform;
import java.awt.Component;
import java.awt.event.ActionEvent;
}
}
});
+ final ViewSelectionMenu us=this;
checkBox.addMouseListener(new MouseAdapter()
{
@Override
{
try
{
- ap.setSelected(false);
} catch (Exception ex)
{
}
{
try
{
- ap.setSelected(true);
+ ap.setAlignFrameView();
} catch (Exception ex)
{
}
import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Vector;
pdb, maxChain, sqmpping, maxAlignseq, siftsClient);
seqToStrucMapping.add(siftsMapping);
maxChain.makeExactMapping(siftsMapping, seq);
- maxChain.transferRESNUMFeatures(seq, "IEA: SIFTS");
+ maxChain.transferRESNUMFeatures(seq, "IEA: SIFTS",pdb.getId().toLowerCase(Locale.ROOT));
maxChain.transferResidueAnnotation(siftsMapping, null);
ds.addPDBId(maxChain.sequence.getAllPDBEntries().get(0));
targetChainId, maxChain, pdb, maxAlignseq);
seqToStrucMapping.add(nwMapping);
maxChain.makeExactMapping(maxAlignseq, seq);
- maxChain.transferRESNUMFeatures(seq, "IEA:Jalview"); // FIXME: is
+ maxChain.transferRESNUMFeatures(seq, "IEA:Jalview",pdb.getId().toLowerCase(Locale.ROOT)); // FIXME: is
// this
// "IEA:Jalview" ?
maxChain.transferResidueAnnotation(nwMapping, sqmpping);
siftsClient);
foundSiftsMappings.add(siftsMapping);
chain.makeExactMapping(siftsMapping, seq);
- chain.transferRESNUMFeatures(seq, "IEA: SIFTS");// FIXME: is this
+ chain.transferRESNUMFeatures(seq, "IEA: SIFTS",pdb.getId().toLowerCase(Locale.ROOT));// FIXME: is this
// "IEA:SIFTS" ?
chain.transferResidueAnnotation(siftsMapping, null);
} catch (SiftsException e)
StructureMapping nwMapping = getNWMappings(seq, pdbFile,
maxChainId, maxChain, pdb, maxAlignseq);
seqToStrucMapping.add(nwMapping);
- maxChain.transferRESNUMFeatures(seq, null); // FIXME: is this
+ maxChain.transferRESNUMFeatures(seq, null,pdb.getId().toLowerCase(Locale.ROOT)); // FIXME: is this
// "IEA:Jalview" ?
maxChain.transferResidueAnnotation(nwMapping, sqmpping);
ds.addPDBId(maxChain.sequence.getAllPDBEntries().get(0));
maxChain.makeExactMapping(maxAlignseq, seq);
jalview.datamodel.Mapping sqmpping = maxAlignseq
.getMappingFromS1(false);
- maxChain.transferRESNUMFeatures(seq, null);
+ maxChain.transferRESNUMFeatures(seq, null, pdb.getId().toLowerCase(Locale.ROOT));
HashMap<Integer, int[]> mapping = new HashMap<>();
int resNum = -10000;
import jalview.datamodel.DBRefSource;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.PDBEntry.Type;
+import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
+import jalview.datamodel.features.SequenceFeaturesI;
import jalview.io.DataSourceType;
import jalview.io.FileFormat;
import jalview.io.FileFormatI;
@Override
public AlignmentI getSequenceRecords(String queries) throws Exception
{
+ return getSequenceRecords(queries, null);
+ }
+ public AlignmentI getSequenceRecords(String queries, String retrievalUrl) throws Exception
+ {
AlignmentI pdbAlignment = null;
String chain = null;
String id = null;
return null;
}
String alphaFoldCif = getAlphaFoldCifDownloadUrl(id);
+ if (retrievalUrl != null)
+ {
+ alphaFoldCif = retrievalUrl;
+ }
try
{
dbVersion, (chid == null ? id : id + chid));
// dbentry.setMap()
pdbcs.addDBRef(dbentry);
+ // update any feature groups
+ List<SequenceFeature> allsf = pdbcs.getFeatures().getAllFeatures();
+ List<SequenceFeature> newsf = new ArrayList<SequenceFeature>();
+ if (allsf!=null && allsf.size()>0)
+ {
+ for (SequenceFeature f:allsf)
+ {
+ if (file.equals(f.getFeatureGroup()))
+ {
+ f = new SequenceFeature(f, f.type, f.begin, f.end, id, f.score);
+ }
+ newsf.add(f);
+ }
+ pdbcs.setSequenceFeatures(newsf);
+ }
}
}
else
{
return new PDBFeatureSettings();
}
+
}
* @param seq
* @param status
* The Status of the transferred annotation
+ *
+ * @param altPDBID the group id for the features on the destination sequence (e.g. the official accession ID)
*/
public void transferRESNUMFeatures(SequenceI seq,
- String status)
+ String status, String altPDBID)
{
+ if (altPDBID==null)
+ {
+ altPDBID = pdbid;
+ }
SequenceI sq = seq;
while (sq != null && sq.getDatasetSequence() != null)
{
int newEnd = 1 + residues.elementAt(feature.getEnd() - offset).atoms
.elementAt(0).alignmentMapping;
SequenceFeature tx = new SequenceFeature(feature, newBegin, newEnd,
- feature.getFeatureGroup(), feature.getScore());
+ altPDBID, feature.getScore());
tx.setStatus(status
+ ((tx.getStatus() == null || tx.getStatus().length() == 0)
? ""