Checks
check module.
The module contains the necessary checks to corroborate the success of the algorithm to obtain the molecule’s FragmentationModel subgroups.
- check_atoms_fragments_presence(molecule: Mol, fragments: dict) tuple[bool, ndarray] [source]
Find overlapped atoms and free atoms.
Check the detected fragments to find the atoms that appears in more than one fragment (overlapping), and the atoms that are not present in any fragment (free atoms). Returning two np.ndarray with the indexes of the overlapping and free atoms.
Example of a fragments dictionary that not presents overlapping atoms. For example N-hexane:
{ 'CH3_0': (0,), 'CH3_1': (5,), 'CH2_0': (1,), 'CH2_1': (2,), 'CH2_2': (3,), 'CH2_3': (4,) }
Example of a fragments dictionary that presents overlapping atoms. For example toluene:
{ 'CH3_0': (0,), 'ACH_0': (2,), 'ACH_1': (3,), 'ACH_2': (4,), 'ACH_3': (5,), 'ACH_4': (6,), 'AC_0': (1,), 'ACCH3_0': (1, 0) }
- Parameters:
molecule (Chem.rdchem.Mol) – RDKit molecule object.
fragments (dict) – Dictionary containing the fragments detected in the molecule. The keys are the group names and the values are the indexes of the atoms in the group.
- Returns:
Overlapping atoms indexes and free atoms indexes.
- Return type:
tuple[np.ndarray, np.ndarray]