Skip to content

rdkit.Chem.rdFingerprintGenerator.GetMorganGenerator() did not match C++ signature #16

Description

@tsa87

There is an error when using splito with rdkit=2024.3.4. nBits is not an argument for rdFingerprintGenerator.GetMorganGenerator, however it is used as the default argument for initalizingGetMorganGenerator here:

MOLECULE_DEFAULT_FEATURIZER = dict(name="ecfp", kwargs=dict(radius=2, nBits=2048))

The documentation for RDKit has fpSize instead. This might have changed in the new version - we should probably update nBits to fpSize.

rdkit.Chem.rdFingerprintGenerator.GetMorganGenerator([(int)radius=3[, (bool)countSimulation=False[, (bool)includeChirality=False[, (bool)useBondTypes=True[, (bool)onlyNonzeroInvariants=False[, (bool)includeRingMembership=True[, (AtomPairsParameters)countBounds=None[, (int)fpSize=2048[, (AtomPairsParameters)atomInvariantsGenerator=None[, (AtomPairsParameters)bondInvariantsGenerator=None[, (bool)includeRedundantEnvironments=False]]]]]]]]]]]) 

Here is the full stacktrace:

    train_idx, test_idx = next(splitter.split(X=keys))
  File "/home/rileyparsons/Function/venv/lib/python3.10/site-packages/sklearn/model_selection/_split.py", line 1841, in split
    for train, test in self._iter_indices(X, y, groups):
  File "/home/rileyparsons/Function/venv/lib/python3.10/site-packages/splito/_distance_split_base.py", line 125, in _iter_indices
    X, self._metric = convert_to_default_feats_if_smiles(X, self._metric, n_jobs=self._n_jobs)
  File "/home/rileyparsons/Function/venv/lib/python3.10/site-packages/splito/_distance_split_base.py", line 51, in convert_to_default_feats_if_smiles
    X = dm.utils.parallelized(_to_feats, X, n_jobs=n_jobs)
  File "/home/rileyparsons/Function/venv/lib/python3.10/site-packages/datamol/utils/jobs.py", line 256, in parallelized
    return runner(fn, inputs_list, arg_type=arg_type)
  File "/home/rileyparsons/Function/venv/lib/python3.10/site-packages/datamol/utils/jobs.py", line 158, in __call__
    return self.sequential(*args, **kwargs)
  File "/home/rileyparsons/Function/venv/lib/python3.10/site-packages/datamol/utils/jobs.py", line 113, in sequential
    results = [
  File "/home/rileyparsons/Function/venv/lib/python3.10/site-packages/datamol/utils/jobs.py", line 114, in <listcomp>
    JobRunner.wrap_fn(callable_fn, arg_type, **fn_kwargs)(dt)
  File "/home/rileyparsons/Function/venv/lib/python3.10/site-packages/datamol/utils/jobs.py", line 83, in _run
    return fn(args, **fn_kwargs)
  File "/home/rileyparsons/Function/venv/lib/python3.10/site-packages/splito/_distance_split_base.py", line 45, in _to_feats
    feats = dm.to_fp(
  File "/home/rileyparsons/Function/venv/lib/python3.10/site-packages/datamol/fp.py", line 288, in to_fp
    fp_func = fp_func(**fp_args)
Boost.Python.ArgumentError: Python argument types in
    rdkit.Chem.rdFingerprintGenerator.GetMorganGenerator()
did not match C++ signature:
    GetMorganGenerator(unsigned int radius=3, bool countSimulation=False, bool includeChirality=False, bool useBondTypes=True, bool onlyNonzeroInvariants=False, bool includeRingMembership=True, boost::python::api::object {lvalue} countBounds=None, unsigned int fpSize=2048, boost::python::api::object {lvalue} atomInvariantsGenerator=None, boost::python::api::object {lvalue} bondInvariantsGenerator=None, bool includeRedundantEnvironments=False

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions