pestifer.charmmff.make_pdb_collection module

This module implements the make-pdb-collection subcommand. It generates a PDB collection from the CHARMM force field residue database. The purpose is to generate 3D structures for all standalone (small-molecule) residues defined in the CHARMM force field, which can be used for molecular dynamics simulations and system preparation.

pestifer.charmmff.make_pdb_collection.do_cleanup(resname, dirname)[source]

Remove all files in the directory except for the init.tcl, info.yaml, and *.psf files.

pestifer.charmmff.make_pdb_collection.do_psfgen(resid: str, DB: CHARMMFFContent, RM: ResourceManager = None, lenfac: float = 1.2, minimize_steps: int = 500, sample_steps: int = 5000, nsamples: int = 10, sample_temperature: float = 300, refic_idx: int = 0, force_constant: float = 1.0, borrow_ic_from: str = None)[source]

Generate a PDB file for a residue defined by the CHARMM force field using psfgen, and sample it using NAMD. Also generate the info.yaml file for this residue.

This function uses the pdibble.pdbparse.PDBParser to read in generated PDB files and PSFContents to read in generated PSF files to make measurements needed for the info.yaml files.

Parameters:
  • resid (str) – The residue ID for which to generate the PDB file.

  • DB (CHARMMFFContent) – The database containing CHARMM residue information.

  • lenfac (float, optional) – The lengthening factor to apply to the residue (default is 1.2).

  • minimize_steps (int, optional) – The number of minimization steps to perform (default is 500).

  • sample_steps (int, optional) – The total number of sampling steps to perform (default is 5000).

  • nsamples (int, optional) – The number of samples to generate (default is 10).

  • sample_temperature (float, optional) – The temperature to use for sampling (default is 300 K).

  • refic_idx (int, optional) – The index of the reference IC to use (default is 0).

  • force_constant (float, optional) – The force constant to use for sampling (default is 1.0).

  • borrow_ic_from (str, optional) – The residue ID from which to borrow internal coordinates (default is None).

pestifer.charmmff.make_pdb_collection.do_resi(resi: str, DB: CHARMMFFContent, RM: ResourceManager = None, outdir: str = 'data', faildir: str = 'fails', force: bool = False, lenfac: float = 1.2, cleanup: bool = True, minimize_steps: int = 500, sample_steps: int = 5000, nsamples: int = 10, sample_temperature: float = 300, refic_idx: int = 0, force_constant: float = 1.0, borrow_ic_from: str = None)[source]

Manager function for do_psfgen(). Makes sure it operates in the correct subdirectories and handles success/failure cases.

Parameters:
  • resi (str) – The residue ID for which to generate the PDB file.

  • DB (CHARMMFFContent) – The database containing CHARMM residue information.

  • lenfac (float, optional) – The lengthening factor to apply to the residue (default is 1.2).

  • minimize_steps (int, optional) – The number of minimization steps to perform (default is 500).

  • sample_steps (int, optional) – The total number of sampling steps to perform (default is 5000).

  • nsamples (int, optional) – The number of samples to generate (default is 10).

  • sample_temperature (float, optional) – The temperature to use for sampling (default is 300 K).

  • refic_idx (int, optional) – The index of the reference IC to use (default is 0).

  • force_constant (float, optional) – The force constant to use for sampling (default is 1.0).

  • borrow_ic_from (str, optional) – The residue ID from which to borrow internal coordinates (default is None).

pestifer.charmmff.make_pdb_collection.make_pdb_collection(args)[source]

Make a PDBCollection from the CHARMMFFContent. This function will create a PDBCollection from the CHARMMFFContent, either for a specific RESI or for all RESIs in a specified stream. If a specific RESI is provided, it will create a collection member for that RESI and save it in the specified output directory. If a stream ID is provided, it will create a collection for all RESIs in that stream. If no stream ID is provided, it will create a collection for all RESIs in the CHARMMFFContent. The output directory will be created if it does not exist, and if the --fail-dir argument is provided, it will create a directory for failed RESIs in that directory. If the --force argument is set, it will force the recalculation of the RESI, even if it has been built previously. If the --cleanup argument is set, it will remove all files in the RESI directory except for the init.tcl, info.yaml, and psf files. The --lenfac, --minimize-steps, --sample-steps, --nsamples, --sample-temperature, --refic-idx, and --force-constant arguments will be passed to the do_resi() function to control the sampling and equilibration of the RESI.