marrink-lab / vermouth-martinize

Describe and apply transformation on molecular structures and topologies
Apache License 2.0
86 stars 38 forks source link

Bug on Martinize2 on running python3.8 version #454

Closed mmidhun97 closed 1 year ago

mmidhun97 commented 1 year ago

On running martinize2 im getting following error

Traceback (most recent call last):
  File "/home/midhun/.local/lib/python3.8/site-packages/vermouth/parser_utils.py", line 239, in parse_section
    return method(self, line, lineno, **kwargs)
  File "/home/midhun/.local/lib/python3.8/site-packages/vermouth/map_parser.py", line 718, in _blocks
    block = getattr(self.force_fields[self.ff[direction]], map_type+'s')[attrs['resname']]
KeyError: 'universal'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/midhun/.local/lib/python3.8/site-packages/vermouth/map_input.py", line 435, in read_mapping_directory
    new_mappings = read_mapping_file(infile, force_fields)
  File "/home/midhun/.local/lib/python3.8/site-packages/vermouth/map_input.py", line 178, in read_mapping_file
    for mapping in mappings:
  File "/home/midhun/.local/lib/python3.8/site-packages/vermouth/parser_utils.py", line 110, in parse
    result = self.dispatch(line)(line, lineno)
  File "/home/midhun/.local/lib/python3.8/site-packages/vermouth/parser_utils.py", line 241, in parse_section
    raise IOError("Problems parsing line {}. I think it should be a "
OSError: Problems parsing line 8. I think it should be a '['modification', 'from blocks']' line, but I can't parse it as such.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/midhun/.local/bin/martinize2", line 821, in <module>
    entry()
  File "/home/midhun/.local/bin/martinize2", line 542, in entry
    partial_mapping = read_mapping_directory(directory,
  File "/home/midhun/.local/lib/python3.8/site-packages/vermouth/map_input.py", line 437, in read_mapping_directory
    raise IOError('An error occured while reading "{}".'.format(path))
OSError: An error occured while reading "/home/midhun/big/simulationfiles/Martini/martinize2/martini_v300/martini_v3.0.0_proteins/mappings/martini3001/modifications.mapping".
             :-) GROMACS - gmx editconf, 2020.1-Ubuntu-2020.1-1 (-:

could you please help

fgrunewald commented 1 year ago

@mmidhun97 your force-field files in /home/midhun/big/simulationfiles/Martini/martinize2/martini_v300/martini_v3.0.0_proteins/ are out of date with the martinize version you are using. You can either install an older version from pypi or use the force-field that ships with martinize.

mmidhun97 commented 1 year ago

@fgrunewald Thank you for your reply . But im using the recent Martini force field . Then also this happening. Here im attaching the link

http://cgmartini.nl/images/martini_v300.zip.

and im using the script as follows

$python $martinize -f $pdb -o PRO_topol.top -x PRO_CG.pdb -ff $FF -dssp $dssp -cys auto -elastic -ef 700.0 -el 0.5 -eu 0.9 -ea 0 -ep 0 -scfix -ff-dir $ffdir/martini_v3.0.0_proteins/force_fields/ -map-dir $ffdir/martini_v3.0.0_proteins/mappings/

I dont know its the problem with the version or the script. Thanking you.

fgrunewald commented 1 year ago

@mmidhun97 the version in the website is in fact not the most up-to date version. Instead try using:

$python $martinize -f $pdb -o PRO_topol.top -x PRO_CG.pdb -ff $FF -dssp $dssp -cys auto -elastic -ef 700.0 -el 0.5 -eu 0.9 -ea 0 -ep 0 -scfix -ff martini3001
mmidhun97 commented 1 year ago

@fgrunewald

Now this script is working . Could you please explain what mistake i have made.

fgrunewald commented 1 year ago

The issue is that the martini protein force-field input files, which are provided on the cgmartini.nl website are not the most recent ones. Now instead of using these data files you are using the most recent version that is shipped with martinize2

mmidhun97 commented 1 year ago

@fgrunewald

Thank you for the help fabin.

fgrunewald commented 1 year ago

you're welcome. I'm going to close the issue as it seems resolved now.