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

Modify CDK Tanimoto Calculation #238

Closed
Kohulan opened this issue Jun 26, 2023 · 0 comments · Fixed by #235
Closed

Modify CDK Tanimoto Calculation #238

Kohulan opened this issue Jun 26, 2023 · 0 comments · Fixed by #235
Assignees

Comments

@Kohulan
Copy link
Member

Kohulan commented Jun 26, 2023

Modify the function according to this test

@Test
    void testFingerprint() throws Exception {
        IFingerprinter printer = new PubchemFingerprinter(DefaultChemObjectBuilder.getInstance());
        CDKHydrogenAdder adder = CDKHydrogenAdder.getInstance(DefaultChemObjectBuilder.getInstance());

        IAtomContainer mol1 = parser.parseSmiles("c1ccccc1CCc1ccccc1");
        IAtomContainer mol2 = parser.parseSmiles("c1ccccc1CC");

        AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol1);
        AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol2);

        adder.addImplicitHydrogens(mol1);
        adder.addImplicitHydrogens(mol2);

        AtomContainerManipulator.convertImplicitToExplicitHydrogens(mol1);
        AtomContainerManipulator.convertImplicitToExplicitHydrogens(mol2);
       
        //aromaticity model is constructed from electron donation model and cycle finder
        Aromaticity tmpAromaticity = new Aromaticity(ElectronDonation.cdk(), Cycles.cdkAromaticSet());
        tmpAromaticity.apply(mol1);
        tmpAromaticity.apply(mol2);

        BitSet bs1 = printer.getBitFingerprint(mol1).asBitSet();
        BitSet bs2 = printer.getBitFingerprint(mol2).asBitSet();

        Assertions.assertEquals(881, printer.getSize());

        Assertions.assertFalse(FingerprinterTool.isSubset(bs1, bs2), "c1ccccc1CC was detected as a subset of c1ccccc1CCc1ccccc1");
    }
@Kohulan Kohulan self-assigned this Jun 26, 2023
Kohulan added a commit that referenced this issue Jun 26, 2023
@Kohulan Kohulan linked a pull request Jun 26, 2023 that will close this issue
This was referenced Jun 27, 2023
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

Successfully merging a pull request may close this issue.

1 participant