- class matlantis_features.atoms.MatlantisAtoms(atoms: Atoms)#
-
Bases:
object
MatlantisAtoms object is a collection of atoms used in matlantis-features and wraps ase.Atoms class.
- __init__(atoms: Atoms)#
-
Initialize an instance.
- Parameters
-
atoms (ASEAtoms) – A collection of atoms specified by AseAtoms.
- property ase_atoms: Atoms#
-
Get the AseAtoms corresponding to the object.
- Returns
-
The AseAtoms corresponding to the object.
- Return type
-
ASEAtoms
- copy() MatlantisAtoms #
-
Get a copy of the MatlantisAtoms object.
- Returns
-
Copy of the atoms.
- Return type
- classmethod from_ase_atoms(atoms: Atoms) MatlantisAtoms #
-
A classmethod to convert ASEAtoms to MatlantisAtoms.
- Parameters
-
atoms (ASEAtoms) – AseAtoms object to convert.
- Returns
-
MatlantisAtoms corresponding to the input AseAtoms.
- Return type
- classmethod from_dict(res: Dict[str, Any]) MatlantisAtoms #
-
Construct a MatlantisAtoms object from serialized dict.
- Parameters
-
res (dict[str, Any]) – A dict containing a serialized MatlantisAtoms from to_dict().
- Returns
-
The deserialized object from provided dict.
- Return type
- classmethod from_file(file: Union[str, Path]) MatlantisAtoms #
-
A classmethod to get MatlantisAtoms from a file using ase.io.read function.
- Parameters
-
file (str or pathlib.Path) – A path to file to convert.
- Returns
-
MatlantisAtoms corresponding to the input file.
- Return type
- classmethod from_rdkit_mol(mol: Mol) MatlantisAtoms #
-
A classmethod to get MatlantisAtoms from an rdkit.Chem.Mol object. The positions of atoms should be set.
- Parameters
-
mol (Mol) – An rdkit.Chem.Mol object to convert.
- Returns
-
MatlantisAtoms corresponding to the input Mol object.
- Return type
- classmethod from_smiles(smiles: str, method: str = ‘etkdg_v2’, seed: int = -1) MatlantisAtoms #
-
A classmethod to get MatlantisAtoms from a SMILES.
- Parameters
-
-
smiles (str) – A SMILES string to convert.
-
method (str, optional) – An algorithm for position embedding. The algorithm can be selected from
["etkdg_v2", "etkdg", "etdg", "kdg", "2d"]
. Defaults to ‘etkdg_v2’. -
seed (int, optional) – A random seed for position embedding. Defaults to (-1).
-
- Returns
-
MatlantisAtoms corresponding to the input SMILES.
- Return type
- property numbers: ndarray#
-
Get the array of atomic numbers of the atoms.
- Returns
-
The array of atomic numbers of the atoms.
- Return type
-
np.ndarray
- property positions: ndarray#
-
Get the array of coordinates of the atoms.
- Returns
-
The array of coordinates of the atoms.
- Return type
-
np.ndarray
- rotate_atoms_to_upper() None #
-
Rotate the MatlantisAtoms inplace to make its cell a upper triangular matrix.
- to_dict() Dict[str, Any] #
-
Dictionary representation of the MatlantisAtoms.
- Returns
-
The dictionary containing the serialized MatlantisAtoms.
- Return type
-
dict[str, Any]
Resource Library
matlantis_features.atoms