当前位置: 首页>>代码示例>>Python>>正文


Python Crippen._Init方法代码示例

本文整理汇总了Python中rdkit.Chem.Crippen._Init方法的典型用法代码示例。如果您正苦于以下问题:Python Crippen._Init方法的具体用法?Python Crippen._Init怎么用?Python Crippen._Init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rdkit.Chem.Crippen的用法示例。


在下文中一共展示了Crippen._Init方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: pySlogP_VSA_

# 需要导入模块: from rdkit.Chem import Crippen [as 别名]
# 或者: from rdkit.Chem.Crippen import _Init [as 别名]
def pySlogP_VSA_(mol, bins=None, force=1):
  """ *Internal Use Only*
  """
  if not force:
    try:
      res = mol._slogpVSA
    except AttributeError:
      pass
    else:
      if res.all():
        return res

  if bins is None:
    bins = logpBins
  Crippen._Init()
  propContribs = Crippen._GetAtomContribs(mol, force=force)
  volContribs = _LabuteHelper(mol)

  ans = numpy.zeros(len(bins) + 1, 'd')
  for i in range(len(propContribs)):
    prop = propContribs[i]
    vol = volContribs[i + 1]
    if prop is not None:
      bin = bisect.bisect_right(bins, prop[0])
      ans[bin] += vol

  mol._slogpVSA = ans
  return ans
开发者ID:abradle,项目名称:rdkit,代码行数:30,代码来源:MolSurf.py

示例2: testDetails2

# 需要导入模块: from rdkit.Chem import Crippen [as 别名]
# 或者: from rdkit.Chem.Crippen import _Init [as 别名]
 def testDetails2(self):
   Crippen._Init()
   inF = open(self.detailName2,'rb')
   if 0:
     outF = open('tmp.pkl','wb+')
     self._writeDetailFile(inF,outF)
   self._doDetailFile(inF)
开发者ID:CKannas,项目名称:rdkit,代码行数:9,代码来源:UnitTestCrippen.py

示例3: testDetails

# 需要导入模块: from rdkit.Chem import Crippen [as 别名]
# 或者: from rdkit.Chem.Crippen import _Init [as 别名]
 def testDetails(self):
   Crippen._Init()
   with open(self.detailName,'rb') as inF:
     if 0:
       outF = open('tmp.pkl','wb+')
       self._writeDetailFile(inF,outF)
     self._doDetailFile(inF)
开发者ID:Acpharis,项目名称:rdkit,代码行数:9,代码来源:UnitTestCrippen.py

示例4: testDetails2

# 需要导入模块: from rdkit.Chem import Crippen [as 别名]
# 或者: from rdkit.Chem.Crippen import _Init [as 别名]
 def testDetails2(self):
   Crippen._Init()
   with open(self.detailName2,'r') as inTF:
     buf = inTF.read().replace('\r\n', '\n').encode('utf-8')
     inTF.close()
   with io.BytesIO(buf) as inF:
     if 0:
       outF = open('tmp.pkl','wb+')
       self._writeDetailFile(inF,outF)
     self._doDetailFile(inF)
开发者ID:BielitzLabs,项目名称:rdkit,代码行数:12,代码来源:UnitTestCrippen.py

示例5: pyPEOE_VSA_

# 需要导入模块: from rdkit.Chem import Crippen [as 别名]
# 或者: from rdkit.Chem.Crippen import _Init [as 别名]
def pyPEOE_VSA_(mol, bins=None, force=1):
  """ *Internal Use Only*
  """
  if not force:
    try:
      res = mol._peoeVSA
    except AttributeError:
      pass
    else:
      if res.all():
        return res
  if bins is None:
    bins = chgBins
  Crippen._Init()
  #print('\ts:',repr(mol.GetMol()))
  #print('\t\t:',len(mol.GetAtoms()))
  rdPartialCharges.ComputeGasteigerCharges(mol)

  #propContribs = [float(x.GetProp('_GasteigerCharge'))  for x in mol.GetAtoms()]
  propContribs = []
  for at in mol.GetAtoms():
    p = at.GetProp('_GasteigerCharge')
    try:
      v = float(p)
    except ValueError:
      v = 0.0
    propContribs.append(v)
  #print '\tp',propContribs
  volContribs = _LabuteHelper(mol)
  #print '\tv',volContribs

  ans = numpy.zeros(len(bins) + 1, 'd')
  for i in range(len(propContribs)):
    prop = propContribs[i]
    vol = volContribs[i + 1]
    if prop is not None:
      bin = bisect.bisect_right(bins, prop)
      ans[bin] += vol

  mol._peoeVSA = ans
  return ans
开发者ID:abradle,项目名称:rdkit,代码行数:43,代码来源:MolSurf.py

示例6: runIt

# 需要导入模块: from rdkit.Chem import Crippen [as 别名]
# 或者: from rdkit.Chem.Crippen import _Init [as 别名]
from __future__ import print_function
from rdkit import RDConfig
import gzip
import os.path
from rdkit.six.moves import cPickle
from rdkit import Chem
from rdkit.Chem import Crippen
Crippen._Init()


def runIt(inFileName, outFileName, smiCol=0, maxMols=-1, delim=','):
  inF = gzip.open(inFileName, 'r')
  outF = open(outFileName, 'wb+')
  mols = []
  nDone = 0
  for line in inF.readlines():
    if line[0] != '#':
      splitL = line.strip().split(delim)
      smi = splitL[smiCol].strip()
      print(smi)
      mol = Chem.MolFromSmiles(smi)
      if mol:
        contribs = Crippen._GetAtomContribs(mol)
        cPickle.dump((smi, contribs), outF)
      nDone += 1
      if maxMols > 0 and nDone >= maxMols:
        break
  outF.close()


if __name__ == '__main__':
开发者ID:abradle,项目名称:rdkit,代码行数:33,代码来源:BuildCrippenTestSet.py


注:本文中的rdkit.Chem.Crippen._Init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。