File size: 453 Bytes
c0ec7e6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from rdkit.Chem.AtomPairs import Pairs
from rdkit.Chem import DataStructs
import numpy as np

_type = 'topological-based'


def GetAtomPairFPs(mol, nBits=2048, binary=True):
    '''
    atompairs fingerprints
    '''
    fp = Pairs.GetHashedAtomPairFingerprint(mol, nBits=nBits)
    if binary:
        arr = np.zeros((0,), dtype=np.bool_)
    else:
        arr = np.zeros((0,), dtype=np.int8)
    DataStructs.ConvertToNumpyArray(fp, arr)
    return arr