Skip to content

Instantly share code, notes, and snippets.

@goraj
Created November 5, 2019 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goraj/2302fe0fe9609cf68fbbf32e06e09569 to your computer and use it in GitHub Desktop.
Save goraj/2302fe0fe9609cf68fbbf32e06e09569 to your computer and use it in GitHub Desktop.
GetSparseCountFingerprint.py
from scipy.sparse import csr_matrix
from rdkit import Chem
from rdkit.Chem.rdFingerprintGenerator import GetRDKitFPGenerator
smiles = 'CC1=C(C=C(C=C1)NC(=O)C2=CC=C(C=C2)CN3CCN(CC3)C)NC4=NC=CC(=N4)C5=CN=CC=C5'
molobj = Chem.MolFromSmiles(smiles)
for max_path in [2,3,4,5,6,7]:
rdk_gen = GetRDKitFPGenerator(maxPath=max_path)
fp = rdk_gen.GetSparseCountFingerprint(molobj)
print(fp.GetLength())
@goraj
Copy link
Author

goraj commented Nov 5, 2019

Output:

18446744073709551615
18446744073709551615
18446744073709551615
18446744073709551615
18446744073709551615
18446744073709551615

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment