Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing smarts and query features #161

Open
lpatiny opened this issue Feb 24, 2023 · 0 comments
Open

Testing smarts and query features #161

lpatiny opened this issue Feb 24, 2023 · 0 comments

Comments

@lpatiny
Copy link
Member

lpatiny commented Feb 24, 2023

We currently have a problem with the 'long' for query features that prevent us to exaustively test the SmilesParser, in particular for the SMARTS parsing

it.only('smarts, check ethyl any explicit hydrogens', () => {
  const smiles = '[CH3][CH2]';
  const molecule = new Molecule(0, 0);
  const parserWithoutExplicitH = new SmilesParser({ smartsMode: 'smarts' });
  parserWithoutExplicitH.parseMolecule(smiles, { molecule });
  expect(molecule.getAllAtoms()).toBe(2);
  molecule.setAtomQueryFeature(0, Molecule.cAtomQFPiElectronShift, true);
  //molecule.setAtomQueryFeature(0, Molecule.cAtomQFSimpleFeatures, true);
  //molecule.setAtomQueryFeature(1, Molecule.cAtomQFSimpleFeatures, true);
  console.log(molecule.oclMolecule.mAtomQueryFeatures);
  console.log(molecule.getAtomQueryFeatures(0));
  const parserWithExplicitH = new SmilesParser({
    smartsMode: 'smarts',
    makeHydrogenExplicit: true,
  });
  parserWithExplicitH.parseMolecule(smiles, { molecule });
  console.log(molecule.getAtomQueryFeatures(0));
  expect(molecule.getAllAtoms()).toBe(7);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant