marrink-lab / gromit

Auxiliary tools for automated atomistic and coarse-grained molecular dynamics simulations using gromacs
GNU General Public License v2.0
8 stars 12 forks source link

martinate.sh can't handle martini3 itp files #30

Open OLaprevote opened 3 years ago

OLaprevote commented 3 years ago

Using martini3 forcefield as provided on cgmartini.nl and specifying it in martinate.sh creates empty .itp files (like martini_v3.0_ions.itp) instead of copying the right files (like path/to/martini_v300/martini_v300_ions_v1.itp. It also doesn't include martini_v300_solvents_v1.itp in the topology .top file, which is problematic given it contains martini3 water beads.

Example of command: martinate.sh -f 2oar.pdb -fetch opm --insane-d=5 --insane-sol=W -martinize /path/to/martinize2 -ffdir /path/to/martini_v300 -cg martini3001, as written in martini3 paper

martini.itp is the only one well copied.

My personal quick fix was to write a small script outside of martinate.sh:

cp $input_dir/martini_v300/martini_v3.0.0{,_ions_v1,_phospholipids_v1,_sugars_v1,_solvents_v1}.itp .

sed -i -e 's/martini.itp/martini_v3.0.0.itp/' \
    -e 's/martini_v3.0_sugars/martini_v3.0.0_sugars_v1/' \
    -e 's/martini_v3.0_lipids/martini_v3.0.0_phospholipids_v1/' \
    -e '9i #include\ "martini_v3.0.0_solvents_v1.itp"\n' \
    -e 's/martini_v3.0_ions/martini_v3.0.0_ions_v1/' \
    2oar-cg.top

(It is possible to do this with two expressions instead of five with sed, but I was too lazy to search how.)