Exemplo n.º 1
0
def _align(data, template, force=False):
    mols = _parseMolData(data)
    if template:
        pattern = _parseMolData(template)
    else:
        pattern = [mols[0]]
        mols = mols[1:]
    if not pattern or not mols or len(pattern) != 1:
        return 'Wrong arguments'
    aligned_mols = ct._align(mols, pattern[0], force)
    if aligned_mols:
        return _getSDFString(aligned_mols)
Exemplo n.º 2
0
def _align(data, template, force=False):
    mols = _parseMolData(data)
    if template:
        pattern = _parseMolData(template)
    else:
        pattern = [mols[0]]
        mols = mols[1:]
    if not pattern or not mols or len(pattern) != 1:
        return 'Wrong arguments'
    aligned_mols = ct._align(mols, pattern[0], force)
    if aligned_mols:
        return _getSDFString(aligned_mols)
Exemplo n.º 3
0
def _kekulize(data, sanitize=True, removeHs=True, strictParsing=True):
    mols = _parseMolData(data,
                         sanitize=sanitize,
                         removeHs=removeHs,
                         strictParsing=strictParsing)
    _apply(mols, Chem.Kekulize)
    return _getSDFString(mols)
Exemplo n.º 4
0
def _sanitize(data, sanitizeOps=SANITIZE_ALL):
    mols = _parseMolData(data, sanitize=False, removeHs=False, strictParsing=False)
    try:
        _apply(mols, Chem.SanitizeMol, sanitizeOps=sanitizeOps)
    except:
        pass
    return _getSDFString(mols)
Exemplo n.º 5
0
def _standardise(data):
    mols = _parseMolData(data)
    res = _apply(mols, standardise)
    return _getSDFString(res)


#-----------------------------------------------------------------------------------------------------------------------
Exemplo n.º 6
0
def _highlightCtabFragmentSVG(data,
                              smarts,
                              size,
                              legend,
                              sanitize=True,
                              removeHs=True,
                              strictParsing=True,
                              kekulize=True,
                              wedgeBonds=True,
                              fitImage=True,
                              atomMapNumber=False,
                              computeCoords=False,
                              force=False):
    mols = _parseMolData(data,
                         sanitize=sanitize,
                         removeHs=removeHs,
                         strictParsing=strictParsing)
    matches = _getMatches(mols, smarts, force)
    return _mols2svg(mols,
                     size,
                     legend,
                     kekulize=kekulize,
                     wedgeBonds=wedgeBonds,
                     fitImage=fitImage,
                     atomMapNumber=atomMapNumber,
                     computeCoords=computeCoords,
                     highlightAtomLists=matches)
Exemplo n.º 7
0
def _highlightCtabFragmentSVG(data, smarts, size, legend, sanitize=True, removeHs=True, strictParsing=True,
                              kekulize=True, wedgeBonds=True, fitImage=True, atomMapNumber=False, computeCoords=False,
                              force=False):
    mols = _parseMolData(data, sanitize=sanitize, removeHs=removeHs, strictParsing=strictParsing)
    matches = _getMatches(mols, smarts, force)
    return _mols2svg(mols, size, legend, kekulize=kekulize, wedgeBonds=wedgeBonds, fitImage=fitImage,
                     atomMapNumber=atomMapNumber, computeCoords=computeCoords, highlightAtomLists=matches)
Exemplo n.º 8
0
def _ctab2inchi(data, sanitize=True, removeHs=True, strictParsing=True):
    return '\n'.join(
        _apply(
            _parseMolData(data,
                          sanitize=sanitize,
                          removeHs=removeHs,
                          strictParsing=strictParsing), Chem.MolToInchi))
Exemplo n.º 9
0
def _break_bonds(data, sanitize=True, removeHs=True, strictParsing=True):
    mols = _parseMolData(data,
                         sanitize=sanitize,
                         removeHs=removeHs,
                         strictParsing=strictParsing)
    res = _apply(mols, break_bonds)
    return _getSDFString(res)
