Skip to content

Gromacs topology parser #401

@subhamoymahajan

Description

@subhamoymahajan

If bond types are not specified under "[ bondtypes ]", and mentioned under molecule definitions in .top file, atom types (e.g., "cd") are not converted to integers leading to error in "gromacs/gromacs_parser.py line 805".

 File "convert.py", line 811, in <module>
    main()
  File "convert.py", line 223, in main
    system, prefix, gro_in, top_in = _load_gromacs(gromacs_files=args['gro_in'])
  File "convert.py", line 573, in _load_gromacs
    system = gmx.load(top_in, gro_in)
  File "/srv/home/smahajan29/softwares/InterMol/intermol/gromacs/gromacs_parser.py", line 38, in load
    return parser.read()
  File "/srv/home/smahajan29/softwares/InterMol/intermol/gromacs/gromacs_parser.py", line 419, in read
    self.create_moleculetype(top_moltype, mol_name, mol_count)
  File "/srv/home/smahajan29/softwares/InterMol/intermol/gromacs/gromacs_parser.py", line 727, in create_moleculetype
    self.create_bond(bond)
  File "/srv/home/smahajan29/softwares/InterMol/intermol/gromacs/gromacs_parser.py", line 805, in create_bond
    atoms = [int(n) for n in bond[:n_atoms]]
  File "/srv/home/smahajan29/softwares/InterMol/intermol/gromacs/gromacs_parser.py", line 805, in <listcomp>
    atoms = [int(n) for n in bond[:n_atoms]]
ValueError: invalid literal for int() with base 10: 'cd'

Currently modifying the topology file to defined bondtypes resolves the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions