class_docstr: RDKit descriptors.
  
  This class computes a list of chemical descriptors like
  molecular weight, number of valence electrons, maximum and
  minimum partial charge, etc using RDKit.
  
  This class can also compute normalized descriptors, if required.
  (The implementation for normalization is based on `RDKit2DNormalized()` method
  in 'descriptastorus' library.)
  
  When the `is_normalized` option is set as True, descriptor values are normalized across the sample
  by fitting a cumulative density function. CDFs were used as opposed to simpler scaling algorithms
  mainly because CDFs have the useful property that 'each value has the same meaning: the percentage
  of the population observed below the raw feature value.'
  
  Warning: Currently, the normalizing cdf parameters are not available for BCUT2D descriptors.
  (BCUT2D_MWHI, BCUT2D_MWLOW, BCUT2D_CHGHI, BCUT2D_CHGLO, BCUT2D_LOGPHI, BCUT2D_LOGPLOW, BCUT2D_MRHI, BCUT2D_MRLOW)
  
  Note
  ----
  This class requires RDKit to be installed.
  
  Examples
  --------
  >>> import deepchem as dc
  >>> smiles = ['CC(=O)OC1=CC=CC=C1C(=O)O']
  >>> featurizer = dc.feat.RDKitDescriptors()
  >>> features = featurizer.featurize(smiles)
  >>> type(features[0])
  <class 'numpy.ndarray'>
  >>> features[0].shape
  (210,)
class_docstr_tok: ["RDKit","descriptors",".","This","class","computes","a","list","of","chemical","descriptors","like","molecular","weight",",","number","of","valence","electrons",",","maximum","and","minimum","partial","charge",",","etc","using","RDKit",".","This","class","can","also","compute","normalized","descriptors",",","if","required",".","(","The","implementation","for","normalization","is","based","on","`","RDKit2DNormalized","(",")","`","method","in","'descriptastorus","'","library",".",")","When","the","`","is_normalized","`","option","is","set","as","True",",","descriptor","values","are","normalized","across","the","sample","by","fitting","a","cumulative","density","function",".","CDFs","were","used","as","opposed","to","simpler","scaling","algorithms","mainly","because","CDFs","have","the","useful","property","that","'each","value","has","the","same","meaning",":","the","percentage","of","the","population","observed","below","the","raw","feature","value",".","'","Warning",":","Currently",",","the","normalizing","cdf","parameters","are","not","available","for","BCUT2D","descriptors",".","(","BCUT2D_MWHI",",","BCUT2D_MWLOW",",","BCUT2D_CHGHI",",","BCUT2D_CHGLO",",","BCUT2D_LOGPHI",",","BCUT2D_LOGPLOW",",","BCUT2D_MRHI",",","BCUT2D_MRLOW",")","Note","--","--","This","class","requires","RDKit","to","be","installed",".","Examples","--","--","--","--",">",">",">","import","deepchem","as","dc",">",">",">","smiles","=","[","'CC","(","=O",")","OC1=CC=CC=C1C","(","=O",")","O","'","]",">",">",">","featurizer","=","dc.feat.RDKitDescriptors","(",")",">",">",">","features","=","featurizer.featurize","(","smiles",")",">",">",">","type","(","features","[","0","]",")","<","class","'numpy.ndarray","'",">",">",">",">","features","[","0","]",".shape","(","210",",",")"]
docstr: Helper function to create dictionary of RDkit descriptors and
  associated cumulative density functions (CDFs) to generate normalized features.
  
  -------------------------------------------------------------------------------
  -------------------------------------------------------------------------------
  Copyright (c) 2018-2021, Novartis Institutes for BioMedical Research Inc.
  All rights reserved.
  
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are
  met:
  
  * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
  * Redistributions in binary form must reproduce the above
      copyright notice, this list of conditions and the following
      disclaimer in the documentation and/or other materials provided
      with the distribution.
  * Neither the name of Novartis Institutes for BioMedical Research Inc.
      nor the names of its contributors may be used to endorse or promote
      products derived from this software without specific prior written
      permission.
  
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  -------------------------------------------------------------------------------
  -------------------------------------------------------------------------------
