Skip to content

Folding atom pair count fingerprint #7223

Closed Answered by Haonan-Zhang
Haonan-Zhang asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Greg,
Thanks for your comment. Although I still don't get the hash function for the count fingerprint, I manage to create the hashed (folded) BP fingerprint by using the old fingerprint function:

from rdkit.Chem.rdMolDescriptors import GetHashedAtomPairFingerprint
from rdkit.Chem.AtomPairs import Sheridan

def typ_mol(mol):
    typMap = dict(CAT=1, ANI=2, POL=3, DON=4, ACC=5, HYD=6, OTH=7)
    typs = [typMap[x] for x in Sheridan.AssignPattyTypes(mol)]
    return typs

mol = Chem.MolFromSmiles('CCC')
ap = GetHashedAtomPairFingerprint(mol,2048, atomInvariants=typ_mol(mol))
print(ap.GetNonzeroElements())

I notice that GetAtomPairGenerator also has an atomInvariantsGenerator argument, but…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Haonan-Zhang
Comment options

Answer selected by Haonan-Zhang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants