Skip to content

Integral net charge check for patching is incompatible with CHARMM36 nucleic acid FF #1396

@epretti

Description

@epretti

When ParmEd tries to apply a patch to a residue, it checks to see if the net charge of the patched residue is integral:

# Check that the net charge is integral.
net_charge = residue.net_charge
is_integral = (round(net_charge, precision) - round(net_charge)) == 0.0
if not is_integral:
raise IncompatiblePatchError(f'Patch is not compatible with residue due to non-integral charge (charge was {net_charge}).')

This is incompatible with the CHARMM36 nucleic acid force field, as I found when trying to convert it to OpenMM FFXML format. Specifically, applying terminal patches to the residues at the ends of a chain of nucleic acids can yield patched residues with non-integral net charges, even though the final chain will have an integral net charge.

I hacked around this for our conversion by removing the check, but it's not clear if that's a good idea in general, so maybe an option to disable it if desired would be better?

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