Skip to content

Plotting scripts

Raúl Mera A edited this page Apr 12, 2024 · 7 revisions

A few Python scripts are included to help with the result visualization.

ramachandran.py

A simple script that will plot one set of Ramachandran angles (the ones in the columns 2 and 3 of the output file from gomd) along the trajectory, coloring the value for each frame in a different hue, so any conformationa change can be observed. Takes the the goMD Ramachandran output file as input, plus a -RGB options if the "RGB" option was given to goMD , and a -trajcolors option if the goMD color suggestions are to be ignored, and, instead, a simple coloring-by-frame scheme is to be used. If the Ramachandran angles to be plot are few enough, they will be plotted in different glyphs to simplify the analysis.

ramachandran.py file.dat [-RGB] [-trajcolors]

interfaces.py

Please note that InterByRes is an experimental feature of goMD

Plots the results of the InterByRes, as the fraction of the trajectory for which each residue in the selection is part of the interface. Requites the goMD-produced data and N, the total number of residues in the protein

interfaces.py  gomd_data.dat N

If the interface in study is one between two different chains, an additional argument, the "chain offset" (--co) is needed. That will correspond to the number that has to be added to the ID of the residues from the second Chain, or to the sum of total residues in all chains of the protein before that of the second monomer. As an example: Say the interface in study is that between monomers B and C. Monomer A has 50 residues, and monomer B has 40 residues. In that case, the options "--co 90" needs to be provided. If the interface in study is between two parts of the same monomer/chain, the "--co" options should not be given.

See:

interfaces.py -h

for more information

plots.py

plots.py is a rather complete plotting tool for all the other plotting tasks. It is easy to use (for the simplest case of only 1 column of results, or 2 columns in total, it only requires the name of the file) but has a fair bit of options to customize the visualization. It can plot only the selected columns, set the scale for the y-axis, plot an histogram for the results instead of the default results vs time plot, and more. plots.py will ignore lines starting with "#", "@" and "&", which allows it to plot Gromacs-produced xvg files. Use In many cases, the only option

The simple use-cases are covered by:

plots.py -c columns [--histogram true] [--runav N] [--rmsf true] [--tags "tags"] file.dat
  1. -c columns Where columns is a positive integer, the number of columns in the input file, not counting the frame number
  2. --histogram true If given, this flag causes plots.py to plot a histogram of the values instead of a values vs time plot.
  3. --runav N (not valid for histograms or RMSF). Plots a running average of the data with a N-sized window
  4. --rmsf true Plots RMSF data instead of property vs time.
  5. --tags "tagY,tag1,tag2 ... tagN" There tagY, and tag1 to tagN are text strings. Defines the legends for the Y axis (tagY) and for each plotted series (tag1 to tagN). If used together with --histogram. defines instead the legend for the X axis (as the legend for the Y axis is always "Normalized frequencies" and for each plotted series. Note that tagY,tag1, etc are separated by commas, which means that each tag can contain white spaces.

There are other options available that give finer control of the plot (such as limiting the range of the plot in X and/or on Y). See

plots.py -h

For details.

rdf2gomd.py

This is a small program to put the results of the rdf task in a regular by-column goMD format, which can then be plotted with plots.py. It supports putting the results of several rdf runs as columns in the same file. It takes only the file(s) as arguments.

Clone this wiki locally