Exemplo n.º 10
0
def _unsalt(data, sanitize=True, removeHs=True, strictParsing=True):
    mols = _parseMolData(data,
                         sanitize=sanitize,
                         removeHs=removeHs,
                         strictParsing=strictParsing)
    res = _apply(mols, unsalt)
    return _getSDFString(res)
Exemplo n.º 11
0
def _removeHs(data, implicitOnly=False):
    mols = _parseMolData(data,
                         sanitize=False,
                         removeHs=False,
                         strictParsing=True)
    mols = _apply(mols, Chem.RemoveHs, implicitOnly=implicitOnly)
    return _getSDFString(mols)
Exemplo n.º 12
0
def _standardise(data, sanitize=True, removeHs=True, strictParsing=True):
    mols = _parseMolData(data,
                         sanitize=sanitize,
                         removeHs=removeHs,
                         strictParsing=strictParsing)
    res = _apply(mols, standardise)
    return _getSDFString(res)
Exemplo n.º 13
0
def _numBondRings(data, sanitize=True, removeHs=True, strictParsing=True):
    mols = _parseMolData(data,
                         sanitize=sanitize,
                         removeHs=removeHs,
                         strictParsing=strictParsing)
    ring_infos = _call(mols, 'GetRingInfo')
    return [[ring_info.NumBondRings(bond.GetIdx()) for bond in mol.GetBonds()]
            for (mol, ring_info) in zip(mols, ring_infos)]
Exemplo n.º 14
0
def _mcs(data,
         asSmiles,
         atomCompare,
         bondCompare,
         threshold,
         ringMatchesRingOnly,
         completeRingsOnly,
         sanitize=True,
         removeHs=True,
         strictParsing=True,
         isomericSmiles=False,
         canonical=True,
         kekuleSmiles=False):
    ms = _parseMolData(data,
                       sanitize=sanitize,
                       removeHs=removeHs,
                       strictParsing=strictParsing)
    if not ms:
        return
    if len(ms) == 1:
        if asSmiles:
            print 'SMARTS'
            return Chem.MolToSmiles(ms[0])
        else:
            print 'SMILES'
            return Chem.MolToSmarts(ms[0])

    if threshold:
        threshold = float(threshold)
    try:
        mcs = MCS.FindMCS(ms,
                          atomCompare=atomCompare,
                          bondCompare=bondCompare,
                          ringMatchesRingOnly=ringMatchesRingOnly,
                          completeRingsOnly=completeRingsOnly,
                          threshold=threshold)
    except TypeError:
        mcs = MCS.FindMCS(ms,
                          atomCompare=atomCompare,
                          bondCompare=bondCompare,
                          ringMatchesRingOnly=ringMatchesRingOnly,
                          completeRingsOnly=completeRingsOnly)
    res = mcs.smarts
    if asSmiles:
        p = Chem.MolFromSmarts(res)
        for m in ms:
            if m.HasSubstructMatch(p):
                match = m.GetSubstructMatch(p)
                res = Chem.MolFragmentToSmiles(m,
                                               atomsToUse=match,
                                               isomericSmiles=isomericSmiles,
                                               canonical=canonical,
                                               kekuleSmiles=kekuleSmiles)
                break
    return res


#-----------------------------------------------------------------------------------------------------------------------
Exemplo n.º 15
0
def _symmsssr(data, sanitize=True, removeHs=True, strictParsing=True):
    mols = _parseMolData(data,
                         sanitize=sanitize,
                         removeHs=removeHs,
                         strictParsing=strictParsing)
    return [[list(xx) for xx in x] for x in _apply(mols, Chem.GetSymmSSSR)]


#-----------------------------------------------------------------------------------------------------------------------
Exemplo n.º 16
0
def _addHs(data, explicitOnly=False, addCoords=False):
    mols = _parseMolData(data,
                         sanitize=True,
                         removeHs=False,
                         strictParsing=True)
    mols = _apply(mols,
                  Chem.AddHs,
                  explicitOnly=explicitOnly,
                  addCoords=addCoords)
    return _getSDFString(mols)
Exemplo n.º 17
0
def _ctab2smarts(data,
                 sanitize=True,
                 removeHs=True,
                 strictParsing=True,
                 isomericSmiles=False):
    return _getSMARTSString(_parseMolData(data,
                                          sanitize=sanitize,
                                          removeHs=removeHs,
                                          strictParsing=strictParsing),
                            isomericSmiles=isomericSmiles)
