Package rdkit :: Package Chem :: Package Fingerprints :: Module DbFpSupplier :: Class RandomAccessDbFpSupplier
[hide private]
[frames] | no frames]

Class RandomAccessDbFpSupplier

source code

        object --+        
                 |        
VLib.Node.VLibNode --+    
                     |    
          DbFpSupplier --+
                         |
                        RandomAccessDbFpSupplier

DbFp supplier supporting random access:
>>> import os.path
>>> from rdkit import RDConfig
>>> from rdkit.Dbase.DbConnection import DbConnect
>>> fName = RDConfig.RDTestDatabase
>>> conn = DbConnect(fName,'simple_combined')
>>> suppl = RandomAccessDbFpSupplier(conn.GetData())
>>> len(suppl)
12

we can pull individual fingerprints:
>>> fp = suppl[5]
>>> fp.GetNumBits()
128
>>> fp.GetNumOnBits()
54

a standard loop over the fingerprints:
>>> fps = []
>>> for fp in suppl:
...   fps.append(fp)
>>> len(fps)
12

or we can use an indexed loop:
>>> fps = [None]*len(suppl)
>>> for i in range(len(suppl)):
...   fps[i] = suppl[i]
>>> len(fps)
12

Instance Methods [hide private]
 
__init__(self, *args, **kwargs) source code
 
__len__(self) source code
 
__getitem__(self, idx) source code
 
reset(self)
resets our iteration state
source code
 
NextItem(self) source code

Inherited from DbFpSupplier: GetColumnNames, __next__, next

Inherited from DbFpSupplier (private): _BuildFp

Inherited from VLib.Node.VLibNode: AddChild, AddParent, Destroy, GetChildren, GetParents, RemoveChild, RemoveParent, __iter__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

source code 


DbResults should be a subclass of Dbase.DbResultSet.DbResultBase

Overrides: object.__init__
(inherited documentation)

reset(self)

source code 
resets our iteration state

    

Overrides: VLib.Node.VLibNode.reset
(inherited documentation)