mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-06 22:39:55 +08:00
Add Molbundle search to SWIG (#3698)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user