Exemplo n.º 18
0
def _sanitize(data, sanitizeOps=SANITIZE_ALL):
    mols = _parseMolData(data,
                         sanitize=False,
                         removeHs=False,
                         strictParsing=False)
    try:
        _apply(mols, Chem.SanitizeMol, sanitizeOps=sanitizeOps)
    except:
        pass
    return _getSDFString(mols)
Exemplo n.º 19
0
def _isBondInRing(data,
                  index,
                  size,
                  sanitize=True,
                  removeHs=True,
                  strictParsing=True):
    mols = _parseMolData(data,
                         sanitize=sanitize,
                         removeHs=removeHs,
                         strictParsing=strictParsing)
    return _call(_call(mols, 'GetRingInfo'), 'IsBondInRingOfSize', index, size)
Exemplo n.º 20
0
def _neutralise(data,
                balance,
                sanitize=True,
                removeHs=True,
                strictParsing=True):
    mols = _parseMolData(data,
                         sanitize=sanitize,
                         removeHs=removeHs,
                         strictParsing=strictParsing)
    res = _apply(mols, neutralise, balance)
    return _getSDFString(res)
Exemplo n.º 21
0
def _ctab2json(data,
               size,
               legend,
               sanitize=True,
               removeHs=True,
               strictParsing=True):
    return _mols2json(
        _parseMolData(data,
                      sanitize=sanitize,
                      removeHs=removeHs,
                      strictParsing=strictParsing), size, legend)
Exemplo n.º 22
0
def _sdf2fps(sdf,
             type='morgan',
             radius=2,
             n_bits=2048,
             sanitize=True,
             removeHs=True,
             strictParsing=True):
    return _getFPSString(
        _parseMolData(sdf,
                      sanitize=sanitize,
                      removeHs=removeHs,
                      strictParsing=strictParsing), type, radius, n_bits)
Exemplo n.º 23
0
def _getDescriptors(data,
                    ds,
                    sanitize=True,
                    removeHs=True,
                    strictParsing=True):
    if ds:
        ds = ds.split(',')
    return _apply(
        _parseMolData(data,
                      sanitize=sanitize,
                      removeHs=removeHs,
                      strictParsing=strictParsing), _desc_list, ds)
Exemplo n.º 24
0
def _ctab23D(data,
             multi,
             mmff,
             sanitize=True,
             removeHs=True,
             strictParsing=True):
    mols = _parseMolData(data,
                         sanitize=sanitize,
                         removeHs=removeHs,
                         strictParsing=strictParsing)
    optimisedMols = _apply(mols, _2D23D, multi, mmff)
    return _getSDFString(optimisedMols)
Exemplo n.º 25
0
def _ctab2image(data,
                size,
                legend,
                sanitize=True,
                removeHs=True,
                strictParsing=True,
                atomMapNumber=False,
                computeCoords=False):
    return _mols2imageString(
        _parseMolData(data,
                      sanitize=sanitize,
                      removeHs=removeHs,
                      strictParsing=strictParsing), size, legend, 'PNG',
        atomMapNumber, computeCoords)
