unanswered gromit/martinate.sh using martini3: itp file included multiple times in topology

  • O.Laprevote
  • O.Laprevote's Avatar Topic Author
  • Offline
  • Fresh Boarder
More
3 years 2 days ago - 2 years 11 months ago #8923 by O.Laprevote
I am currently trying to reproduce the command line of martinate.sh given in martini3 paper (and embed the system in a membrane before running it):
gromit/martinate.sh -f 2oar.pdb -fetch opm --insane-d=5 \
    --insane-l=DPPC --insane-sol=W -martinize martinize2 \
    -ffdir ../martiniv300 -cg martini3001 -stop SOLVENT

My gromacs version is 2021.1 and I installed all the other dependencies (martinize2, insane & martini3 forcefield, see at the bottom). At step 1.B. I get the error
/usr/local/gromacs/bin/gmx grompp -f em-mart.mdp -po em-mart-out.mdp -c 2oar-mart.gro -r 2oar-mart.gro -p 2oar-cg.top -n 2oar-mart.ndx -o 2oar-mart-EM.tpr  -maxwarn -1
# ven. avril 23 01:54:02 2021 MDS 10818 ERROR: martinate.sh STEP 1 CG : Execution of grompp failed in routine MDRUNNER. More information in 01-TOPOLOGY-CG.log.

# FATAL: -----------------------------------------------------------------------------------------
# FATAL:  Execution of grompp failed in routine MDRUNNER. More information in 01-TOPOLOGY-CG.log. 
# FATAL: -----------------------------------------------------------------------------------------"

01-TOPOLOGY-CG.log contains:
  gmx grompp -f em-mart.mdp -po em-mart-out.mdp -c 2oar-mart.gro -r 2oar-mart.gro -p 2oar-cg.top -n 2oar-mart.ndx -o 2oar-mart-EM.tpr -maxwarn -1


ERROR 1 [file molecule_2.itp, line 18]:
  moleculetype molecule_2 is redefined


-------------------------------------------------------
Program:     gmx grompp, version 2021.1
Source file: src/gromacs/gmxpreprocess/toppush.cpp (line 1475)

Investigating this error a bit ( here and there ) I found that this error happens when topology files include twice a .itp. Indeed, 2oar-cg.top contains:
#include "martini.itp"
#include "molecule_0.itp"
#include "molecule_1.itp"
#include "molecule_2.itp"
#include "molecule_3.itp"
#include "molecule_2.itp"

[ system ]
Title of the system

[ molecules ]
molecule_0    1
molecule_1    1
molecule_2    1
molecule_3    1
molecule_2    1

Given it is produced by martinize2, I believe the error comes from there. I guess as 2oar.pdb is an homopentamere (at least from what I could see by looking quickly at the pdb file) then one molecule can be identified two times, and martinize2 doesn't handle this well. Issue already reported on martinize-vermouth: github.com/marrink-lab/vermouth-martinize/issues/353 )

I don't know how to handle the error, though: editing the top file by hand wouldn't work, because step 1.B then wouldn't be complete and rerun martinize2, erasing the edited top file. Would running the gmx grompp by hand after editing the file work better?
Best fix I've found before martinize2 gets fixed is to edit the top file manually after martinate.sh fails, run the gmx grompp command independently, then rerun martinate.sh as it automatically skips steps already done.

By the way, here is the whole code to install martinate.sh (with gromacs already installed):
git clone https://github.com/marrink-lab/gromit.git

# Put insane in gromit path
wget http://www.cgmartini.nl/images/tools/insane/insane.py \
    -O gromit/insane
chmod +x gromit/insane
2to3 -w gromit/insane
2to3 -w gromit/*/*.py

# You should also edit manually all shell scripts calling python with print statements

# Install martinize2
pip install vermouth

# Download forcefield and mappings as given there:
# http://cgmartini.nl/index.php/force-field-parameters/particle-definitions
wget http://www.cgmartini.nl/images/martini_v300.zip
unzip -d martini_v300 martini_v300.zip
rm martini_v300.zip

I can do a pull request on gromit so that its README includes this in the install part. 2to3 conversion is necessary given that martinize2 can't run on python2.
I really think the least to do would be to include insane.py in gromit git repository, updated for python3 and already considered an executable. Same goes for all python scripts and calls. I will open an issue.

My two cents would be that on the long run insane.py (and even later whole martinate) should probably be put in vermouth and made a script, just like martinize2, but that's for another time.
Last edit: 2 years 11 months ago by O.Laprevote. Reason: Clarify subject

Please Log in or Create an account to join the conversation.

Time to create page: 0.081 seconds