This is a read-only mirror of pymolwiki.org

Difference between revisions of "Contact map visualizer"

From PyMOL Wiki
Jump to navigation Jump to search
m (1 revision)
 
(24 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== Introduction ==
+
{{Infobox script-repo
It is a fast and easy way of mapping contact maps to the residues in PyMOL.
+
|type      = plugin
----
+
|filename = plugins/contact_map_visualizer.py
 +
|author    = [[User:Venky|Venkatramanan Krishnamani]]
 +
|license  = -
 +
}}
  
==== How to get it ====
+
'''Enhanced version of this plugin is now available at [[CMPyMOL]]'''
  
* You can download it from the git repository https://github.com/VenkyKrishnamani/Contact-Map-Visualizer
+
The '''contact map visualizer''' plugin can link contact map images to the residues in PyMOL in a interactive way. Contact maps are pixel graphics where each protein residue corresponds to one line and one row of pixels. Thus for a 100 residue protein, such a image has 100x100 pixels. A common tool to generate such images is '''g_mdmat''' from the [http://www.gromacs.org gromacs] package.
  git clone git://github.com/VenkyKrishnamani/Contact-Map-Visualizer.git
+
 
----
+
== Usage ==
 +
 
 +
  contact_map_visualizer [ image_file [, selection ]]
 +
 
 +
== Required Dependencies ==
  
==Required Dependencies on Linux and Mac OS X==
 
* [http://wiki.python.org/moin/TkInter Tkinter]
 
* [http://www.pythonware.com/products/pil/ PIL] (Python Imaging Library) and
 
 
* [http://pygame.org/ pygame]
 
* [http://pygame.org/ pygame]
----
+
* [http://wiki.python.org/moin/TkInter Tkinter] (optional and usually included with PyMOL)
 +
* [http://www.pythonware.com/products/pil/ PIL] (optional, for automatically converting XPM images)
 +
 
 +
Example for installing all dependencies on a Ubuntu like system:
 +
 
 +
<source lang="bash">
 +
sudo apt-get install python-tk python-imaging python-pygame
 +
</source>
  
===Installing on Linux===
+
== Installation ==
  
* Follow the steps below
 
git clone git://github.com/VenkyKrishnamani/Contact-Map-Visualizer.git
 
cd Contact-Map-Visualizer
 
* Run 'pymol' as an administrator from the command line
 
 
* Navigate to plugins > install
 
* Navigate to plugins > install
* Choose Contact-Map-Visualizer.py from the dialogbox and 'OK'
+
* Locate the downloaded '''contact_map_visualizer.py''' file in the dialogbox and select 'OK'
* Quit and Restart 'pymol' (not required to be administator mode)
+
* Quit and Restart 'pymol'
 +
 
 +
Alternative way: Just [[run]] the script, it will provide a command but no menu plugin entry.
 +
 
 +
== Generate Contact Map ==
 +
 
 +
[[File:Contact-Map-of-a-Trajectory.png|thumb|200px|right|Mean contact map of a protein trajectory generated from g_mdmat tool in the Gromacs analysis package.]]
 +
 
 +
Use the command [http://manual.gromacs.org/online/g_mdmat.html g_mdmat] from [http://www.gromacs.org Gromacs] analysis package. A typical contact map looks like the figure on the right. 
 +
 
 +
To generate contact map of a single PDB. For example contact map for a PDB from RCSB, use the following command
 +
g_mdmat -f <protein.pdb> -s <protein.pdb> -mean contact-map.xpm
 +
To generate a mean contact map form a protein trajectory
 +
g_mdmat -f <trajectory.pdb> -s <starting-frame.pdb> -mean contact-map.xpm
 +
 
 +
For Gromacs 2021
 +
To generate contact map of a single PDB. For example contact map for a PDB from RCSB, use the following command
 +
gmx g_mdmat -f <protein.pdb> -s <protein.pdb> -mean contact-map.xpm
 +
To generate a mean contact map form a protein trajectory
 +
gmx g_mdmat -f <trajectory.pdb> -s <starting-frame.pdb> -mean contact-map.xpm
 +
To convert XPM to PNG format
 +
convert contact-map.xpm contact-map.png
  
===Installing on Mac OS X===
+
== Screenshot ==
Coming soon…
 
----
 
=== Usage ===
 
  
* Launch PyMOL
+
[[File:Screenshot.png|thumb|800px|center]]
* Navigate to Plugins > Contact Map Visualizer in PyMOL
 
* When the first dialog box pops up, select the contact map image (only .png and .gif are supported currently) and select 'OK'
 
* In the second dialog box, select the pdb file which was used to generate the above contact map OR first/any single frame of a trajectory in pdb/mol format.
 
* Once the visualizer launches, click on the location you want to visualize on the contact map, this will be reflected as selected residues in the PyMOL window.
 
* Everytime a location to be visualized is selected, an image is saved in the working directory (1 file is generated for every run)
 
——
 
=== Requests for features are welcome ===
 
  
 
== Copyright ==
 
== Copyright ==
<source lang=bash>
+
<source lang="text">
 
# Copyright Notice
 
# Copyright Notice
 
# ================
 
# ================
Line 72: Line 90:
 
#
 
#
 
</source>
 
</source>
----
 
  
 
[[Category:Plugins]]
 
[[Category:Plugins]]
 +
[[Category:Pymol-script-repo]]

Latest revision as of 03:43, 6 December 2021

Type PyMOL Plugin
Download plugins/contact_map_visualizer.py
Author(s) Venkatramanan Krishnamani
License -
This code has been put under version control in the project Pymol-script-repo

Enhanced version of this plugin is now available at CMPyMOL

The contact map visualizer plugin can link contact map images to the residues in PyMOL in a interactive way. Contact maps are pixel graphics where each protein residue corresponds to one line and one row of pixels. Thus for a 100 residue protein, such a image has 100x100 pixels. A common tool to generate such images is g_mdmat from the gromacs package.

Usage

contact_map_visualizer [ image_file [, selection ]]

Required Dependencies

  • pygame
  • Tkinter (optional and usually included with PyMOL)
  • PIL (optional, for automatically converting XPM images)

Example for installing all dependencies on a Ubuntu like system:

sudo apt-get install python-tk python-imaging python-pygame

Installation

  • Navigate to plugins > install
  • Locate the downloaded contact_map_visualizer.py file in the dialogbox and select 'OK'
  • Quit and Restart 'pymol'

Alternative way: Just run the script, it will provide a command but no menu plugin entry.

Generate Contact Map

Mean contact map of a protein trajectory generated from g_mdmat tool in the Gromacs analysis package.

Use the command g_mdmat from Gromacs analysis package. A typical contact map looks like the figure on the right.

To generate contact map of a single PDB. For example contact map for a PDB from RCSB, use the following command

g_mdmat -f <protein.pdb> -s <protein.pdb> -mean contact-map.xpm

To generate a mean contact map form a protein trajectory

g_mdmat -f <trajectory.pdb> -s <starting-frame.pdb> -mean contact-map.xpm

For Gromacs 2021 To generate contact map of a single PDB. For example contact map for a PDB from RCSB, use the following command

gmx g_mdmat -f <protein.pdb> -s <protein.pdb> -mean contact-map.xpm

To generate a mean contact map form a protein trajectory

gmx g_mdmat -f <trajectory.pdb> -s <starting-frame.pdb> -mean contact-map.xpm

To convert XPM to PNG format

convert contact-map.xpm contact-map.png

Screenshot

Screenshot.png

Copyright

# Copyright Notice
# ================
# 
# The PyMOL Plugin source code in this file is copyrighted, but you are
# free to use and copy it as long as you don't change or remove any of
# the copyright notices.
# 
# -----------------------------------------------------------------------------------
# This PyMOL Plugin Contact Maps Visualizer is
# Copyright (C) 2012 by Venkatramanan Krishnamani <venks@andrew.cmu.edu>
# 
#                        All Rights Reserved
# 
# Permission to use, copy, modify, distribute, and distribute modified
# versions of this software and its documentation for any purpose and
# without fee is hereby granted, provided that the above copyright
# notice appear in all copies and that both the copyright notice and
# this permission notice appear in supporting documentation, and that
# the name(s) of the author(s) not be used in advertising or publicity
# pertaining to distribution of the software without specific, written
# prior permission.
# 
# THE AUTHOR(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN
# NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#