示例#1
0
from ccdc.molecule import Molecule
from ccdc.io import _CSDDatabaseLocator
from ccdc.utilities import _private_importer

with _private_importer():
    import ChemicalAnalysisLib
    import ConformerGeneratorLib

def ccdc_mol_from_smiles(smiles, identifier=None, generate_initial_sites=True):
    """
    Pete's function for making a ccdc molecule with initial coordinates from a smiles string.
    :param identifier:
    :param generate_initial_sites:
    :return:
    """
    if identifier is None:
        identifier = smiles

    if generate_initial_sites:
        parameter_files = _CSDDatabaseLocator.get_conformer_parameter_file_location()
        molmaker = ConformerGeneratorLib.MoleculeTo3D(parameter_files)
        mol = Molecule(identifier, molmaker.create_conformation(smiles))
    else:
        molmaker = ChemicalAnalysisLib.SMILESMoleculeMaker()
        mol = Molecule(identifier, _molecule=molmaker.siteless_atoms(smiles))

    return mol
示例#2
0
from ccdc.pharmacophore import Pharmacophore
from ccdc.io import csd_directory, CrystalReader, MoleculeWriter, MoleculeReader
from ccdc.molecule import Molecule, Atom, Coordinates

from ccdc.descriptors import GeometricDescriptors
from ccdc import utilities
from ccdc.utilities import PushDir

from hotspots.grid_extension import Grid
from hotspots.wrapper_pdb import PDBResult
from hotspots.wrapper_arpeggio import Arpeggio
from hotspots.protein_extension import Protein
from hotspots.wrapper_pymol import PyMOLCommands, PyMOLFile

with utilities._private_importer():
    import MotifPharmacophoreLib
    import SubstructureSearchLib
    import ChemistryLib
    import MathsLib
    import UtilitiesLib


def _coordinate_str(coord, digits=4):
    return f"{round(coord[0], digits)}_{round(coord[1], digits)}_{round(coord[2], digits)}"


def to_array(t):
    return np.array([float(t[0]), float(t[1]), float(t[2])])