本文整理汇总了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
示例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)
示例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)
示例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)
示例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)
示例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)
示例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
示例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()
示例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
示例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
示例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
示例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
示例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
示例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
示例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