Add tautomer query to the substructlibrary (#3808)

* Fixes #3797

* [WIP] Add tautomer queries to the substruct library

* Add TautomerQuery to CMake

* Add missing TautomerQuery functions, python wrapper and tests

* Add python wrappers for Substruct Library Tautomer Queries

* Explictly label non-const pattern function now that we have both

* Use boost::shared_ptr not std::shared_ptr

* Fix java builds

* One more try to fix java builds

* Fix Java Tests

* Run clang format

* Reenable tests

* Fix annoyingly stupid bug and annoying commit of debug code

* Fix documentation

* reenable ifdef threadsafe check

* Throw warning and perform tautomer search instead of bailing with incorrect fingerprints

* Simplfy api with templates

* Fix SubstructLibrary java issues

* minor API cleanup

* simplify the SWIG wrappers

Co-authored-by: Brian Kelley <bkelley@relaytx.com>
Co-authored-by: greg landrum <greg.landrum@gmail.com>
This commit is contained in:
Brian Kelley
2021-03-04 22:56:20 -05:00
committed by GitHub
parent e21e2c2af6
commit c8aa10c80f
13 changed files with 643 additions and 273 deletions

View File

@@ -35,7 +35,9 @@
%{
#include <GraphMol/SubstructLibrary/SubstructLibrary.h>
#include <GraphMol/TautomerQuery/TautomerQuery.h>
%}
%shared_ptr(RDKit::TautomerQuery)
%shared_ptr(RDKit::MolHolderBase)
%shared_ptr(RDKit::MolHolder)
%shared_ptr(RDKit::CachedMolHolder)
@@ -43,6 +45,7 @@
%shared_ptr(RDKit::CachedTrustedSmilesMolHolder)
%shared_ptr(RDKit::FPHolderBase)
%shared_ptr(RDKit::PatternHolder)
%shared_ptr(RDKit::TautomerPatternHolder)
%template(UChar_Vect) std::vector<unsigned char>;
@@ -68,6 +71,8 @@
}
}
#ifdef SWIGJAVA
%typemap(jni) std::string RDKit::SubstructLibrary::Serialize "jbyteArray"
@@ -82,8 +87,19 @@
}
#endif
%include <GraphMol/TautomerQuery/TautomerQuery.h>
%include <GraphMol/SubstructLibrary/SubstructLibrary.h>
%extend RDKit::SubstructLibrary {
%template(getMatches) getMatches<ROMol>;
%template(getMatches) getMatches<TautomerQuery>;
%template(countMatches) countMatches<ROMol>;
%template(countMatches) countMatches<TautomerQuery>;
%template(hasMatch) hasMatch<ROMol>;
%template(hasMatch) hasMatch<TautomerQuery>;
}
%pragma(java) modulecode=%{
public static SubstructLibrary SubstructLibraryDeserialize(byte[] b) {
UChar_Vect vec = new UChar_Vect();