(mol, atom_ids, radii, molSize=(300, 300), atm_color=(0, 1, 0), oth_color=(0.8, 1, 0))
Get a depiction of molecular substructure. Useful for depicting bits in fingerprints.
    
    Inspired by: http://rdkit.blogspot.ch/2016/02/morgan-fingerprint-bit-statistics.html
    
    Parameters
    ----------
    mol : rdkit.Chem.rdchem.Mol
    atom_ids : list
        List of atoms to depict
    radii : list
        List of radii - how many atoms around each atom with atom_id to highlight
    molSize : tuple
    atm_color, oth_color : tuple
        Colors of central atoms and surrounding atoms and bonds
    
    Returns
    -------
    IPython.display.SVG
Get a depiction of molecular substructure. Useful for depicting bits in fingerprints.
    
    Inspired by: http://rdkit.blogspot.ch/2016/02/morgan-fingerprint-bit-statistics.html
    
    Parameters
    ----------
    mol : rdkit.Chem.rdchem.Mol
    atom_ids : list
        List of atoms to depict
    radii : list
        List of radii - how many atoms around each atom with atom_id to highlight
    molSize : tuple
    atm_color, oth_color : tuple
        Colors of central atoms and surrounding atoms and bonds
    
    Returns
    -------
    IPython.display.SVG
Get a depiction of molecular substructure . Useful for depicting bits in fingerprints . Inspired by : http : // rdkit . blogspot . ch / 2016 / 02 / morgan - fingerprint - bit - statistics . html Parameters ---------- mol : rdkit . Chem . rdchem . Mol atom_ids : list List of atoms to depict radii : list List of radii - how many atoms around each atom with atom_id to highlight molSize : tuple atm_color oth_color : tuple Colors of central atoms and surrounding atoms and bonds Returns ------- IPython . display . SVG
def depict_atoms(mol, atom_ids, radii, molSize=(300, 300), atm_color=(0, 1, 0), oth_color=(0.8, 1, 0)):
    """Get a depiction of molecular substructure. Useful for depicting bits in fingerprints.
    
    Inspired by: http://rdkit.blogspot.ch/2016/02/morgan-fingerprint-bit-statistics.html
    
    Parameters
    ----------
    mol : rdkit.Chem.rdchem.Mol
    atom_ids : list
        List of atoms to depict
    radii : list
        List of radii - how many atoms around each atom with atom_id to highlight
    molSize : tuple
    atm_color, oth_color : tuple
        Colors of central atoms and surrounding atoms and bonds
    
    Returns
    -------
    IPython.display.SVG
    """
    atoms_to_use = []
    bonds = []
    for atom_id, radius in zip(atom_ids, radii):    
        if radius > 0:
            env = Chem.FindAtomEnvironmentOfRadiusN(mol, radius, atom_id)
            bonds += [x for x in env if x not in bonds]
            for b in env:
                atoms_to_use.append(mol.GetBondWithIdx(b).GetBeginAtomIdx())
                atoms_to_use.append(mol.GetBondWithIdx(b).GetEndAtomIdx())
            atoms_to_use = list(set(atoms_to_use))       
        else:
            atoms_to_use.append(atom_id)
            env = None
    if sum(radii) == 0:
        return mol_to_svg(mol, molSize=molSize, highlightBonds=False, highlightAtoms=atoms_to_use,
                          highlightAtomColors={x: atm_color for x in atom_ids})
    else:
        colors = {x: atm_color for x in atom_ids}
        for x in atoms_to_use:
            if x not in atom_ids:
                colors[x] = oth_color
        bond_colors = {b: oth_color for b in bonds}
        return mol_to_svg(mol, molSize=molSize, highlightAtoms=atoms_to_use, highlightAtomColors=colors,
                          highlightBonds=bonds, highlightBondColors=bond_colors)
def depict_atoms ( mol , atom_ids , radii , molSize = ( 300 , 300 ) , atm_color = ( 0 , 1 , 0 ) , oth_color = ( 0.8 , 1 , 0 ) ) : atoms_to_use = [ ] bonds = [ ] for atom_id , radius in zip ( atom_ids , radii ) : if radius > 0 : env = Chem . FindAtomEnvironmentOfRadiusN ( mol , radius , atom_id ) bonds += [ x for x in env if x not in bonds ] for b in env : atoms_to_use . append ( mol . GetBondWithIdx ( b ) . GetBeginAtomIdx ( ) ) atoms_to_use . append ( mol . GetBondWithIdx ( b ) . GetEndAtomIdx ( ) ) atoms_to_use = list ( set ( atoms_to_use ) ) else : atoms_to_use . append ( atom_id ) env = None if sum ( radii ) == 0 : return mol_to_svg ( mol , molSize = molSize , highlightBonds = False , highlightAtoms = atoms_to_use , highlightAtomColors = { x : atm_color for x in atom_ids } ) else : colors = { x : atm_color for x in atom_ids } for x in atoms_to_use : if x not in atom_ids : colors [ x ] = oth_color bond_colors = { b : oth_color for b in bonds } return mol_to_svg ( mol , molSize = molSize , highlightAtoms = atoms_to_use , highlightAtomColors = colors , highlightBonds = bonds , highlightBondColors = bond_colors )