Exemplo n.º 26
0
def _mcs(data, asSmiles, atomCompare, bondCompare, threshold, ringMatchesRingOnly, completeRingsOnly, sanitize=True,
         removeHs=True, strictParsing=True, isomericSmiles=False, canonical=True, kekuleSmiles=False):
    ms = _parseMolData(data, sanitize=sanitize, removeHs=removeHs, strictParsing=strictParsing)
    if not ms:
        return
    if len(ms) == 1:
        if asSmiles:
            return Chem.MolToSmiles(ms[0])
        else:
            return Chem.MolToSmarts(ms[0])

    if threshold:
        threshold = float(threshold)
    try:
        mcs = MCS.FindMCS(ms,
                          atomCompare=atomCompare,
                          bondCompare=bondCompare,
                          ringMatchesRingOnly=ringMatchesRingOnly,
                          completeRingsOnly=completeRingsOnly,
                          threshold=threshold)
    except TypeError:
        ac = MCS.AtomCompare.CompareAny
        if hasattr(MCS.AtomCompare, atomCompare):
            ac = getattr(MCS.AtomCompare, atomCompare)
        bc = MCS.BondCompare.CompareOrder
        if hasattr(MCS.BondCompare, bondCompare):
            bc = getattr(MCS.BondCompare, bondCompare)
        th = 1.0
        if threshold:
            th = threshold
        mcs = MCS.FindMCS(ms,
                          atomCompare=ac,
                          bondCompare=bc,
                          ringMatchesRingOnly=ringMatchesRingOnly,
                          completeRingsOnly=completeRingsOnly,
                          threshold=th
                          )
    if hasattr(mcs, 'smarts'):
        res = mcs.smarts
    else:
        res = mcs.smartsString
    if asSmiles:
        p = Chem.MolFromSmarts(res)
        for m in ms:
            if m.HasSubstructMatch(p):
                match = m.GetSubstructMatch(p)
                res = Chem.MolFragmentToSmiles(m, atomsToUse=match, isomericSmiles=isomericSmiles, canonical=canonical,
                                               kekuleSmiles=kekuleSmiles)
                break
    return res
Exemplo n.º 27
0
def _mcs(data, params):
    ms = _parseMolData(data)
    if not ms:
        return
    if len(ms) == 1:
        if bool(int(params.get('asSmiles', '0'))):
            print 'SMARTS'
            return Chem.MolToSmiles(ms[0])
        else:
            print 'SMILES'
            return Chem.MolToSmarts(ms[0])

    atomCompare = params.get('atomCompare', 'elements')
    bondCompare = params.get('bondCompare', 'bondtypes')
    ringMatchesRingOnly = bool(int(params.get('ringMatchesRingOnly', '0')))
    completeRingsOnly = bool(int(params.get('completeRingsOnly', '0')))
    threshold = params.get('threshold', None)
    if threshold:
        threshold = float(threshold)
    try:
        mcs = MCS.FindMCS(ms,
                          atomCompare=atomCompare,
                          bondCompare=bondCompare,
                          ringMatchesRingOnly=ringMatchesRingOnly,
                          completeRingsOnly=completeRingsOnly,
                          threshold=threshold)
    except TypeError:
        mcs = MCS.FindMCS(ms,
                          atomCompare=atomCompare,
                          bondCompare=bondCompare,
                          ringMatchesRingOnly=ringMatchesRingOnly,
                          completeRingsOnly=completeRingsOnly)
    res = mcs.smarts
    if bool(int(params.get('asSmiles', '0'))):
        p = Chem.MolFromSmarts(res)
        for m in ms:
            if m.HasSubstructMatch(p):
                match = m.GetSubstructMatch(p)
                res = Chem.MolFragmentToSmiles(m,
                                               atomsToUse=match,
                                               isomericSmiles=True,
                                               canonical=False)
                break
    return res


#-----------------------------------------------------------------------------------------------------------------------
Exemplo n.º 28
0
def _sdf2SimilarityMap(data,
                       width=500,
                       height=500,
                       radius=2,
                       fingerprint='morgan',
                       sanitize=True,
                       removeHs=True,
                       strictParsing=True,
                       format='png'):
    return _similarityMap(_parseMolData(data,
                                        sanitize=sanitize,
                                        removeHs=removeHs,
                                        strictParsing=strictParsing),
                          width=width,
                          height=height,
                          radius=radius,
                          fingerprint=fingerprint,
                          format=format)
Exemplo n.º 29
0
def _ctab2smiles(data,
                 sanitize=True,
                 removeHs=True,
                 strictParsing=True,
                 delimiter=' ',
                 nameHeader='Name',
                 includeHeader=True,
                 isomericSmiles=False,
                 kekuleSmiles=False):
    return _getSMILESString(_parseMolData(data,
                                          sanitize=sanitize,
                                          removeHs=removeHs,
                                          strictParsing=strictParsing),
                            delimiter=delimiter,
                            nameHeader=nameHeader,
                            includeHeader=includeHeader,
                            isomericSmiles=isomericSmiles,
                            kekuleSmiles=kekuleSmiles)
