code: def __init__(self, smiles, bayesian_optimization=False):
      self.smiles = smiles
      self.mol = get_mol(smiles)
  
      # Stereo Generation
      if bayesian_optimization:
          mol = Chem.MolFromSmiles(smiles)
          self.smiles3D = Chem.MolToSmiles(mol, isomericSmiles=True)
          self.smiles2D = Chem.MolToSmiles(mol)
          self.stereo_cands = decode_stereo(self.smiles2D)
  
      cliques, edges = tree_decomp(self.mol)
      self.nodes = []
      root = 0
      for i, c in enumerate(cliques):
          cmol = get_clique_mol(self.mol, c)
          node = MolTreeNode(get_smiles(cmol), c)
          self.nodes.append(node)
          if min(c) == 0:
              root = i
  
      for x, y in edges:
          self.nodes[x].add_neighbor(self.nodes[y])
          self.nodes[y].add_neighbor(self.nodes[x])
  
      if root > 0:
          self.nodes[0], self.nodes[root] = (
              self.nodes[root],
              self.nodes[0],
          )
  
      for i, node in enumerate(self.nodes):
          node.nid = i + 1
          if len(node.neighbors) > 1:  # Leaf node mol is not marked
              set_atommap(node.mol, node.nid)
          node.is_leaf = len(node.neighbors) == 1
  
file_path: DIG/dig/ggraph/method/JTVAE/fast_jtnn/mol_tree.py
imports: import os
  import rdkit
  import rdkit.Chem
  from tqdm import tqdm
  from .chemutils import get_clique_mol, tree_decomp, get_mol, get_smiles, set_atommap, enum_assemble, decode_stereo
  from .vocab import *
  import argparse
label_desc: Use image node_id 1 to create a new MolTree object from inherited base classes: object with example: obj = MolTree(smiles, bayesian_optimization)