Spaces:
Sleeping
Sleeping
File size: 468 Bytes
6ae852e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
from rdkit.Chem.AtomPairs import Torsions
from rdkit.Chem import DataStructs
import numpy as np
_type = 'topological-based'
def GetTorsionFPs(mol, nBits=2048, binary=True):
'''
atompairs fingerprints
'''
fp = Torsions.GetHashedTopologicalTorsionFingerprint(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
|