xnn.ffnn.models.charmmlib.CharmmLibrary#
- class xnn.ffnn.models.charmmlib.CharmmLibrary(atom_types=<factory>, bond_types=<factory>, angle_types=<factory>, urey_bradley_types=<factory>, dihedral_types=<factory>, improper_types=<factory>, nbfix_types=<factory>, coulomb_constant=332.0716, scale_14_coulomb=1.0, name='charmm', references=<factory>, templates=<factory>, fragments=<factory>, metadata=<factory>, notes=<factory>)[source]#
Bases:
objectA parsed CHARMM parameter library, in CHARMM units.
Energies are kcal/mol, lengths Angstrom, angles degrees. Bonded parameters are keyed by the atom types of the term joined with
-("CT3-CT3","X-CT3-CT3-X");Xis the wildcard.Parameters and attributes#
- atom_typesdict[str, dict]
name -> {"element", "mass", "rstar", "epsilon", "rstar14", "epsilon14", "connections", "comment"};rstarisRmin/2in Angstrom andepsilonthe well depth in kcal/mol;rstar14/epsilon14are the type’s own 1,4 values orNonewhen it has none (the regular values then apply).- bond_typesdict[str, dict]
"A-B" -> {"k", "r0"}forE = k (r - r0)^2.- angle_typesdict[str, dict]
"A-B-C" -> {"k", "theta0"}forE = k (theta - theta0)^2.- urey_bradley_typesdict[str, dict]
"A-B-C" -> {"k", "s0"}forE = k (S - s0)^2on the A…C distance (only the angles that carry a Urey-Bradley term).- dihedral_typesdict[str, dict]
"A-B-C-D" -> {"terms": [[K, n, delta], ...]}forE = sum K [1 + cos(n phi - delta)]per dihedral.- improper_typesdict[str, dict]
"I-J-K-L" -> {"k", "psi0"}forE = k (psi - psi0)^2withpsithe dihedral angle over the four atoms in the order given; keys are kept as written (the central atom first in CHARMM’s topology files, last in many rows of its parameter files) and match a quadruple in either direction.- nbfix_typesdict[str, dict]
"A-B" -> {"rmin", "eps", "rmin14", "eps14"}pair overrides of the Lennard-Jones parameters (rminis the pair’s own minimum distance; the 1,4 entries may beNone, meaning the same).- coulomb_constantfloat
The Coulomb constant in kcal Angstrom / (mol e^2).
- scale_14_coulombfloat
Scaling of the 1,4 electrostatics (1 for CHARMM).
- namestr
A short label for the parameter set.
- referenceslist[str]
Literature provenance of the parameters.
- templatesdict
Per-type SMARTS templates (
type -> {"smarts": [...], ...}).- fragmentsdict
Residue templates (
name -> {"SMARTS", "atom names", "atom types", "charges", "impropers", ...}), consumed byassign_atom_types()andplace_impropers().- metadatadict
The
#metadataentries.- noteslist[str]
Anything the reader had to fill in.
- urey_bradley(key)[source]#
The Urey-Bradley entry of
"A-B-C"in either orientation (Noneif absent).
- torsion(key)[source]#
The torsion entry whose key is
"A-B-C-D"or its reverse, exactly (no wildcard matching;Noneif absent).
- save(path)[source]#
Write the library as native JSON (read back by
read_charmm()).- Parameters:
path (str or Path) – Output file path (conventionally
*.json).- Return type:
None