當前位置: 首頁>>代碼示例>>Python>>正文


Python Chem.AddHs方法代碼示例

本文整理匯總了Python中rdkit.Chem.AddHs方法的典型用法代碼示例。如果您正苦於以下問題:Python Chem.AddHs方法的具體用法?Python Chem.AddHs怎麽用?Python Chem.AddHs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在rdkit.Chem的用法示例。


在下文中一共展示了Chem.AddHs方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: generate_structure_from_smiles

# 需要導入模塊: from rdkit import Chem [as 別名]
# 或者: from rdkit.Chem import AddHs [as 別名]
def generate_structure_from_smiles(smiles):

    # Generate a 3D structure from smiles

    mol = Chem.MolFromSmiles(smiles)
    mol = Chem.AddHs(mol)

    status = AllChem.EmbedMolecule(mol)
    status = AllChem.UFFOptimizeMolecule(mol)

    conformer = mol.GetConformer()
    coordinates = conformer.GetPositions()
    coordinates = np.array(coordinates)

    atoms = get_atoms(mol)

    return atoms, coordinates 
開發者ID:jensengroup,項目名稱:xyz2mol,代碼行數:19,代碼來源:test.py

示例2: _CalculateElementMaxPCharge

# 需要導入模塊: from rdkit import Chem [as 別名]
# 或者: from rdkit.Chem import AddHs [as 別名]
def _CalculateElementMaxPCharge(mol, AtomicNum=6):
    """
    #################################################################
    **Internal used only**

    Most positive charge on atom with atomic number equal to n
    #################################################################
    """
    Hmol = Chem.AddHs(mol)
    GMCharge.ComputeGasteigerCharges(Hmol, iter_step)
    res = []
    for atom in Hmol.GetAtoms():
        if atom.GetAtomicNum() == AtomicNum:
            res.append(float(atom.GetProp("_GasteigerCharge")))

    if res == []:
        return 0
    else:
        return round(max(res), 3) 
開發者ID:gadsbyfly,項目名稱:PyBioMed,代碼行數:21,代碼來源:charge.py

示例3: _CalculateElementMaxNCharge

# 需要導入模塊: from rdkit import Chem [as 別名]
# 或者: from rdkit.Chem import AddHs [as 別名]
def _CalculateElementMaxNCharge(mol, AtomicNum=6):
    """
    #################################################################
    **Internal used only**

    Most negative charge on atom with atomic number equal to n
    #################################################################
    """
    Hmol = Chem.AddHs(mol)
    GMCharge.ComputeGasteigerCharges(Hmol, iter_step)
    res = []
    for atom in Hmol.GetAtoms():
        if atom.GetAtomicNum() == AtomicNum:
            res.append(float(atom.GetProp("_GasteigerCharge")))
    if res == []:
        return 0
    else:
        return round(min(res), 3) 
開發者ID:gadsbyfly,項目名稱:PyBioMed,代碼行數:20,代碼來源:charge.py

示例4: CalculateAllMaxPCharge

# 需要導入模塊: from rdkit import Chem [as 別名]
# 或者: from rdkit.Chem import AddHs [as 別名]
def CalculateAllMaxPCharge(mol):
    """
    #################################################################
    Most positive charge on ALL atoms

    -->Qmax

    Usage:

        result=CalculateAllMaxPCharge(mol)

        Input: mol is a molecule object.

        Output: result is a numeric value.
    #################################################################
    """
    Hmol = Chem.AddHs(mol)
    GMCharge.ComputeGasteigerCharges(Hmol, iter_step)
    res = []
    for atom in Hmol.GetAtoms():
        res.append(float(atom.GetProp("_GasteigerCharge")))
    if res == []:
        return 0
    else:
        return round(max(res), 3) 
開發者ID:gadsbyfly,項目名稱:PyBioMed,代碼行數:27,代碼來源:charge.py

示例5: CalculateAllMaxNCharge

