cheminfo / cheminfo/openchemlib-js
Testing smarts and query features
- Dominant language
- Java
- Stars
- 89
- Forks
- 25
- Avg merge
- 51m
- Merged PRs (30d)
- 1
Description
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
```js
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);
});
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the shown test around SmilesParser, Molecule, smartsMode, and makeHydrogenExplicit in the existing test setup. Compare atom counts and query-feature values for the two parsing modes, then define tests that exercise the SMARTS cases needed for exhaustive coverage without the reported limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100