Exemplo n.º 30
0
def _mcs(data,params):
    ms = _parseMolData(data)
    if not ms:
        return
    if len(ms) == 1:
        if bool(int(params.get('asSmiles','0'))):
            print 'SMARTS'
            return Chem.MolToSmiles(ms[0])
        else:
            print 'SMILES'
            return Chem.MolToSmarts(ms[0])

    atomCompare=params.get('atomCompare','elements')
    bondCompare=params.get('bondCompare','bondtypes')
    ringMatchesRingOnly=bool(int(params.get('ringMatchesRingOnly','0')))
    completeRingsOnly=bool(int(params.get('completeRingsOnly','0')))
    threshold=params.get('threshold',None)
    if threshold:
        threshold=float(threshold)
    try:
        mcs = MCS.FindMCS(ms,
                          atomCompare=atomCompare,
                          bondCompare=bondCompare,
                          ringMatchesRingOnly=ringMatchesRingOnly,
                          completeRingsOnly=completeRingsOnly,
                          threshold=threshold)
    except TypeError:
        mcs = MCS.FindMCS(ms,
                          atomCompare=atomCompare,
                          bondCompare=bondCompare,
                          ringMatchesRingOnly=ringMatchesRingOnly,
                          completeRingsOnly=completeRingsOnly)
    res = mcs.smarts
    if bool(int(params.get('asSmiles','0'))):
        p = Chem.MolFromSmarts(res)
        for m in ms:
            if m.HasSubstructMatch(p):
                match = m.GetSubstructMatch(p)
                res = Chem.MolFragmentToSmiles(m,atomsToUse=match,isomericSmiles=True,canonical=False)
                break
    return res

#-----------------------------------------------------------------------------------------------------------------------
Exemplo n.º 31
0
def _mcs(data, asSmiles, atomCompare, bondCompare, threshold, ringMatchesRingOnly, completeRingsOnly, sanitize=True,
         removeHs=True, strictParsing=True, isomericSmiles=False, canonical=True, kekuleSmiles=False):
    ms = _parseMolData(data, sanitize=sanitize, removeHs=removeHs, strictParsing=strictParsing)
    if not ms:
        return
    if len(ms) == 1:
        if asSmiles:
            print 'SMARTS'
            return Chem.MolToSmiles(ms[0])
        else:
            print 'SMILES'
            return Chem.MolToSmarts(ms[0])

    if threshold:
        threshold=float(threshold)
    try:
        mcs = MCS.FindMCS(ms,
                          atomCompare=atomCompare,
                          bondCompare=bondCompare,
                          ringMatchesRingOnly=ringMatchesRingOnly,
                          completeRingsOnly=completeRingsOnly,
                          threshold=threshold)
    except TypeError:
        mcs = MCS.FindMCS(ms,
                          atomCompare=atomCompare,
                          bondCompare=bondCompare,
                          ringMatchesRingOnly=ringMatchesRingOnly,
                          completeRingsOnly=completeRingsOnly)
    res = mcs.smarts
    if asSmiles:
        p = Chem.MolFromSmarts(res)
        for m in ms:
            if m.HasSubstructMatch(p):
                match = m.GetSubstructMatch(p)
                res = Chem.MolFragmentToSmiles(m, atomsToUse=match, isomericSmiles=isomericSmiles, canonical=canonical,
                kekuleSmiles=kekuleSmiles)
                break
    return res

#-----------------------------------------------------------------------------------------------------------------------
Exemplo n.º 32
0
def _ctab2svg(data,
              size,
              legend,
              sanitize=True,
              removeHs=True,
              strictParsing=True,
              kekulize=True,
              wedgeBonds=True,
              fitImage=True,
              atomMapNumber=False,
              computeCoords=False):
    return _mols2svg(_parseMolData(data,
                                   sanitize=sanitize,
                                   removeHs=removeHs,
                                   strictParsing=strictParsing),
                     size,
                     legend,
                     kekulize=kekulize,
                     wedgeBonds=wedgeBonds,
                     fitImage=fitImage,
                     atomMapNumber=atomMapNumber,
                     computeCoords=computeCoords)