# 需要導入模塊: from rdkit import Chem [as 別名]
# 或者: from rdkit.Chem import AddHs [as 別名]
def CalculateAllMaxNCharge(mol):
    """
    #################################################################
    Most negative charge on all atoms

    -->Qmin

    Usage:

        result=CalculateAllMaxNCharge(mol)

        Input: mol is a molecule object.

        Output: result is a numeric value.
    #################################################################
    """
    Hmol = Chem.AddHs(mol)
    GMCharge.ComputeGasteigerCharges(Hmol, iter_step)
    res = []
    for atom in Hmol.GetAtoms():
        res.append(float(atom.GetProp("_GasteigerCharge")))
    if res == []:
        return 0
    else:
        return round(min(res), 3) 
開發者ID:gadsbyfly,項目名稱:PyBioMed,代碼行數:27,代碼來源:charge.py

示例6: _CalculateElementSumSquareCharge

# 需要導入模塊: from rdkit import Chem [as 別名]
# 或者: from rdkit.Chem import AddHs [as 別名]
def _CalculateElementSumSquareCharge(mol, AtomicNum=6):
    """
    #################################################################
    **Internal used only**

    Ths sum of square Charges on all atoms with atomicnumber equal to n
    #################################################################
    """
    Hmol = Chem.AddHs(mol)
    GMCharge.ComputeGasteigerCharges(Hmol, iter_step)
    res = []
    for atom in Hmol.GetAtoms():
        if atom.GetAtomicNum() == AtomicNum:
            res.append(float(atom.GetProp("_GasteigerCharge")))
    if res == []:
        return 0
    else:
        return round(sum(numpy.square(res)), 3) 
開發者ID:gadsbyfly,項目名稱:PyBioMed,代碼行數:20,代碼來源:charge.py

示例7: CalculateHydrogenNumber

# 需要導入模塊: from rdkit import Chem [as 別名]
# 或者: from rdkit.Chem import AddHs [as 別名]
def CalculateHydrogenNumber(mol):

    """
    #################################################################
    Calculation of Number of Hydrogen in a molecule

    ---->nhyd

    Usage:

        result=CalculateHydrogenNumber(mol)

        Input: mol is a molecule object.

        Output: result is a numeric value.
    #################################################################
    """
    i = 0
    Hmol = Chem.AddHs(mol)
    for atom in Hmol.GetAtoms():
        if atom.GetAtomicNum() == 1:
            i = i + 1

    return i 
開發者ID:gadsbyfly,項目名稱:PyBioMed,代碼行數:26,代碼來源:constitution.py

示例8: CalculateAllAtomNumber

# 需要導入模塊: from rdkit import Chem [as 別名]
# 或者: from rdkit.Chem import AddHs [as 別名]
def CalculateAllAtomNumber(mol):
    """
    #################################################################
    Calculation of all atom counts in a molecule

    ---->nta

    Usage:

        result=CalculateAllAtomNumber(mol)

        Input: mol is a molecule object.

        Output: result is a numeric value.
    #################################################################
    """

    return Chem.AddHs(mol).GetNumAtoms() 
開發者ID:gadsbyfly,項目名稱:PyBioMed,代碼行數:20,代碼來源:constitution.py

示例9: CalculateBasakSIC0

# 需要導入模塊: from rdkit import Chem [as 別名]
# 或者: from rdkit.Chem import AddHs [as 別名]
def CalculateBasakSIC0(mol):
    """
    #################################################################
    Obtain the structural information content with order 0

    proposed by Basak

    ---->SIC0
    #################################################################
    """

    Hmol = Chem.AddHs(mol)
    nAtoms = Hmol.GetNumAtoms()
    IC = CalculateBasakIC0(mol)
    if nAtoms <= 1:
        BasakSIC = 0.0
    else:
        BasakSIC = IC / numpy.log2(nAtoms)

    return BasakSIC 
開發者ID:gadsbyfly,項目名稱:PyBioMed,代碼行數:22,代碼來源:basak.py

示例10: CalculateBasakCIC0

# 需要導入模塊: from rdkit import Chem [as 別名]
# 或者: from rdkit.Chem import AddHs [as 別名]
def CalculateBasakCIC0(mol):

    """
    #################################################################
    Obtain the complementary information content with order 0

    proposed by Basak

    ---->CIC0
    #################################################################
    """
    Hmol = Chem.AddHs(mol)
    nAtoms = Hmol.GetNumAtoms()
    IC = CalculateBasakIC0(mol)
    if nAtoms <= 1:
        BasakCIC = 0.0
    else:
        BasakCIC = numpy.log2(nAtoms) - IC

    return BasakCIC 
