Interaction analysis for molecular structures and ensembles
The following steps will generate contacts from a simulation trajectory and convert them to a json file that can be uploaded and analyzed at gpcrviz.github.io/flareplot.
Assume you have a simulation represented with a topology file, top.pdb
, and trajectory file,
trj.dcd
. We first generate a contact list (contacts.tsv
) and then generate the time-flare
(flareplot.json
) with the commands:
get_dynamic_contacts.py --topology top.pdb --trajectory trj.dcd --itypes hb --output contacts.tsv
get_contact_flare.py --input contacts.tsv --output flareplot.json
Finally, go to gpcrviz.github.io/flareplot/?p=create
and upload the flareplot.json
file.
If you are interested in only a subset of interactions there's two ways of getting these. The first is to use the
--sele
and --sele2
arguments when computing contacts. If, for example, you're only
interested in interactions between residues 18-19 and 81-82 run:
get_dynamic_contacts.py --topology top.pdb \
--trajectory trj.dcd \
--itypes hb \
--sele "resid 18 to 19" \
--sele2 "resid 81 to 82" \
--output contacts.tsv
get_contact_flare.py --input contacts.tsv --output flareplot.json
Alternatively, you can generate all contacts and use a residue label file (see definition here) to decorate the flareplot with colors and edge-bundling as well as filtering away undesired residues:
get_dynamic_contacts.py --topology top.pdb --trajectory trj.dcd --itypes hb --output contacts.tsv
cat reslabels.tsv
A:CYS:18 CYS18 red
A:HIS:19 HIS19 red
A:ALA:81 ALA81 blue
A:ILE:82 ILE82 blue
get_contact_flare.py --input contacts.tsv --flarelabels reslabels.tsv --output flareplot.json