Exemplo n.º 33
0
def _highlightCtabFragment(data,
                           smarts,
                           size,
                           legend,
                           sanitize=True,
                           removeHs=True,
                           strictParsing=True,
                           atomMapNumber=False,
                           computeCoords=False,
                           kekulize=True,
                           force=False):
    mols = _parseMolData(data,
                         sanitize=sanitize,
                         removeHs=removeHs,
                         strictParsing=strictParsing)
    matches = _getMatches(mols, smarts, force)
    return _mols2imageString(mols,
                             size,
                             legend,
                             'PNG',
                             atomMapNumber,
                             computeCoords,
                             matches,
                             kekulize=kekulize)
Exemplo n.º 34
0
def _ctab2smarts(data, sanitize=True, removeHs=True, strictParsing=True, isomericSmiles=False):
    return _getSMARTSString(_parseMolData(data, sanitize=sanitize, removeHs=removeHs, strictParsing=strictParsing),
                            isomericSmiles=isomericSmiles)
Exemplo n.º 35
0
def _ctab2image(data, size, legend):
    return _mols2imageString(_parseMolData(data), size, legend, 'PNG')
Exemplo n.º 36
0
def _symmsssr(data, sanitize=True, removeHs=True, strictParsing=True):
    mols = _parseMolData(data, sanitize=sanitize, removeHs=removeHs, strictParsing=strictParsing)
    return [[list(xx) for xx in x] for x in _apply(mols, Chem.GetSymmSSSR)]

#-----------------------------------------------------------------------------------------------------------------------
Exemplo n.º 37
0
def _sdf2fps(sdf, type='morgan', radius=2, n_bits=2048, sanitize=True, removeHs=True, strictParsing=True):
    return _getFPSString(_parseMolData(sdf, sanitize=sanitize, removeHs=removeHs, strictParsing=strictParsing),
        type, radius, n_bits)
Exemplo n.º 38
0
def _kekulize(data, sanitize=True, removeHs=True, strictParsing=True):
    mols = _parseMolData(data, sanitize=sanitize, removeHs=removeHs, strictParsing=strictParsing)
    _apply(mols, Chem.Kekulize)
    return _getSDFString(mols)
Exemplo n.º 39
0
def _ctab2inchi(data, sanitize=True, removeHs=True, strictParsing=True):
    return '\n'.join(_apply(_parseMolData(data, sanitize=sanitize, removeHs=removeHs, strictParsing=strictParsing),
                            Chem.MolToInchi))
Exemplo n.º 40
0
def _unsalt(data):
    mols = _parseMolData(data)
    res = _apply(mols, unsalt)
    return _getSDFString(res)
Exemplo n.º 41
0
def _rules(data):
    mols = _parseMolData(data)
    res = _apply(mols, rules)
    return _getSDFString(res)
Exemplo n.º 42
0
def _neutralise(data, balance):
    mols = _parseMolData(data)
    res = _apply(mols, neutralise, balance)
    return _getSDFString(res)
Exemplo n.º 43
0
def _break_bonds(data):
    mols = _parseMolData(data)
    res = _apply(mols, break_bonds)
    return _getSDFString(res)
Exemplo n.º 44
0
def _break_bonds(data, sanitize=True, removeHs=True, strictParsing=True):
    mols = _parseMolData(data, sanitize=sanitize, removeHs=removeHs, strictParsing=strictParsing)
    res = _apply(mols, break_bonds)
    return _getSDFString(res)
Exemplo n.º 45
0
def _ctab2smiles(data, sanitize=True, removeHs=True, strictParsing=True, delimiter=' ', nameHeader='Name',
                 includeHeader=True, isomericSmiles=False, kekuleSmiles=False):
    return _getSMILESString(_parseMolData(data, sanitize=sanitize, removeHs=removeHs, strictParsing=strictParsing),
                            delimiter=delimiter, nameHeader=nameHeader, includeHeader=includeHeader,
                            isomericSmiles=isomericSmiles, kekuleSmiles=kekuleSmiles)