docstr_tok: ["Helper","function","to","create","dictionary","of","RDkit","descriptors","and","associated","cumulative","density","functions","(","CDFs",")","to","generate","normalized","features",".","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-","Copyright","(","c",")","2018-2021",",","Novartis","Institutes","for","BioMedical","Research","Inc.","All","rights","reserved",".","Redistribution","and","use","in","source","and","binary","forms",",","with","or","without","modification",",","are","permitted","provided","that","the","following","conditions","are","met",":","*","Redistributions","of","source","code","must","retain","the","above","copyright","notice",",","this","list","of","conditions","and","the","following","disclaimer",".","*","Redistributions","in","binary","form","must","reproduce","the","above","copyright","notice",",","this","list","of","conditions","and","the","following","disclaimer","in","the","documentation","and\/or","other","materials","provided","with","the","distribution",".","*","Neither","the","name","of","Novartis","Institutes","for","BioMedical","Research","Inc.","nor","the","names","of","its","contributors","may","be","used","to","endorse","or","promote","products","derived","from","this","software","without","specific","prior","written","permission",".","THIS","SOFTWARE","IS","PROVIDED","BY","THE","COPYRIGHT","HOLDERS","AND","CONTRIBUTORS","''","AS","IS","''","AND","ANY","EXPRESS","OR","IMPLIED","WARRANTIES",",","INCLUDING",",","BUT","NOT","LIMITED","TO",",","THE","IMPLIED","WARRANTIES","OF","MERCHANTABILITY","AND","FITNESS","FOR","A","PARTICULAR","PURPOSE","ARE","DISCLAIMED",".","IN","NO","EVENT","SHALL","THE","COPYRIGHT","OWNER","OR","CONTRIBUTORS","BE","LIABLE","FOR","ANY","DIRECT",",","INDIRECT",",","INCIDENTAL",",","SPECIAL",",","EXEMPLARY",",","OR","CONSEQUENTIAL","DAMAGES","(","INCLUDING",",","BUT","NOT","LIMITED","TO",",","PROCUREMENT","OF","SUBSTITUTE","GOODS","OR","SERVICES",";","LOSS","OF","USE",",","DATA",",","OR","PROFITS",";","OR","BUSINESS","INTERRUPTION",")","HOWEVER","CAUSED","AND","ON","ANY","THEORY","OF","LIABILITY",",","WHETHER","IN","CONTRACT",",","STRICT","LIABILITY",",","OR","TORT","(","INCLUDING","NEGLIGENCE","OR","OTHERWISE",")","ARISING","IN","ANY","WAY","OUT","OF","THE","USE","OF","THIS","SOFTWARE",",","EVEN","IF","ADVISED","OF","THE","POSSIBILITY","OF","SUCH","DAMAGE",".","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-"]
code: def _make_normalised_func_dict(self):
      """
      Helper function to create dictionary of RDkit descriptors and
      associated cumulative density functions (CDFs) to generate normalized features.
  
      -------------------------------------------------------------------------------
      -------------------------------------------------------------------------------
      Copyright (c) 2018-2021, Novartis Institutes for BioMedical Research Inc.
      All rights reserved.
  
      Redistribution and use in source and binary forms, with or without
      modification, are permitted provided that the following conditions are
      met:
  
      * Redistributions of source code must retain the above copyright
          notice, this list of conditions and the following disclaimer.
      * Redistributions in binary form must reproduce the above
          copyright notice, this list of conditions and the following
          disclaimer in the documentation and/or other materials provided
          with the distribution.
      * Neither the name of Novartis Institutes for BioMedical Research Inc.
          nor the names of its contributors may be used to endorse or promote
          products derived from this software without specific prior written
          permission.
  
      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
      "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
      LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
      A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
      OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
      SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
      LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
      DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
      THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
      OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      -------------------------------------------------------------------------------
      -------------------------------------------------------------------------------
  
      """
      normalized_desc = {}
      # get sequence of descriptor names and normalization parameters from DescriptorsNormalizationParameters class
      parameters = DNP.desc_norm_params.items()
  
      for desc_name, (
          distribution_name,
          params,
          minV,
          maxV,
          avg,
          std,
      ) in parameters:
          arg = params[:-2]
          loc = params[-2]
          scale = params[-1]
  
          # get required distribution_ from `scipy.stats` module.
          cont_distribution = getattr(st, distribution_name)
  
          # cdf => cumulative density functions
          # make the cdf with the parameters.
          def norm_cdf(
              v: Union[int, float],
              distribution_: rv_continuous = cont_distribution,
              arg: Sequence[float] = arg,
              loc: float = loc,
              scale: float = scale,
              minV: float = minV,
              maxV: float = maxV,
          ) -> np.ndarray:
              v = distribution_.cdf(
                  np.clip(v, minV, maxV), loc=loc, scale=scale, *arg
              )
              return np.clip(v, 0.0, 1.0)
  
          normalized_desc[desc_name] = norm_cdf
      return normalized_desc
  
file_path: deepchem/deepchem/feat/molecule_featurizers/rdkit_descriptors.py
imports: from typing import List, Sequence, Union, Callable, Dict
  import numpy
  import scipy.stats
  from scipy.stats import rv_continuous
  import logging
  from deepchem.utils.typing import RDKitMol
  from deepchem.feat.base_classes import MolecularFeaturizer
  from deepchem.utils.rdkit_utils import DescriptorsNormalizationParameters
label_desc: Use image node_id 3 for calling the RDKitDescriptors obj's underlying member method code with example usage: obj._make_normalised_func_dict() and returns: normalized_desc, np