qp.manager.charge_embedding.parse_pdb_to_xyz

qp.manager.charge_embedding.parse_pdb_to_xyz(pdb_file_path, output_file_path, qm_centroid, cutoff_distance)[source]

Convert PDB with charges to TeraChem point charge XYZ format.

Reads the B-factor column (containing ff14SB partial charges) from the PDB file and writes atoms within the cutoff distance of the QM centroid to a point charge file.

Selection is residue-based: if any atom in a residue falls within the cutoff distance of the QM centroid, all atoms of that residue are included. This prevents partial residues with non-integer charge contributions.

Parameters:
  • pdb_file_path (str) – Path to PDB file with charges in B-factor column.

  • output_file_path (str) – Path for the output point charge file (ptchrges.xyz).

  • qm_centroid (array-like of shape (3,)) – Centroid of the QM cluster for distance calculations.

  • cutoff_distance (float) – Maximum distance in angstroms from centroid to include. If any atom of a residue is within this distance, the entire residue is included.