mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
Add hasQueryHs (#6702)
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
%include "std_pair.i"
|
||||
|
||||
%{
|
||||
#include <GraphMol/MolOps.h>
|
||||
@@ -46,6 +47,7 @@
|
||||
%ignore RDKit::MolOps::detectChemistryProblems;
|
||||
%include <GraphMol/MolOps.h>
|
||||
%ignore RDKit::MolOps::sanitizeMol(RWMol &,unsigned int &,unsigned int &);
|
||||
%template(BoolPair) std::pair<bool, bool>;
|
||||
|
||||
%inline %{
|
||||
int sanitizeMol(RDKit::RWMol &mol,int sanitizeOps){
|
||||
|
||||
@@ -63,6 +63,19 @@ public class MolQueryTests extends GraphMolTest {
|
||||
assertTrue(m1.hasSubstructMatch(aqmol));
|
||||
assertFalse(m2.hasSubstructMatch(aqmol));
|
||||
}
|
||||
@Test public void testHasQueryHs() {
|
||||
ROMol m2;
|
||||
m2 = RWMol.MolFromSmarts("[#1]",0,false);
|
||||
BoolPair res = RDKFuncs.hasQueryHs(m2);
|
||||
assertTrue(res.getFirst());
|
||||
assertFalse(res.getSecond());
|
||||
|
||||
m2 = RWMol.MolFromSmarts("[#1,C]",0,false);
|
||||
res = RDKFuncs.hasQueryHs(m2);
|
||||
assertTrue(res.getFirst());
|
||||
assertTrue(res.getSecond());
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
org.junit.runner.JUnitCore.main("org.RDKit.BasicMoleculeTests");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user