Exemplo n.º 46
0
def _ctab2xyz(data, computeCoords=True):
    return _getXYZ(_parseMolData(data), computeCoords)
Exemplo n.º 47
0
def _sdf2SimilarityMap(data, width=100, height=100, radius=2, fingerprint = 'morgan', sanitize=True, removeHs=True,
                       strictParsing=True):
    return _similarityMap(_parseMolData(data, sanitize=sanitize, removeHs=removeHs, strictParsing=strictParsing),
        width=width, height=height, radius=radius, fingerprint = fingerprint)
Exemplo n.º 48
0
def _ctab23D(data, multi, mmff):
    mols = _parseMolData(data)
    optimisedMols = _apply(mols, _2D23D, multi, mmff)
    return _getSDFString(optimisedMols)
Exemplo n.º 49
0
def _ctab2image(data, size, legend, sanitize=True, removeHs=True, strictParsing=True, atomMapNumber=False,
                computeCoords=False):
    return _mols2imageString(_parseMolData(data, sanitize=sanitize, removeHs=removeHs, strictParsing=strictParsing),
        size, legend, 'PNG', atomMapNumber, computeCoords)
Exemplo n.º 50
0
def _ctab2inchi(data):
    return '\n'.join(_apply(_parseMolData(data), Chem.MolToInchi))
Exemplo n.º 51
0
def _unsalt(data, sanitize=True, removeHs=True, strictParsing=True):
    mols = _parseMolData(data, sanitize=sanitize, removeHs=removeHs, strictParsing=strictParsing)
    res = _apply(mols, unsalt)
    return _getSDFString(res)
Exemplo n.º 52
0
def _standardise(data):
    mols = _parseMolData(data)
    res = _apply(mols, standardise)
    return _getSDFString(res)

#-----------------------------------------------------------------------------------------------------------------------
Exemplo n.º 53
0
def _ctab2image(data,size,legend, recalc=True, highlightMatch=None):
    return _mols2imageString(_parseMolData(data),size,legend, 'PNG', recalc=recalc, highlightMatch=highlightMatch)
Exemplo n.º 54
0
def _neutralise(data, balance, sanitize=True, removeHs=True, strictParsing=True):
    mols = _parseMolData(data, sanitize=sanitize, removeHs=removeHs, strictParsing=strictParsing)
    res = _apply(mols, neutralise, balance)
    return _getSDFString(res)
Exemplo n.º 55
0
def _sssr(data, sanitize=True, removeHs=True, strictParsing=True):
    mols = _parseMolData(data, sanitize=sanitize, removeHs=removeHs, strictParsing=strictParsing)
    return _apply(mols, Chem.GetSSSR)
Exemplo n.º 56
0
def _standardise(data, sanitize=True, removeHs=True, strictParsing=True):
    mols = _parseMolData(data, sanitize=sanitize, removeHs=removeHs, strictParsing=strictParsing)
    res = _apply(mols, standardise)
    return _getSDFString(res)
Exemplo n.º 57
0
def _addHs(data, explicitOnly=False, addCoords=False):
    mols = _parseMolData(data, sanitize=True, removeHs=False, strictParsing=True)
    mols = _apply(mols, Chem.AddHs, explicitOnly=explicitOnly, addCoords=addCoords)
    return _getSDFString(mols)
Exemplo n.º 58
0
def _ctab2svg(data, size, legend, sanitize=True, removeHs=True, strictParsing=True, kekulize=True, wedgeBonds=True,
              fitImage=True, atomMapNumber=False, computeCoords=False):
    return _mols2svg(_parseMolData(data, sanitize=sanitize, removeHs=removeHs, strictParsing=strictParsing),
        size, legend, kekulize=kekulize, wedgeBonds=wedgeBonds, fitImage=fitImage, atomMapNumber=atomMapNumber,
        computeCoords=computeCoords)
Exemplo n.º 59
0
def _removeHs(data, implicitOnly=False):
    mols = _parseMolData(data, sanitize=False, removeHs=False, strictParsing=True)
    mols = _apply(mols, Chem.RemoveHs, implicitOnly=implicitOnly)
    return _getSDFString(mols)