qp.manager.charge_embedding.load_custom_charges

qp.manager.charge_embedding.load_custom_charges(filepath)[source]

Load custom partial charges from a JSON file.

The JSON file must contain a nested dictionary keyed first by residue name, then by atom name, with partial charges as float values.

Parameters:

filepath (str) – Path to the JSON file.

Returns:

Nested {residue_name: {atom_name: charge}} dictionary, in the same format returned by get_ff14SB_dict().

Return type:

dict

Raises:
  • FileNotFoundError – If filepath does not exist.

  • json.JSONDecodeError – If the file contents are not valid JSON.

Examples

A minimal JSON file might look like:

{
    "ALA": {"N": -0.4157, "H": 0.2719, "CA": 0.0337},
    "GLY": {"N": -0.4157, "H": 0.2719}
}