Skip to main content

Python Gaussian Network Model

Project description

A Python module for Gaussian Network Model calculations with integrated plotting functions.

Python is an object oriented scripting language with powerful standard and rich third-party libraries. It is suitable for rapid and flexible code development. If you are not familiar with Python, but know programming, you can learn enough to use this package in a couple of hours by following Python Tutorial.

PyGNM is pure Pyton code depending on widely used numeric and graphics packages. All GNM convenience and plotting functions are documented and illustrated in the tutorial. PyGNM can be used to analyze a single protein structure (see tutorial) and to perform automated analysis of multiple structures (with of course some more Python code).

References

  • Direct evaluation of thermal fluctuations in proteins using a single parameter harmonic potential I. Bahar, A. R. Atilgan, and B. Erman Folding & Design 2, 173-181, 1997.

  • Gaussian dynamics of folded proteins Haliloglu, T. Bahar, I. & Erman, B. Phys. Rev. Lett. 79, 3090-3093, 1997.

  • Wikipedia article

License

This Python package is distributed under GNU General Public License.

Dependencies

Biopython Numpy Scipy Matplotlib (Optional, but needed for plotting capability.)

Installation

Linux

Extract tarball contents and run setup.py as follows: tar -xzf ppygnm-0.x.tar.gz cd pygnm-0.x python setup.py install You may need root access for the last step.

Windows

Use executable to install PyGNM.

Tutorial

This tutorial is also contained in the PyGNM package.

"""This is an example use of PyGNM, and is distributed with PyGNM package.

This example assumes that you have installed Matplotlib.
A ubiquitin structureis used in this example.
(PDB id 2BWF, Lowe et al., 2006 Acta Crystallogr., Sect. D 62:177)

"""
# Import plotting library
>>> import matplotlib.pyplot as pl

# Import GNM module from pygnm package
>>> from pygnm import GNM

# Initialize a GNM object
# Please make sure that the PDB file is in the current working directory
# You may need to download this, or another, PDB file
# Both .pdb and pdb.gz extensions are handled
>>> gnm = GNM('2BWF.pdb.gz')

# Select residues to be included in the model
# Some examples are
#      "*" and "*:*"
#        select all chains and residues
#
#      "A:x,y-z,w D:k-l G:*"
#        select residues x, y to z (inclusive),
#                     and w in chain A
#        and residues k to l (inclusive) in chain D
#        and all residues in chain G
#
#      "A B"
#        select all residues in chains A and B
#
#      "*:5-25,50-100"
#        select same set of residues in all chains
>>> gnm.select_residues('A:1-70')

# Build Kirchhoff matrix
#   cutoff=10., gamma=1.0 are default values, and may be omitted
>>> gnm.set_kirchhoff(cutoff=10., gamma=1.0)

# Calculate GNM modes
#   An optional parameter is n_modes
#   If you want to see only 20 nonzero modes, you can set n_modes=20
#   gnm.calculate_modes(n_modes=20)
>>> gnm.calculate_modes()

# CONVENIENCE FUNCTIONS
# Get first 20 eigenvalues, including the zero eigenvalue
>>> gnm.get_eigenvalues( range(20) )
# Get first eigenvector with a nonzero eigenvalue
>>> gnm.get_eigenvectors(1)
# Get first and second modes (eigenvector^2) with nonzero eigenvalues
>>> gnm.get_modes( [1, 2] )
# Get covariance matrix (pseudo-inverse of Kirchhoff)
>>> gnm.get_covariance()
# Get cross-correlations calclated using first 9 modes (w/ nonzero eigenvalues)
>>> gnm.get_cross_correlations( range(1, 10))

# PLOTTING FUNCTIONS
# Note that before each plot command, pl.figure() function is called
# to prevent plotting over the previous figure.
# Plot eigenvector shape
>>> pl.figure()
>>> gnm.plot_eigenvector(1)

# Plot mode shape
>>> pl.figure()
>>> gnm.plot_mode(1)

# Plot bfactors from PDB file
>>> pl.figure()
>>> gnm.plot_bfactors()

# Plot GNM square-fluctuations
>>> pl.figure()
>>> gnm.plot_square_fluctuations()

# Plot GNM square-fluctuations for low frequence nonzero 10 modes
>>> pl.figure()
>>> gnm.plot_square_fluctuations(indices=range(1, 11))

# Plot GNM cross-correlations
>>> pl.figure()
>>> gnm.show_cross_correlations()

# Plot GNM cross-correlations for low frequence nonzero 10 modes
>>> pl.figure()
>>> gnm.show_cross_correlations(indices=range(1, 11))

# WRITE PDB
# Write a PDB file with square fluctuations on beta column
>>> gnm.write_pdb( bfactors=gnm.get_square_fluctuations(indices=range(1, 11)) )

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygnm-0.1.tar.gz (81.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygnm-0.1.win32.exe (202.7 kB view details)

Uploaded Source

File details

Details for the file pygnm-0.1.tar.gz.

File metadata

  • Download URL: pygnm-0.1.tar.gz
  • Upload date:
  • Size: 81.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pygnm-0.1.tar.gz
Algorithm Hash digest
SHA256 8a301d6035dfb9b0a31b20752e2aaf531efc76b4e70f9a56a0920ef5c45f0b2d
MD5 b833c2da12ecde5e2380b8ac770ec54a
BLAKE2b-256 7deb90354942b74a3798bc60fd04a3f5850c56b61fda778072adf32af243c8ea

See more details on using hashes here.

File details

Details for the file pygnm-0.1.win32.exe.

File metadata

  • Download URL: pygnm-0.1.win32.exe
  • Upload date:
  • Size: 202.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pygnm-0.1.win32.exe
Algorithm Hash digest
SHA256 c245550b2fe998dba6bfbf8133706082eb2ebb0adfe53131956a2999b4ba05d5
MD5 f50028cf124f88dc683108065d362cb9
BLAKE2b-256 44504cccd843c95d0c3466bbdcd4bdc438bfbc50f2d5448965e551ea29569e70

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page