Data Models (mofa.model
)#
Data models for a MOF class
- class mofa.model.LigandDescription(name: str | None = None, smiles: str | None = None, xyz: str | None = None, anchor_type: str | None = None, prompt_atoms: list[list[int]] | None = None, dummy_element: str | None = None, metadata: dict[str, int | float | str] = <factory>)#
Bases:
object
Description of organic sections which connect inorganic nodes
- anchor_constrained_optimization(xyz_tol=0.001, force_constant=10000.0, max_iterations=1000)#
optimize the ligand while the anchor atoms are constrained
- Parameters:
xyz_tol – coordinate tolerance for constrained atoms
force_constant – the spring force constant to keep the constrained atoms in original position
max_iterations – maximum number of iterations for optimization
- Returns:
inplace function, no return
- property atoms#
- classmethod from_yaml(path: Path) LigandDescription #
Load a ligand description from YAML
- Parameters:
path – Path to the YAML file
- Returns:
The ligand description
- full_ligand_optimization(max_iterations=1000)#
optimize the ligand while the anchor atoms are constrained
- Parameters:
max_iterations – maximum number of iterations for optimization
- Returns:
inplace function, no return
- prompt_atoms: list[list[int]] | None = None#
Groups of atoms which attach to the nodes
There are typically two groups of fragment atoms, and these are never altered during MOF generation.
- replace_with_dummy_atoms() Atoms #
Replace the fragments which attach to nodes with dummy atoms
- Returns:
ASE atoms version of the molecule where the anchor atoms have been replaced with a single atom of the designated dummy type
- class mofa.model.LigandTemplate(anchor_type: str, xyzs: tuple[str], dummy_element: str)#
Bases:
object
Beginning of a new ligand to be generated.
Contains a prompt that includes both the anchor groups (i.e., those which connect to the node) and additional context atoms.
- create_description(atom_types: list[str], coordinates: ndarray) LigandDescription #
Produce a ligand description given atomic coordinates which include the infilled atoms
Assumes the provided coordinates are of the backbone atom and do not include Hydrogens. Adds in the hydrogens from the original prompt and infers them for the new symbols
- Parameters:
atom_types – Types of all atoms as chemical symbols
coordinates – Coordinates of all atoms
- Returns:
Ligand description using the new coordinates
- classmethod from_yaml(path: Path | str) LigandTemplate #
Load a template description from YAML
- Parameters:
path – Path to the YAML file
- Returns:
The ligand template
- class mofa.model.MOFRecord(name: str | None = None, identifiers: dict[str, str] = <factory>, topology: str | None = None, catenation: int | None = None, nodes: tuple[~mofa.model.NodeDescription, ...] = <factory>, ligands: tuple[~mofa.model.LigandDescription, ...] = <factory>, structure: str | None = None, md_trajectory: dict[str, list[tuple[int, str]]] = <factory>, gas_storage: dict[str, float | tuple[float, float]] = <factory>, structure_stability: dict[str, float] = <factory>, times: dict[str, ~datetime.datetime] = <factory>, in_progress: list[str] = <factory>)#
Bases:
object
Information available about a certain MOF
- property atoms: Atoms#
The structure as an ASE Atoms object
- classmethod from_file(path: Path | str, read_kwargs: dict | None = None, **kwargs) MOFRecord #
Create a MOF description from a structure file on disk
The file will be read using ASE’s
read
function.Keyword arguments can include identifiers of the MOF and will be passed to the constructor.
- Parameters:
path – Path to the file
read_kwargs – Arguments passed to the read function
- Returns:
A MOF record before fragmentation
- gas_storage: dict[str, float | tuple[float, float]]#
Storage capacity of the MOF for different gases and pressures. Key is the name of the gas, value is a single capacity value or the capacity at different pressures (units g/L)
- ligands: tuple[LigandDescription, ...]#
Description of each linker within the structure
- md_trajectory: dict[str, list[tuple[int, str]]]#
Structures of the molecule produced during molecular dynamics simulations.
The key of the dictionary is the name of the method (e.g., forcefield) used for the molecular dynamics. The values are a list of pairs of the MD timestep and the structure at that timestep
- nodes: tuple[NodeDescription, ...]#
Description of the nodes within the structure
- structure_stability: dict[str, float]#
How likely the structure is to be stable according to different assays. The value is the strain between the first and last timestep. Larger values indicate worse stability
The strain for each assay should correspond to the strain from the longest trajectory in
md_trajectory