Add Molbundle search to SWIG (#3698)

This commit is contained in:
Gareth Jones
2021-01-07 07:53:50 +00:00
committed by GitHub
parent 88298d6500
commit fcd72bb953

View File

@@ -61,6 +61,7 @@
#include <GraphMol/MolDraw2D/MolDraw2DSVG.h>
#include <GraphMol/PartialCharges/GasteigerCharges.h>
#include <GraphMol/new_canon.h>
#include <GraphMol/MolBundle.h>
#include <sstream>
%}
@@ -219,6 +220,27 @@ void setPreferCoordGen(bool);
return mvs;
};
bool hasSubstructMatch(RDKit::MolBundle & query,
RDKit::SubstructMatchParameters ps) {
ps.maxMatches = 1;
std::vector<RDKit::MatchVectType> mv = SubstructMatch(*($self), query, ps);
return mv.size() > 0;
};
std::vector<std::pair<int, int>> getSubstructMatch(
RDKit::MolBundle & query, RDKit::SubstructMatchParameters ps) {
std::vector<RDKit::MatchVectType> mvs = SubstructMatch(*($self), query, ps);
RDKit::MatchVectType mv;
if (mvs.size()) mv = mvs[0];
return mv;
};
std::vector<std::vector<std::pair<int, int>>> getSubstructMatches(
RDKit::MolBundle & query, RDKit::SubstructMatchParameters ps) {
std::vector<RDKit::MatchVectType> mvs = SubstructMatch(*($self), query, ps);
return mvs;
};
/* From MolOps, Substruct/SubstructMatch */
std::vector<std::pair<int, int> > getSubstructMatch(RDKit::ROMol &query,bool useChirality=false){
RDKit::MatchVectType mv;