Script to automatically build psf file from pdb in VMD

Here is the script:

Just replace PDB with your pdb file name and launch the script with:

vmd -dispdev text -e autopsf.tcl

In zsh shell you can automatize this script for multiple pdb with:

for x in models/out_??.pdb; do
    echo $x
    vmd -dispdev text -e =(sed "s,PDB,$x," autopsf.tcl)
done

Where: models/out_??.pdb are your input pdb files.

You can even run it in parallel with GNU parallel (to use with care as I’m note quite certain that the creation of the zsh temporary file is adapted to parallel processing…):

ls out_??.pdb | parallel --eta vmd -dispdev text -e =(sed "s,PDB,{}," autopsf.tcl) > /dev/null
If you want to ask me a question or leave me a message add @bougui505 in your comment.