開發者ID:gadsbyfly,項目名稱:PyBioMed,代碼行數:22,代碼來源:basak.py

示例11: CalculateBasakSIC1

# 需要導入模塊: from rdkit import Chem [as 別名]
# 或者: from rdkit.Chem import AddHs [as 別名]
def CalculateBasakSIC1(mol):
    """
    #################################################################
    Obtain the structural information content with order 1

    proposed by Basak.

    ---->SIC1
    #################################################################
    """
    Hmol = Chem.AddHs(mol)
    nAtoms = Hmol.GetNumAtoms()
    IC = CalculateBasakIC1(mol)
    if nAtoms <= 1:
        BasakSIC = 0.0
    else:
        BasakSIC = IC / numpy.log2(nAtoms)

    return BasakSIC 
開發者ID:gadsbyfly,項目名稱:PyBioMed,代碼行數:21,代碼來源:basak.py

示例12: CalculateBasakSIC3

# 需要導入模塊: from rdkit import Chem [as 別名]
# 或者: from rdkit.Chem import AddHs [as 別名]
def CalculateBasakSIC3(mol):
    """
    #################################################################
    Obtain the structural information content with order 3 proposed

    by Basak.

    ---->SIC3
    #################################################################
    """
    Hmol = Chem.AddHs(mol)
    nAtoms = Hmol.GetNumAtoms()
    IC = CalculateBasakIC3(mol)
    if nAtoms <= 1:
        BasakSIC = 0.0
    else:
        BasakSIC = IC / numpy.log2(nAtoms)

    return BasakSIC 
開發者ID:gadsbyfly,項目名稱:PyBioMed,代碼行數:21,代碼來源:basak.py

示例13: CalculateBasakSIC4

# 需要導入模塊: from rdkit import Chem [as 別名]
# 或者: from rdkit.Chem import AddHs [as 別名]
def CalculateBasakSIC4(mol):
    """
    #################################################################
    Obtain the structural information content with order 4 proposed

    by Basak.

    ---->SIC4
    #################################################################
    """
    Hmol = Chem.AddHs(mol)
    nAtoms = Hmol.GetNumAtoms()
    IC = CalculateBasakIC4(mol)
    if nAtoms <= 1:
        BasakSIC = 0.0
    else:
        BasakSIC = IC / numpy.log2(nAtoms)

    return BasakSIC 
開發者ID:gadsbyfly,項目名稱:PyBioMed,代碼行數:21,代碼來源:basak.py

示例14: CalculateBasakSIC5

# 需要導入模塊: from rdkit import Chem [as 別名]
# 或者: from rdkit.Chem import AddHs [as 別名]
def CalculateBasakSIC5(mol):
    """
    #################################################################
    Obtain the structural information content with order 5 proposed

    by Basak.

    ---->SIC5
    #################################################################
    """
    Hmol = Chem.AddHs(mol)
    nAtoms = Hmol.GetNumAtoms()
    IC = CalculateBasakIC5(mol)
    if nAtoms <= 1:
        BasakSIC = 0.0
    else:
        BasakSIC = IC / numpy.log2(nAtoms)

    return BasakSIC 
開發者ID:gadsbyfly,項目名稱:PyBioMed,代碼行數:21,代碼來源:basak.py

示例15: CalculateBasakSIC6

# 需要導入模塊: from rdkit import Chem [as 別名]
# 或者: from rdkit.Chem import AddHs [as 別名]
def CalculateBasakSIC6(mol):
    """
    #################################################################
    Obtain the structural information content with order 6 proposed

    by Basak.

    ---->SIC6
    #################################################################
    """
    Hmol = Chem.AddHs(mol)
    nAtoms = Hmol.GetNumAtoms()
    IC = CalculateBasakIC6(mol)
    if nAtoms <= 1:
        BasakSIC = 0.0
    else:
        BasakSIC = IC / numpy.log2(nAtoms)

    return BasakSIC 
開發者ID:gadsbyfly,項目名稱:PyBioMed,代碼行數:21,代碼來源:basak.py


注:本文中的rdkit.Chem.AddHs方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。