Manim Chemistry Molecules

class manim_chemistry.manim_chemistry_molecule.mc_molecule.MCMolecule(atoms: List[MCAtom] | None = None, bonds: List[MCBond] | None = None, name: str | None = None)[source]

Abstraction of a molecule made of: - MCAtoms. - MCBonds. - Molecule name. - Extra properties (To be defined)

add_atoms_from_atoms_dict(atoms_dict: Dict)[source]

Uses the atoms dict returned by a parser to add the atoms to the molecule.

Args:

atoms_dict (Dict): Atoms dict from a parser. See BaseParser.

add_bonds_from_bonds_dict(bonds_dict: Dict)[source]

Uses the bonds dict returned by a parser to add the bonds to the molecule.

Args:

bonds_dict (Dict): Bonds dict from a parser. See Base Parser.

add_connections_between_atoms()[source]

Uses the MCBonds to add connections between MCAtoms.

static construct_from_data_dict(atoms_data_dict: dict, bonds_data_dict: dict, ignore_hydrogens: bool = True, ignore_all_hydrogens: bool = False)[source]

Given data with the format provided by a parser, constructs a MCMolecule, the corresponding MCAtoms and MCBonds and stablishes the connections between MCAtoms and bonds.

Args:

atoms_data_dict (dict): Atoms data bonds_data_dict (dict): Bonds data

static construct_from_file(filepath, ignore_hydrogens: bool = True, ignore_all_hydrogens: bool = False)[source]

Returns an MCMolecule given a file path.

Args:

filepath: File path

static construct_from_string(string: str, format: str = 'json', ignore_hydrogens: bool = True, ignore_all_hydrogens: bool = False)[source]

Reads a string and returns a molecule. Supported formats are: - mol - sdf - asnt - json - xml

Uses json format by default.

static construct_multiples_from_file(filepath, ignore_hydrogens: bool = True, ignore_all_hydrogens: bool = False)[source]

Similar to construct_from_file but returning a list of MCMolecules.

static construct_multiples_from_string(string: str, format: str = 'json', ignore_hydrogens: bool = True, ignore_all_hydrogens: bool = False)[source]

Similar to construct_from_string but returning a list of MCMolecules.