RTFContainer

A class for reading and CHARMM .rtf topology files.

Index

RTFContainer(mass, atom, bond, impr, angles, ...)

A class for managing CHARMM .rtf topology files.

RTFContainer.collapse_charges()

Return a dictionary mapping atom types to atomic charges.

RTFContainer.auto_to_explicit()

Convert all statements in auto into explicit dataframe.

RTFContainer.from_file(path)

Construct a new RTFContainer from the passed file path.

RTFContainer.concatenate(rtf_iter)

Concatenate multiple RTFContainers into a single instance.

API

class FOX.RTFContainer(mass, atom, bond, impr, angles, dihe, charmm_version=(0, 0), auto=None)[source]

A class for managing CHARMM .rtf topology files.

Examples

>>> from FOX import RTFContainer

>>> input_file = str(...)
>>> rtf = RTFContainer.from_file(input_file)
mass

A dataframe holding all MASS-related info.

atom

A dataframe holding all ATOM-related info.

bond

A dataframe holding all BOND-related info.

property impropers

A dataframe holding all IMPR-related info.

angles

A dataframe holding all ANGLES-related info.

property dihedrals

A dataframe holding all DIHE-related info.

charmm_version

The CHARMM version used for generating the .rtf file

auto

A set with all .rtf statements that should be auto-generated.

RTFContainer.collapse_charges()[source]

Return a dictionary mapping atom types to atomic charges.

Return type:

dict[str, float]

Raises:

ValueError: – Raised if an atom type has multiple unique charges associated with it

RTFContainer.auto_to_explicit()[source]

Convert all statements in auto into explicit dataframe.

classmethod RTFContainer.from_file(path)[source]

Construct a new RTFContainer from the passed file path.

Parameters:

path (path-like object) – The path to the .rtf file

Returns:

A newly constructed .rtf container

Return type:

FOX.RTFContaier

RTFContainer.concatenate(rtf_iter)[source]

Concatenate multiple RTFContainers into a single instance.

Parameters:

prm_iter (list[FOX.RTFContainer]) – A list with other RTFContainers to concatenate

Returns:

The new concatenated RTFContainer

Return type:

FOX.PRMContainer