Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

45 tests use old fingerprint method (part 2) #53

Merged
merged 3 commits into from
Jul 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tests/utils/fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from rdkit import Chem

# pylint: disable=no-name-in-module
from rdkit.Chem.AllChem import GetMorganFingerprintAsBitVect
from rdkit.Chem import rdFingerprintGenerator as rdkit_fp
from rdkit.DataStructs import ExplicitBitVect
from scipy import sparse

Expand All @@ -34,9 +34,10 @@ def make_sparse_fp(
Feature matrix.
"""
vector_list = []
morgan_fp = rdkit_fp.GetMorganGenerator(radius=radius, fpSize=n_bits)
for smiles in smiles_list:
mol = Chem.MolFromSmiles(smiles) # pylint: disable=no-member
vector = GetMorganFingerprintAsBitVect(mol, radius=radius, nBits=n_bits)
vector = morgan_fp.GetFingerprintAsNumPy(mol)
c-w-feldmann marked this conversation as resolved.
Show resolved Hide resolved
vector_list.append(sparse.csr_matrix(vector))
return sparse.vstack(vector_list)

Expand Down
Loading