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

Patch/radical bugs #319

Merged
merged 6 commits into from May 13, 2017
Merged

Patch/radical bugs #319

merged 6 commits into from May 13, 2017

Conversation

johnmay
Copy link
Member

@johnmay johnmay commented May 6, 2017

Whilst reviewing #315 I found some problems with the radical CXSMILES and hydrogen suppression. I've also updated the equality check to use canonical SMILES. Can also make it much easier to show what the reactions are doing (may add another commit).

@johnmay
Copy link
Member Author

johnmay commented May 6, 2017

Rebased now the delta/gamma is swapped

@johnmay
Copy link
Member Author

johnmay commented May 6, 2017

Okay now done correctly :-)

@johnmay
Copy link
Member Author

johnmay commented May 6, 2017

The SMILES makes it clear the gamma one is probably broken... will look into it another point

@johnmay
Copy link
Member Author

johnmay commented May 6, 2017

Sorry delta one broken... hard to keep track of these swaps. The test case is currently a no-op:

[CH2]CCCCCC>>[CH2]CCCCCC |^1:0,7|

However it does do what's expected:

        String smi = "[CH](C)CCCCCCC |^1:0|";
        SmilesParser smipar = new SmilesParser(SilentChemObjectBuilder.getInstance());
        IAtomContainer mol = smipar.parseSmiles(smi);
        IAtomContainerSet reactants = new AtomContainerSet();
        reactants.addAtomContainer(mol);
        List<IReactionProcess> processes = Arrays.<IReactionProcess>asList(new RadicalSiteRrAlphaReaction(),
                                                                           new RadicalSiteRrBetaReaction(),
                                                                           new RadicalSiteRrGammaReaction(),
                                                                           new RadicalSiteRrDeltaReaction());
        SmilesGenerator smigen = new SmilesGenerator();
        for (IReactionProcess process : processes) {
            for (IReaction reaction : process.initiate(reactants, null).reactions()) {
                System.out.println(smigen.create(reaction) + " " + process.getClass().getSimpleName());
            }
        }

produces

[CH](C)CCCCCCC>>C(C)(C[CH2])CCCCC |^1:0,12| RadicalSiteRrAlphaReaction
[CH](C)CCCCCCC>>C(C)(CC[CH2])CCCC |^1:0,13| RadicalSiteRrBetaReaction
[CH](C)CCCCCCC>>C(C)(CCC[CH2])CCC |^1:0,14| RadicalSiteRrGammaReaction
[CH](C)CCCCCCC>>C(C)(CCCC[CH2])CC |^1:0,15| RadicalSiteRrDeltaReaction

@egonw egonw merged commit 780ee9e into master May 13, 2017
@johnmay johnmay deleted the patch/radicalBugs branch June 17, 2017 10:16
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 this pull request may close these issues.

None yet

2 participants