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

type RandomAccessDbFpSupplier

source code

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

DbFp supplier supporting random access:
>>> import os.path
>>> 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__

Method Details [hide private]

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

source code 


DbResults should be a subclass of Dbase.DbResultSet.DbResultBase

Overrides: VLib.Node.VLibNode.__init__

reset(self)

source code 
resets our iteration state

    

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