Parameter Database#

Use tmol.ParameterDatabase to load the chemical and scoring parameters used to construct poses and score functions; it is imported from the top-level package and documented in Top-level API. The scoring parameter records it contains are exported by tmol.database.scoring.

Typed schemas and loaders for TMol scoring parameters.

class tmol.database.scoring.CartBondedDatabase(residue_params: dict[str, CartRes], hash: str, connection_params: Tuple[ConnectionCartRes, ...] = ())[source]#

Bases: object

Bonded records by base or exact patched residue name.

An exact patched name supplies a complete CartRes replacement for that type. Other variants fall back to their base name. Wildcard parameter and explicit connection-record precedence are unchanged.

class tmol.database.scoring.GenBondedDatabase(atom_hierarchy: Dict[str, List[str]], rosetta_typed: FrozenSet[str], torsions: Tuple[GenBondedTorsionEntry, ...], impropers: Tuple[GenBondedImproperEntry, ...], coverage: Dict[str, int], multi_max: int)[source]#

Bases: object

Database for the genbonded (generic-bonded torsional) scoring term.

atom_hierarchy – maps each concrete atom-type name to an ordered list of

types to try when looking up a parameter entry, from most specific to most generic. e.g. {“CS”: [“CS”, “C*”, “X”]}

rosetta_typed – the atom types the Rosetta terms score directly. Their

hierarchies exist only so a dihedral that straddles the boundary can be looked up; a dihedral whose two central atoms are both of this kind is left to those terms.

torsions – ordered list of torsion entries (most-specific first so

that a linear scan finds the best match quickly).

impropers – ordered list of improper torsion entries (center + 3

bonded atoms; order of bonded atoms is unordered).

coverage – maps each atom-type string to the count of concrete types

whose hierarchy includes that string. Used for Rosetta- style multiplicity scoring.

multi_max – half the total number of concrete atom types; scales the

bond-type contribution to multiplicity so that bond specificity dominates atom-type specificity (mirrors Rosetta’s multi_max = indicesX.size() / 2).

all_type_names() → List[str][source]#

Sorted list of all unique chemical type strings in the database.

make_type_to_idx() → Dict[str, int][source]#

Return a dict mapping every chemical type string to a unique int index.

hierarchy_for(atom_type: str) → List[str][source]#

Return the fallback list for atom_type, defaulting to [atom_type].

find_torsion_params(type1: str, type2: str, type3: str, type4: str, bond_type_int: int, is_ring: bool) → GenBondedTorsionEntry | None[source]#

Return the best-matching torsion entry using Rosetta’s multiplicity scoring.

Multiplicity = bond_bin_count * multi_max^4 + coverage(a1)*…*coverage(a4)

Bond specificity dominates: an entry with a more-specific bond char (fewer covered bins) beats one with a less-specific bond char regardless of atom-type generality, as long as both match. Within the same bond specificity, atom-type coverage breaks ties (lower = more specific).

Equal multiplicities use source order in either torsion direction.

This mirrors Rosetta’s GenericBondedPotential multiplicity formula exactly:

multBT = indicesBT.size() * multi_max^4 mult_atm = indices1.size() * indices2.size() * indices3.size() * indices4.size() multiplicity = multBT + mult_atm (lower = more specific = preferred)

find_improper_params(center: str, n1: str, n2: str, n3: str) → GenBondedImproperEntry | None[source]#

Return the best-matching improper entry for (center, n1, n2, n3).

The three bonded atoms (n1, n2, n3) are considered unordered: all six permutations are tried. ‘Best’ is the lowest total hierarchy-position score. Returns None if no match is found.

class tmol.database.scoring.NaTorsionDatabase(global_parameters: Dict[str, NaTorsionGlobalParams], backbone_means: Dict[str, Dict[str, Tuple[float, ...]]], sugar_means: Dict[str, Dict[str, Dict[str, Tuple[float, ...]]]], well_energies: Dict[str, NaTorsionWells])[source]#

Bases: object

Mean nucleic acid torsion angles by bin, one parameter set per polymer.

Generated by tmol/support/scoring/na_torsion_param_import.py. Every field is keyed “dna” or “rna” first; the functional form is shared, the numbers are not. Backbone means are then keyed by torsion name (3 bins for alpha/gamma, 2 for the rest); sugar means by torsion name then “all”, except chi which is per base – acgt for DNA, acgu for RNA.

Was this page helpful?

Was this page helpful?