// // Copyright (C) 2018-2021 Boran Adas and other RDKit contributors // // @@ All Rights Reserved @@ // This file is part of the RDKit. // The contents are covered by the terms of the BSD license // which is included in the file license.txt, found at the root // of the RDKit source tree. // #include #include #include #include #include #include #include #include #include #include #include #include #include namespace python = boost::python; namespace np = boost::python::numpy; namespace RDKit { namespace FingerprintWrapper { void convertPyArguments(python::object py_fromAtoms, python::object py_ignoreAtoms, python::object py_atomInvs, python::object py_bondInvs, std::vector *&fromAtoms, std::vector *&ignoreAtoms, std::vector *&customAtomInvariants, std::vector *&customBondInvariants) { if (!py_fromAtoms.is_none()) { unsigned int len = python::extract(py_fromAtoms.attr("__len__")()); if (len) { fromAtoms = new std::vector(); fromAtoms->reserve(len); for (unsigned int i = 0; i < len; ++i) { fromAtoms->push_back(python::extract(py_fromAtoms[i])); } } } if (!py_ignoreAtoms.is_none()) { unsigned int len = python::extract(py_ignoreAtoms.attr("__len__")()); if (len) { ignoreAtoms = new std::vector(); ignoreAtoms->reserve(len); for (unsigned int i = 0; i < len; ++i) { ignoreAtoms->push_back( python::extract(py_ignoreAtoms[i])); } } } if (!py_atomInvs.is_none()) { unsigned int len = python::extract(py_atomInvs.attr("__len__")()); if (len) { customAtomInvariants = new std::vector(); customAtomInvariants->reserve(len); for (unsigned int i = 0; i < len; ++i) { customAtomInvariants->push_back( python::extract(py_atomInvs[i])); } } } if (!py_bondInvs.is_none()) { unsigned int len = python::extract(py_bondInvs.attr("__len__")()); if (len) { customBondInvariants = new std::vector(); customBondInvariants->reserve(len); for (unsigned int i = 0; i < len; ++i) { customBondInvariants->push_back( python::extract(py_bondInvs[i])); } } } return; } template SparseIntVect *getSparseCountFingerprint( const FingerprintGenerator *fpGen, const ROMol &mol, python::object py_fromAtoms, python::object py_ignoreAtoms, const int confId, python::object py_atomInvs, python::object py_bondInvs, python::object py_additionalOutput) { std::vector *fromAtoms = nullptr; std::vector *ignoreAtoms = nullptr; std::vector *customAtomInvariants = nullptr; std::vector *customBondInvariants = nullptr; convertPyArguments(py_fromAtoms, py_ignoreAtoms, py_atomInvs, py_bondInvs, fromAtoms, ignoreAtoms, customAtomInvariants, customBondInvariants); AdditionalOutput *additionalOutput = nullptr; if (!py_additionalOutput.is_none()) { additionalOutput = python::extract(py_additionalOutput); } SparseIntVect *result = fpGen->getSparseCountFingerprint( mol, fromAtoms, ignoreAtoms, confId, additionalOutput, customAtomInvariants, customBondInvariants); delete fromAtoms; delete ignoreAtoms; return result; } template SparseBitVect *getSparseFingerprint( const FingerprintGenerator *fpGen, const ROMol &mol, python::object py_fromAtoms, python::object py_ignoreAtoms, const int confId, python::object py_atomInvs, python::object py_bondInvs, python::object py_additionalOutput) { std::vector *fromAtoms = nullptr; std::vector *ignoreAtoms = nullptr; std::vector *customAtomInvariants = nullptr; std::vector *customBondInvariants = nullptr; convertPyArguments(py_fromAtoms, py_ignoreAtoms, py_atomInvs, py_bondInvs, fromAtoms, ignoreAtoms, customAtomInvariants, customBondInvariants); AdditionalOutput *additionalOutput = nullptr; if (!py_additionalOutput.is_none()) { additionalOutput = python::extract(py_additionalOutput); } SparseBitVect *result = fpGen->getSparseFingerprint( mol, fromAtoms, ignoreAtoms, confId, additionalOutput, customAtomInvariants, customBondInvariants); delete fromAtoms; delete ignoreAtoms; return result; } template SparseIntVect *getCountFingerprint( const FingerprintGenerator *fpGen, const ROMol &mol, python::object py_fromAtoms, python::object py_ignoreAtoms, const int confId, python::object py_atomInvs, python::object py_bondInvs, python::object py_additionalOutput) { std::vector *fromAtoms = nullptr; std::vector *ignoreAtoms = nullptr; std::vector *customAtomInvariants = nullptr; std::vector *customBondInvariants = nullptr; convertPyArguments(py_fromAtoms, py_ignoreAtoms, py_atomInvs, py_bondInvs, fromAtoms, ignoreAtoms, customAtomInvariants, customBondInvariants); AdditionalOutput *additionalOutput = nullptr; if (!py_additionalOutput.is_none()) { additionalOutput = python::extract(py_additionalOutput); } SparseIntVect *result = fpGen->getCountFingerprint( mol, fromAtoms, ignoreAtoms, confId, additionalOutput, customAtomInvariants, customBondInvariants); delete fromAtoms; delete ignoreAtoms; return result; } template ExplicitBitVect *getFingerprint(const FingerprintGenerator *fpGen, const ROMol &mol, python::object py_fromAtoms, python::object py_ignoreAtoms, const int confId, python::object py_atomInvs, python::object py_bondInvs, python::object py_additionalOutput) { std::vector *fromAtoms = nullptr; std::vector *ignoreAtoms = nullptr; std::vector *customAtomInvariants = nullptr; std::vector *customBondInvariants = nullptr; convertPyArguments(py_fromAtoms, py_ignoreAtoms, py_atomInvs, py_bondInvs, fromAtoms, ignoreAtoms, customAtomInvariants, customBondInvariants); AdditionalOutput *additionalOutput = nullptr; if (!py_additionalOutput.is_none()) { additionalOutput = python::extract(py_additionalOutput); } ExplicitBitVect *result = fpGen->getFingerprint( mol, fromAtoms, ignoreAtoms, confId, additionalOutput, customAtomInvariants, customBondInvariants); delete fromAtoms; delete ignoreAtoms; return result; } template python::object getNumPyFingerprint( const FingerprintGenerator *fpGen, const ROMol &mol, python::object py_fromAtoms, python::object py_ignoreAtoms, const int confId, python::object py_atomInvs, python::object py_bondInvs, python::object py_additionalOutput) { std::unique_ptr ebv{ getFingerprint(fpGen, mol, py_fromAtoms, py_ignoreAtoms, confId, py_atomInvs, py_bondInvs, py_additionalOutput)}; npy_intp size[1] = {static_cast(ebv->size())}; PyObject *arr = PyArray_ZEROS(1, size, NPY_UINT8, 0); PyObject *one = PyInt_FromLong(1); for (auto i = 0u; i < ebv->size(); ++i) { if ((*ebv)[i]) { PyArray_SETITEM( (PyArrayObject *)arr, static_cast(PyArray_GETPTR1((PyArrayObject *)arr, i)), one); } } Py_DECREF(one); python::handle<> res(arr); return python::object(res); } template python::object getNumPyCountFingerprint( const FingerprintGenerator *fpGen, const ROMol &mol, python::object py_fromAtoms, python::object py_ignoreAtoms, const int confId, python::object py_atomInvs, python::object py_bondInvs, python::object py_additionalOutput) { std::unique_ptr> fp{ getCountFingerprint(fpGen, mol, py_fromAtoms, py_ignoreAtoms, confId, py_atomInvs, py_bondInvs, py_additionalOutput)}; npy_intp size[1] = {static_cast(fp->size())}; PyObject *arr = PyArray_ZEROS(1, size, NPY_UINT32, 0); for (auto i = 0u; i < fp->size(); ++i) { auto v = (*fp)[i]; if (v) { PyObject *val = PyInt_FromLong(v); PyArray_SETITEM( (PyArrayObject *)arr, static_cast(PyArray_GETPTR1((PyArrayObject *)arr, i)), val); Py_DECREF(val); } } python::handle<> res(arr); return python::object(res); } template std::string getInfoString(const FingerprintGenerator *fpGen) { return std::string(fpGen->infoString()); } const std::vector convertPyArgumentsForBulk( const python::list &py_molVect) { std::vector molVect; if (!py_molVect.is_none()) { unsigned int len = python::extract(py_molVect.attr("__len__")()); if (len) { for (unsigned int i = 0; i < len; i++) { molVect.push_back(python::extract(py_molVect[i])); } } } return molVect; } python::list getSparseCountFPBulkPy(python::list &py_molVect, FPType fPType) { const std::vector molVect = convertPyArgumentsForBulk(py_molVect); auto tempResult = getSparseCountFPBulk(molVect, fPType); python::list result; for (auto &it : *tempResult) { result.append(boost::shared_ptr>(it)); } delete tempResult; return result; } python::list getSparseFPBulkPy(python::list &py_molVect, FPType fpType) { const std::vector molVect = convertPyArgumentsForBulk(py_molVect); auto tempResult = getSparseFPBulk(molVect, fpType); python::list result; for (auto &it : *tempResult) { // todo every other bulk method casts results to boost::shared_ptr, except // this one. It should also be boost::shared_ptr result.append(boost::shared_ptr(it)); } delete tempResult; return result; } python::list getCountFPBulkPy(python::list &py_molVect, FPType fPType) { const std::vector molVect = convertPyArgumentsForBulk(py_molVect); auto tempResult = getCountFPBulk(molVect, fPType); python::list result; for (auto &it : *tempResult) { result.append(boost::shared_ptr>(it)); } delete tempResult; return result; } python::list getFPBulkPy(python::list &py_molVect, FPType fPType) { const std::vector molVect = convertPyArgumentsForBulk(py_molVect); auto tempResult = getFPBulk(molVect, fPType); python::list result; for (auto &it : *tempResult) { result.append(boost::shared_ptr(it)); } delete tempResult; return result; } python::object getAtomCountsHelper(const AdditionalOutput &ao) { if (!ao.atomCounts) { return python::object(); } python::list res; for (const auto v : *ao.atomCounts) { res.append(v); } return python::tuple(res); } python::object getAtomToBitsHelper(const AdditionalOutput &ao) { if (!ao.atomToBits) { return python::object(); } python::list res; for (const auto &lst : *ao.atomToBits) { python::list local; for (const auto v : lst) { local.append(v); } res.append(python::tuple(local)); } return python::tuple(res); } python::object getBitPathsHelper(const AdditionalOutput &ao) { if (!ao.bitPaths) { return python::object(); } python::dict res; for (const auto &pr : *ao.bitPaths) { python::list local; for (const auto &lst : pr.second) { python::list inner; for (const auto v : lst) { inner.append(v); } local.append(python::tuple(inner)); } res[pr.first] = python::tuple(local); } return std::move(res); } python::object getBitInfoMapHelper(const AdditionalOutput &ao) { if (!ao.bitInfoMap) { return python::object(); } python::dict res; for (const auto &pr : *ao.bitInfoMap) { python::list local; for (const auto &v : pr.second) { python::tuple inner = python::make_tuple(v.first, v.second); local.append(inner); } res[pr.first] = python::tuple(local); } return std::move(res); } BOOST_PYTHON_MODULE(rdFingerprintGenerator) { rdkit_import_array(); python::class_( "AtomInvariantsGenerator", python::no_init); python::class_( "BondInvariantsGenerator", python::no_init); python::class_("AdditionalOutput") .def("AllocateAtomToBits", &AdditionalOutput::allocateAtomToBits) .def("AllocateBitInfoMap", &AdditionalOutput::allocateBitInfoMap) .def("AllocateBitPaths", &AdditionalOutput::allocateBitPaths) .def("AllocateAtomCounts", &AdditionalOutput::allocateAtomCounts) .def("GetAtomToBits", &getAtomToBitsHelper) .def("GetBitInfoMap", &getBitInfoMapHelper) .def("GetBitPaths", &getBitPathsHelper) .def("GetAtomCounts", &getAtomCountsHelper); python::class_, boost::noncopyable>( "FingerprintGenerator32", python::no_init) .def("GetSparseCountFingerprint", getSparseCountFingerprint, (python::arg("mol"), python::arg("fromAtoms") = python::list(), python::arg("ignoreAtoms") = python::list(), python::arg("confId") = -1, python::arg("customAtomInvariants") = python::list(), python::arg("customBondInvariants") = python::list(), python::arg("additionalOutput") = python::object()), "Generates a sparse count fingerprint\n\n" " ARGUMENTS:\n" " - mol: molecule to be fingerprinted\n" " - fromAtoms: indices of atoms to use while generating the " "fingerprint\n" " - ignoreAtoms: indices of atoms to exclude while generating " "the fingerprint\n" " - confId: 3D confirmation to use, only used by AtomPair " "fingerprint\n" " - customAtomInvariants: custom atom invariants to be used, " "overrides invariants from the invariant generator\n" " - customBondInvariants: custom bond invariants to be used, " "overrides invariants from the invariant generator\n\n" " - additionalOutput: AdditionalOutput instance used to return " "extra information about the bits\n\n" " RETURNS: a SparseIntVect containing fingerprint\n\n", python::return_value_policy()) .def("GetSparseFingerprint", getSparseFingerprint, (python::arg("mol"), python::arg("fromAtoms") = python::list(), python::arg("ignoreAtoms") = python::list(), python::arg("confId") = -1, python::arg("customAtomInvariants") = python::list(), python::arg("customBondInvariants") = python::list(), python::arg("additionalOutput") = python::object()), "Generates a sparse fingerprint\n\n" " ARGUMENTS:\n" " - mol: molecule to be fingerprinted\n" " - fromAtoms: indices of atoms to use while generating the " "fingerprint\n" " - ignoreAtoms: indices of atoms to exclude while generating " "the fingerprint\n" " - confId: 3D confirmation to use, only used by AtomPair " "fingerprint\n" " - customAtomInvariants: custom atom invariants to be used, " "overrides invariants from the invariant generator\n" " - customBondInvariants: custom bond invariants to be used, " "overrides invariants from the invariant generator\n\n" " - additionalOutput: AdditionalOutput instance used to return " "extra information about the bits\n\n" " RETURNS: a SparseBitVect containing fingerprint\n\n", python::return_value_policy()) .def("GetCountFingerprint", getCountFingerprint, (python::arg("mol"), python::arg("fromAtoms") = python::list(), python::arg("ignoreAtoms") = python::list(), python::arg("confId") = -1, python::arg("customAtomInvariants") = python::list(), python::arg("customBondInvariants") = python::list(), python::arg("additionalOutput") = python::object()), "Generates a count fingerprint\n\n" " ARGUMENTS:\n" " - mol: molecule to be fingerprinted\n" " - fromAtoms: indices of atoms to use while generating the " "fingerprint\n" " - ignoreAtoms: indices of atoms to exclude while generating " "the fingerprint\n" " - confId: 3D confirmation to use, only used by AtomPair " "fingerprint\n" " - customAtomInvariants: custom atom invariants to be used, " "overrides invariants from the invariant generator\n" " - customBondInvariants: custom bond invariants to be used, " "overrides invariants from the invariant generator\n\n" " - additionalOutput: AdditionalOutput instance used to return " "extra information about the bits\n\n" " RETURNS: a SparseIntVect containing fingerprint\n\n", python::return_value_policy()) .def("GetCountFingerprintAsNumPy", getNumPyCountFingerprint, (python::arg("mol"), python::arg("fromAtoms") = python::list(), python::arg("ignoreAtoms") = python::list(), python::arg("confId") = -1, python::arg("customAtomInvariants") = python::list(), python::arg("customBondInvariants") = python::list(), python::arg("additionalOutput") = python::object()), "Generates a count fingerprint\n\n" " ARGUMENTS:\n" " - mol: molecule to be fingerprinted\n" " - fromAtoms: indices of atoms to use while generating the " "fingerprint\n" " - ignoreAtoms: indices of atoms to exclude while generating " "the fingerprint\n" " - confId: 3D confirmation to use, only used by AtomPair " "fingerprint\n" " - customAtomInvariants: custom atom invariants to be used, " "overrides invariants from the invariant generator\n" " - customBondInvariants: custom bond invariants to be used, " "overrides invariants from the invariant generator\n\n" " - additionalOutput: AdditionalOutput instance used to return " "extra information about the bits\n\n" " RETURNS: a numpy array containing the fingerprint\n\n") .def("GetFingerprint", getFingerprint, (python::arg("mol"), python::arg("fromAtoms") = python::list(), python::arg("ignoreAtoms") = python::list(), python::arg("confId") = -1, python::arg("customAtomInvariants") = python::list(), python::arg("customBondInvariants") = python::list(), python::arg("additionalOutput") = python::object()), "Generates a fingerprint\n\n" " ARGUMENTS:\n" " - mol: molecule to be fingerprinted\n" " - fromAtoms: indices of atoms to use while generating the " "fingerprint\n" " - ignoreAtoms: indices of atoms to exclude while generating " "the fingerprint\n" " - confId: 3D confirmation to use, only used by AtomPair " "fingerprint\n" " - customAtomInvariants: custom atom invariants to be used, " "overrides invariants from the invariant generator\n" " - customBondInvariants: custom bond invariants to be used, " "overrides invariants from the invariant generator\n\n" " - additionalOutput: AdditionalOutput instance used to return " "extra information about the bits\n\n" " RETURNS: a ExplicitBitVect containing fingerprint\n\n", python::return_value_policy()) .def("GetFingerprintAsNumPy", getNumPyFingerprint, (python::arg("mol"), python::arg("fromAtoms") = python::list(), python::arg("ignoreAtoms") = python::list(), python::arg("confId") = -1, python::arg("customAtomInvariants") = python::list(), python::arg("customBondInvariants") = python::list(), python::arg("additionalOutput") = python::object()), "Generates a fingerprint\n\n" " ARGUMENTS:\n" " - mol: molecule to be fingerprinted\n" " - fromAtoms: indices of atoms to use while generating the " "fingerprint\n" " - ignoreAtoms: indices of atoms to exclude while generating " "the fingerprint\n" " - confId: 3D confirmation to use, only used by AtomPair " "fingerprint\n" " - customAtomInvariants: custom atom invariants to be used, " "overrides invariants from the invariant generator\n" " - customBondInvariants: custom bond invariants to be used, " "overrides invariants from the invariant generator\n\n" " - additionalOutput: AdditionalOutput instance used to return " "extra information about the bits\n\n" " RETURNS: a numpy array containing the fingerprint\n\n") .def("GetInfoString", getInfoString, "Returns a string containing information about the fingerprint " "generator\n\n" " RETURNS: an information string\n\n"); python::class_, boost::noncopyable>( "FingerprintGenerator64", python::no_init) .def("GetSparseCountFingerprint", getSparseCountFingerprint, (python::arg("mol"), python::arg("fromAtoms") = python::list(), python::arg("ignoreAtoms") = python::list(), python::arg("confId") = -1, python::arg("customAtomInvariants") = python::list(), python::arg("customBondInvariants") = python::list(), python::arg("additionalOutput") = python::object()), "Generates a sparse count fingerprint\n\n" " ARGUMENTS:\n" " - mol: molecule to be fingerprinted\n" " - fromAtoms: indices of atoms to use while generating the " "fingerprint\n" " - ignoreAtoms: indices of atoms to exclude while generating " "the fingerprint\n" " - confId: 3D confirmation to use, only used by AtomPair " "fingerprint\n" " - customAtomInvariants: custom atom invariants to be used, " "overrides invariants from the invariant generator\n" " - customBondInvariants: custom bond invariants to be used, " "overrides invariants from the invariant generator\n\n" " - additionalOutput: AdditionalOutput instance used to return " "extra information about the bits\n\n" " RETURNS: a SparseIntVect containing fingerprint\n\n", python::return_value_policy()) .def("GetSparseFingerprint", getSparseFingerprint, (python::arg("mol"), python::arg("fromAtoms") = python::list(), python::arg("ignoreAtoms") = python::list(), python::arg("confId") = -1, python::arg("customAtomInvariants") = python::list(), python::arg("customBondInvariants") = python::list(), python::arg("additionalOutput") = python::object()), "Generates a sparse fingerprint\n\n" " ARGUMENTS:\n" " - mol: molecule to be fingerprinted\n" " - fromAtoms: indices of atoms to use while generating the " "fingerprint\n" " - ignoreAtoms: indices of atoms to exclude while generating " "the fingerprint\n" " - confId: 3D confirmation to use, only used by AtomPair " "fingerprint\n" " - customAtomInvariants: custom atom invariants to be used, " "overrides invariants from the invariant generator\n" " - customBondInvariants: custom bond invariants to be used, " "overrides invariants from the invariant generator\n\n" " - additionalOutput: AdditionalOutput instance used to return " "extra information about the bits\n\n" " RETURNS: a SparseBitVect containing fingerprint\n\n", python::return_value_policy()) .def("GetCountFingerprint", getCountFingerprint, (python::arg("mol"), python::arg("fromAtoms") = python::list(), python::arg("ignoreAtoms") = python::list(), python::arg("confId") = -1, python::arg("customAtomInvariants") = python::list(), python::arg("customBondInvariants") = python::list(), python::arg("additionalOutput") = python::object()), "Generates a count fingerprint\n\n" " ARGUMENTS:\n" " - mol: molecule to be fingerprinted\n" " - fromAtoms: indices of atoms to use while generating the " "fingerprint\n" " - ignoreAtoms: indices of atoms to exclude while generating " "the fingerprint\n" " - confId: 3D confirmation to use, only used by AtomPair " "fingerprint\n" " - customAtomInvariants: custom atom invariants to be used, " "overrides invariants from the invariant generator\n" " - customBondInvariants: custom bond invariants to be used, " "overrides invariants from the invariant generator\n\n" " - additionalOutput: AdditionalOutput instance used to return " "extra information about the bits\n\n" " RETURNS: a SparseIntVect containing fingerprint\n\n", python::return_value_policy()) .def("GetCountFingerprintAsNumPy", getNumPyCountFingerprint, (python::arg("mol"), python::arg("fromAtoms") = python::list(), python::arg("ignoreAtoms") = python::list(), python::arg("confId") = -1, python::arg("customAtomInvariants") = python::list(), python::arg("customBondInvariants") = python::list(), python::arg("additionalOutput") = python::object()), "Generates a count fingerprint\n\n" " ARGUMENTS:\n" " - mol: molecule to be fingerprinted\n" " - fromAtoms: indices of atoms to use while generating the " "fingerprint\n" " - ignoreAtoms: indices of atoms to exclude while generating " "the fingerprint\n" " - confId: 3D confirmation to use, only used by AtomPair " "fingerprint\n" " - customAtomInvariants: custom atom invariants to be used, " "overrides invariants from the invariant generator\n" " - customBondInvariants: custom bond invariants to be used, " "overrides invariants from the invariant generator\n\n" " - additionalOutput: AdditionalOutput instance used to return " "extra information about the bits\n\n" " RETURNS: a numpy array containing the fingerprint\n\n") .def("GetFingerprint", getFingerprint, (python::arg("mol"), python::arg("fromAtoms") = python::list(), python::arg("ignoreAtoms") = python::list(), python::arg("confId") = -1, python::arg("customAtomInvariants") = python::list(), python::arg("customBondInvariants") = python::list(), python::arg("additionalOutput") = python::object()), "Generates a fingerprint\n\n" " ARGUMENTS:\n" " - mol: molecule to be fingerprinted\n" " - fromAtoms: indices of atoms to use while generating the " "fingerprint\n" " - ignoreAtoms: indices of atoms to exclude while generating " "the fingerprint\n" " - confId: 3D confirmation to use, only used by AtomPair " "fingerprint\n" " - customAtomInvariants: custom atom invariants to be used, " "overrides invariants from the invariant generator\n" " - customBondInvariants: custom bond invariants to be used, " "overrides invariants from the invariant generator\n\n" " - additionalOutput: AdditionalOutput instance used to return " "extra information about the bits\n\n" " RETURNS: a ExplicitBitVect containing fingerprint\n\n", python::return_value_policy()) .def("GetFingerprintAsNumPy", getNumPyFingerprint, (python::arg("mol"), python::arg("fromAtoms") = python::list(), python::arg("ignoreAtoms") = python::list(), python::arg("confId") = -1, python::arg("customAtomInvariants") = python::list(), python::arg("customBondInvariants") = python::list(), python::arg("additionalOutput") = python::object()), "Generates a fingerprint\n\n" " ARGUMENTS:\n" " - mol: molecule to be fingerprinted\n" " - fromAtoms: indices of atoms to use while generating the " "fingerprint\n" " - ignoreAtoms: indices of atoms to exclude while generating " "the fingerprint\n" " - confId: 3D confirmation to use, only used by AtomPair " "fingerprint\n" " - customAtomInvariants: custom atom invariants to be used, " "overrides invariants from the invariant generator\n" " - customBondInvariants: custom bond invariants to be used, " "overrides invariants from the invariant generator\n\n" " - additionalOutput: AdditionalOutput instance used to return " "extra information about the bits\n\n" " RETURNS: a numpy array containing fingerprint\n\n") .def("GetInfoString", getInfoString, "Returns a string containing information about the fingerprint " "generator\n\n" " RETURNS: an information string\n\n"); python::enum_("FPType") .value("RDKitFP", FPType::RDKitFP) .value("MorganFP", FPType::MorganFP) .value("AtomPairFP", FPType::AtomPairFP) .value("TopologicalTorsionFP", FPType::TopologicalTorsionFP) .export_values(); ; python::def("GetSparseCountFPs", &getSparseCountFPBulkPy, (python::arg("molecules") = python::list(), python::arg("fpType") = FPType::MorganFP), ""); python::def("GetSparseFPs", &getSparseFPBulkPy, (python::arg("molecules") = python::list(), python::arg("fpType") = FPType::MorganFP), ""); python::def("GetCountFPs", &getCountFPBulkPy, (python::arg("molecules") = python::list(), python::arg("fpType") = FPType::MorganFP), ""); python::def("GetFPs", &getFPBulkPy, (python::arg("molecules") = python::list(), python::arg("fpType") = FPType::MorganFP), ""); AtomPairWrapper::exportAtompair(); MorganWrapper::exportMorgan(); RDKitFPWrapper::exportRDKit(); TopologicalTorsionWrapper::exportTopologicalTorsion(); } } // namespace FingerprintWrapper } // namespace RDKit