Top-level API#

The top-level package provides convenience imports for the most common TMol objects and workflows. Their full documentation lives in the owning packages, such as tmol.io, tmol.pose, and tmol.score.

Core objects#

CanonicalOrdering

The canonical ordering class describes the integer ordering of residue types and for atoms within those residue types for the collection of available residue types defined by a PatchedChemicalDatabase.

CartesianMoveMap

Move map for Cartesian-space minimization.

ConstraintEnergyTerm

Score coordinate and geometric constraints attached to a pose stack.

ConstraintSet

Immutable batched coordinate constraints and their tensor storage.

EdgeType

Kinds of directed connections represented in a fold forest.

FoldForest

The fold forest will define the fold trees for the poses in a PoseStack.

KinematicModuleData

Topology and traversal tensors required by a pose kinematics module.

MoveMap

Hierarchical internal-coordinate degrees of freedom for a pose stack.

PackedBlockTypes

A class to aggregate the properties for a collection of residue types.

ParameterDatabase

Immutable chemical and scoring parameter container used by tmol.

PoseStack

Batch of molecular systems with shared residue-type definitions.

ScoreFunction

Weighted collection of energy terms rendered for a pose topology.

ScoreType

Stable indices for energy terms in score-function weight tensors.

Structure and chemistry#

atom_records_from_pose_stack

Create a numpy array holding the atom records needed to write a PDB file from a PoseStack.

canonical_form_from_openfold

The canonical form is intended to represent a stable, serializable intermediate format for a structure so that it can be created today and then be read in years from now and be used to construct a PoseStack in tmol.

canonical_form_from_pdb

Create a canonical form from either the contents of a PDB file as one long string or a list of individual lines from the file or by providing the name/path of a PDB file

canonical_form_from_rosettafold2

The canonical form is intended to represent a stable, serializable intermediate format for a structure so that it can be created today and then be read in years from now and be used to construct a PoseStack in tmol.

canonical_ordering_for_openfold

Construct the CanonicalOrdering object that will be used for the subset of residue types that are used by OpenFold; this will be stable so that the entries in "coords" tensor member of the canonical form dictionary will be interpretable indefinitely and thus a canonical form dictionary can be serialized to disk and read again after an arbitrary amount of time

canonical_ordering_for_rosettafold2

Construct the CanonicalOrdering object that will be used for the subset of residue types that are used by RoseTTAFold2; this will be stable so that the entries in "coords" tensor member of the canonical form dictionary will be interpretable indefinitely and thus a canonical form dictionary can be serialized to disk and read again after an arbitrary amount of time

default_canonical_ordering

Create a CanonicalOrdering object from the default set of residue types

default_packed_block_types

Create a PackedBlockTypes object from the default set of residue types

extended_pose_stack_from_sequences

Build a PoseStack from sequences with ideal geometry and extended backbone torsions.

one2three

Return the three-letter amino acid code given its one-letter code, or None if not a valid one-letter code.

packed_block_types_for_openfold

Construct the PackedBlockTypes (PBT) object that will be used for the subset of residue types that are used by OpenFold.

packed_block_types_for_rosettafold2

Construct the PackedBlockTypes (PBT) object that will be used for the subset of residue types that are used by RoseTTAFold2.

pose_stack_from_canonical_form

Build a pose stack from tensors in canonical atom ordering.

pose_stack_from_openfold

Build a PoseStack from the output generated by openfold

pose_stack_from_pdb

Construct a PoseStack given the contents of a PDB file or the name of a PDB file, using the full set of residue types contained in tmol's chemical.yaml file.

pose_stack_from_rosettafold2

Build a PoseStack from the output generated by RoseTTAFold2

pose_stack_to_pdb_string

Convert a PoseStack into PDB text suitable for molecular viewers.

selection_gallery

Return one interactive viewer for several labeled AtomArray selections.

switchable_view

Return HTML that switches one 3Dmol viewer among labeled structures.

three2one

Return the one-letter amino acid code given its three letter code, or None if not a valid three-letter code

view

Create a draggable py3Dmol viewer for a molecular structure.

write_pose_stack_pdb

Write a PDB-formatted file to disk given an input PoseStack.

Scoring and optimization#

beta2016_score_function

Return a ScoreFunction implementing the beta_nov2016_cart score function of Rosetta3.

build_kinforest_network

Build a differentiable kinematic scoring network for a pose stack.

create_mainchain_coordinate_constraints

Add coordinate constraints for every declared polymer main-chain atom.

fast_relax

Relax poses through repeated side-chain packing and minimization.

get_named_torsions

Measure named torsions.

get_torsion_names

Names of the torsions defined on a block's type, in database order.

run_cart_min

Run minimization on a PoseStack in Cartesian coordinate space.

run_kin_min

Run minimization on a PoseStack in internal DOF space.

run_min

Run minimization on any sfxn module (Cartesian or KinForest).

set_named_torsions

Set named torsions, returning a new PoseStack.

C++ and CUDA integration#

TMol: GPU-accelerated molecular modeling with PyTorch.

tmol.include_paths()[source]#

C++/CUDA include paths for tmol components.

Defined before other imports because JIT extension loading (tmol.utility._cpp_extension) imports this during module init.