Concatenate pbd/gro files into a trajectory

GROMACS version:
GROMACS modification: Yes/No
Here post your question
I have som pdb files and I want to concatenate them to make a trajectory. I have tried using trjcat but I am getting an error " gmx trjcat can only handle binary trajectory formats (trr, xtc, tng)" . Any help will be appreciated

I guess you wanna take multiple structures into a pdb file like the NMR structure ? If there are not much files, you can manually merge them in this format:

"
MODEL 1
【Content in file 1】
ENDMDL
MODEL 2
【Content in file 2】
ENDMDL
……
END
"

You can also write a script to do this, e.g. using linux’s cat
When you open this pdb file in PyMOL or other visual software, it will contain multiple states like a traject file.Hoping this can help you.

Thankyou for the suggestion but I want to concatenate the structures such as pbd1 is frame1 and pdb2 is frame2 and so on…

Dear @maham,

Maybe you can try with using both gmx trjconv and gmx trjcat to first transform the pdb in a single xtc binary frame and then glue them together with trjcat.

As a simple example, if your N pdb frames set is {snap_0.pdb, snap_1.pdb, snap_2.pdb,…,snap_N.pdb}, you have a time step of, say, 10ps between frames, and you have the .tpr file of the system (let’s call it topol.tpr), then do something like (here I report bash code):

for((i=0;i<N+1;i++))
do
time=$((${i}*10)) # here you get the time steps for each frame
echo "0" | gmx trjconv -f snap_${i}.pdb -s topol.tpr -o snap_${i}.xtc -t0 ${time} # not sure about the need for the echo command, depends on the tpr
done

which should convert your N pdb files into N xtc files that are consecutive in time with a time spacing of 10ps. Then do something like

gmx trjcat -f snap_*.xtc -o trajectory.xtc

which should concatenate everything with the right ordering since you have the time info embedded in the .xtc.