<jupyter_start><jupyter_text>**Install conda and rdkit and fragment a molecule**---<jupyter_code>! wget https://repo.anaconda.com/miniconda/Miniconda3-py37_4.8.2-Linux-x86_64.sh
! chmod +x Miniconda3-py37_4.8.2-Linux-x86_64.sh
! bash ./Miniconda3-py37_4.8.2-Linux-x86_64.sh -b -f -p /usr/local
! conda install -c rdkit rdkit -y
import sys
sys.path.append('/usr/local/lib/python3.7/site-packages/')
from rdkit import Chem
from rdkit.Chem import Recap
m = Chem.MolFromSmiles('c1ccccc1OCCOC(=O)CC')
hierarch = Recap.RecapDecompose(m)
type(hierarch)
hierarch.smiles
ks=hierarch.children.keys()
sorted(ks)
ks=hierarch.GetLeaves().keys()
ks=sorted(ks)
ks

leaf = hierarch.GetLeaves()[ks[0]]
Chem.MolToSmiles(leaf.mol)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15654520917678813, 'fraction_numerical': 0.04723346828609987, 'mean_word_length': 5.508771929824562, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '559329', 'license': 'MIT', 'n_tokens_mistral': 351, 'n_tokens_neox': 326, 'n_words': 50, 'path': 'conda-rdkit-smiles-fragmentation-recap.ipynb', 'repo_name': 'quantaosun/notebook', 'size': '741'}