RMS: Unable to access -bin matrix data

GROMACS version: 2019.6
GROMACS modification: No

Hello everyone,

I used the gmx rms command with the -bin flag to generate a comparison matrix for a ligand of interest. However, I am unable to view the matrix data in its present form. Please let me know which programs are recommended to convert this data into a form similar to an Excel sheet?

I had used the following command to generate the output:

gmx_mpi rms -mw -s test.tpr -f test.trr -n lig_noh.ndx -fit rot+trans -o lig_noh.xvg -m lig_noh.xpm -bin lig_noh.dat

Hi Peter,

python + pandas is usually great for these things. Install pandas from pip install pandas. The issue is the binary format in the data - for that reason we also need to employ numpy, tell it the format of your data. Here is a sketch of some python code

import pandas as pd
import numpy as np
# use numpy to read binary format
data = np.fromfile('lig_noh.dat', np.float32)
# convert to pandas dataframe
rmsdbins = pd.Dataframe(data)
# write out into excel format
rmsdbins.to_excel('lig_noh.xlsx')

Then you can visualise either with inbuilt pandas functionality or use matplotlib.

This is a bit of a rabbit hole as there are tons of approaches out there, but I hope I could give you some leads to follow.

1 Like