Пример #1
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)
Пример #2
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)
Пример #3
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)
Пример #4
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)
Пример #5
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)
Пример #6
0
def _standardise(data):
    mols = _parseMolData(data)
    res = _apply(mols, standardise)
    return _getSDFString(res)


#-----------------------------------------------------------------------------------------------------------------------
Пример #7
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)
Пример #8
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)
Пример #9
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)
Пример #10
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)
Пример #11
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)
Пример #12
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)
Пример #13
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)
Пример #14
0
def _smarts2ctab(data, computeCoords=True, delimiter=' ', sanitize=True):
    mols = []
    for line in data.splitlines():
        if not line:
            continue
        for chunk in line.strip().split(delimiter):
            if not chunk:
                continue
            mols.append(_molFromSmarts(chunk))
    if computeCoords:
        _apply(mols, _computeCoords, True)
    if sanitize:
        _apply(mols, _sanitize)
    return _getSDFString(mols)
Пример #15
0
def _smarts2ctab(data, computeCoords=True, delimiter=' ', sanitize=True):
    mols = []
    for line in data.splitlines():
        if not line:
            continue
        for chunk in line.strip().split(delimiter):
            if not chunk:
                continue
            mols.append(_molFromSmarts(chunk))
    if computeCoords:
        _apply(mols, _computeCoords, True)
    if sanitize:
        _apply(mols, _sanitize)
    return _getSDFString(mols)
Пример #16
0
def _smiles2ctab(data,
                 computeCoords=True,
                 delimiter=' ',
                 smilesColumn=0,
                 nameColumn=1,
                 titleLine=True,
                 sanitize=True):
    return _getSDFString(
        _parseSMILESData(data,
                         computeCoords=computeCoords,
                         delimiter=delimiter,
                         smilesColumn=smilesColumn,
                         nameColumn=nameColumn,
                         titleLine=titleLine,
                         sanitize=sanitize))
Пример #17
0
def _smiles23D(data,
               multi,
               mmff,
               computeCoords=False,
               delimiter=' ',
               smilesColumn=0,
               nameColumn=1,
               titleLine=True,
               sanitize=True):
    mols = _parseSMILESData(data,
                            computeCoords=computeCoords,
                            delimiter=delimiter,
                            smilesColumn=smilesColumn,
                            nameColumn=nameColumn,
                            titleLine=titleLine,
                            sanitize=sanitize)
    optimisedMols = _apply(mols, _2D23D, multi, mmff)
    return _getSDFString(optimisedMols)
Пример #18
0
def _smiles2ctab(data):
    return _getSDFString(_parseSMILESData(data, True))
Пример #19
0
def _standardise(data):
    mols = _parseMolData(data)
    res = _apply(mols, standardise)
    return _getSDFString(res)

#-----------------------------------------------------------------------------------------------------------------------
Пример #20
0
def _unsalt(data):
    mols = _parseMolData(data)
    res = _apply(mols, unsalt)
    return _getSDFString(res)
Пример #21
0
def _ctab23D(data, multi, mmff):
    mols = _parseMolData(data)
    optimisedMols = _apply(mols, _2D23D, multi, mmff)
    return _getSDFString(optimisedMols)
Пример #22
0
def _ctab23D(data, multi, mmff):
    mols = _parseMolData(data)
    optimisedMols = _apply(mols, _2D23D, multi, mmff)
    return _getSDFString(optimisedMols)
Пример #23
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)
Пример #24
0
def _smiles23D(data, multi, mmff):
    mols = _parseSMILESData(data)
    optimisedMols = _apply(mols, _2D23D, multi, mmff)
    return _getSDFString(optimisedMols)
Пример #25
0
def _unsalt(data):
    mols = _parseMolData(data)
    res = _apply(mols, unsalt)
    return _getSDFString(res)
Пример #26
0
def _neutralise(data, balance):
    mols = _parseMolData(data)
    res = _apply(mols, neutralise, balance)
    return _getSDFString(res)
Пример #27
0
def _kekulize(data):
    mols = _parseMolData(data)
    _apply(mols, Chem.Kekulize)
    return _getSDFString(mols)
Пример #28
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)
Пример #29
0
def _smiles2ctab(data):
    return _getSDFString(_parseSMILESData(data, True))
Пример #30
0
def _inchi2ctab(inchis):
    mols = _apply(inchis.split(), Chem.MolFromInchi)
    _apply(mols, _computeCoords)
    return _getSDFString(mols)
Пример #31
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)
Пример #32
0
def _smiles2ctab(data, computeCoords=True, delimiter=' ', smilesColumn=0, nameColumn=1, titleLine=True, sanitize=True):
    return _getSDFString(_parseSMILESData(data, computeCoords=computeCoords, delimiter=delimiter,
                                          smilesColumn=smilesColumn, nameColumn=nameColumn, titleLine=titleLine,
                                          sanitize=sanitize))
Пример #33
0
def _break_bonds(data):
    mols = _parseMolData(data)
    res = _apply(mols, break_bonds)
    return _getSDFString(res)
Пример #34
0
def _inchi2ctab(inchis):
    mols = _apply(inchis.split(),Chem.MolFromInchi)
    _apply(mols, _computeCoords)
    return _getSDFString(mols)
Пример #35
0
def _neutralise(data, balance):
    mols = _parseMolData(data)
    res = _apply(mols, neutralise, balance)
    return _getSDFString(res)
Пример #36
0
def _smiles23D(data, multi, mmff):
    mols = _parseSMILESData(data)
    optimisedMols = _apply(mols, _2D23D, multi, mmff)
    return _getSDFString(optimisedMols)
Пример #37
0
def _rules(data):
    mols = _parseMolData(data)
    res = _apply(mols, rules)
    return _getSDFString(res)
Пример #38
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)
Пример #39
0
def _smiles23D(data, multi, mmff, computeCoords=False, delimiter=' ', smilesColumn=0, nameColumn=1,
               titleLine=True, sanitize=True):
    mols = _parseSMILESData(data, computeCoords=computeCoords, delimiter=delimiter, smilesColumn=smilesColumn,
        nameColumn=nameColumn, titleLine=titleLine, sanitize=sanitize)
    optimisedMols = _apply(mols, _2D23D, multi, mmff)
    return _getSDFString(optimisedMols)
Пример #40
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)
Пример #41
0
def _rules(data):
    mols = _parseMolData(data)
    res = _apply(mols, rules)
    return _getSDFString(res)
Пример #42
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)
Пример #43
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)
Пример #44
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)
Пример #45
0
def _break_bonds(data):
    mols = _parseMolData(data)
    res = _apply(mols, break_bonds)
    return _getSDFString(res)