Skip to content

cmaps are not correctly merged with Merge() #3672

@ksy141

Description

@ksy141

Is your feature request related to a problem?

I don't think cmaps is properly considered as TopologyObjects.

u1 = mda.Universe('xxx.pdb')
u2 = mda.Universe('xxx.pdb')

u1.add_TopologyAttr('cmaps', [[0,1,2,3,4]])
u2.add_TopologyAttr('cmaps', [[4,5,6,7,8]])
mda.Merge(u1.atoms, u2.atoms)

run into the error:
TypeError: Encountered unexpected topology attribute of type <class 'MDAnalysis.core.topologyobjects.TopologyGroup'> (no numpy)

Describe the solution you'd like

Simply adding 'cmaps' in the line 1522 of MDAnalysis/core/universe.py will fix this.
before: tops = set(['bonds', 'angles', 'dihedrals', 'impropers'])
after: tops = set(['bonds', 'angles', 'dihedrals', 'impropers', 'cmaps'])

Describe alternatives you've considered

I think the above is simple and a proper way to handle this.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions