How to use PLUMED Apptainer image?

Prerequisites

For more information on Apptainer containers, please look at this page or refer to this tutorial to have a quick look at Apptainer’s main commands.

Input files

To illustrate the various commands, a set of PLUMED input files is available in the form of an archive via this link.

Those files correspond to a tutorial example from the PLUMED official documentation. The archive contains the following files:

  • 5-HT1B.pdb: reference conformation of the 5-HT1B receptor with the serotonin ligand,
  • 5-HT1B.xtc: pre-computed molecular dynamics trajectory of the 5-HT1B receptor with the serotonin ligand, generated by GROMACS software,
  • plumed.dat : a PLUMED input script.

In this tutorial, we will assume that the input files contained in this archive are in the current directory. To extract them:

tar -xzf plumed-tutorial-inputs.tar.gz

Quickstart

For impatient folks, here is how to launch a PLUMED analysis in the case where the current directory contains the plumed.sif container image and all necessary PLUMED input files:

apptainer exec plumed.sif plumed driver --mf_xtc 5-HT1B.xtc

Detailed usage for the PLUMED container

This section presents how to use the PLUMED image to analyze a pre-computed molecular dynamics trajectory file. For more details about Apptainer commands, please look at this tutorial.

Introduction

PLUMED is an open-source MPI-parallelized highly flexible library specifically designed for enhancing molecular dynamics (MD) and Monte Carlo (MC) simulations. The core functionality of PLUMED revolves around the calculation and manipulation of collective variables, which are essential for characterizing the state of a molecular system. The software is also equipped with a comprehensive set of analysis tools that allow for the post-processing of simulation data.

The main executable in the image is the plumed executable.

Visualizing the trajectory input file using VMD

The 5-HT1B.xtc input file presented above corresponds to a molecular dynamics trajectory file. It can be visualized with the VMD software for example.

This can be done with the following command if VMD is installed locally:

vmd 5-HT1B.pdb 5-HT1B.xtc 

Alternatively, the VMD container provided by the Diamond website can be used as follows:

apptainer exec vmd.sif vmd 5-HT1B.pdb 5-HT1B.xtc 

As mentioned in the PLUMED tutorial, this trajectory will appear discontinuous due to periodic boundary conditions.

Running the PLUMED driver on the input files

The plumed.dat input script contains instructions to analyze the 5-HT1B.xtc trajectory. The reader is invited to read this file for more insight on the PLUMED scripting syntax as it is thoroughly commented. For a deeper dive in this syntax, the source material tutorial also features, for each keyword, a clickable link to the corresponding official documentation.

The script contains two main analyze processes:

  • The first one computes the distance between two given atoms at indices 1 and 10 and prints this distance in nanometers every 10 steps on a file called COLVAR1,
  • The second one computes the torsional angle between atoms 1, 10, 20 and 30 and prints it in radians every 100 steps on another file called COLVAR2.

The script can be run using PLUMED driver with the following command:

apptainer exec plumed.sif plumed driver --mf_xtc 5-HT1B.xtc

Note that the input script is automatically found by PLUMED as long as it is named plumed.dat. The previous command results in two files called COLVAR1 and COLVAR2. On each file, the first line describes the displayed fields.

To go further

The official PLUMED documentation features many more tutorials listed on this page. The commands presented in the present tutorial to run PLUMED from the PLUMED container image can be easily extrapolated to run those examples.