Skip to content

ConjugatedPiSystemsDetector path dependency regarding allenes / cumulative double bonds #1210

@JonasSchaub

Description

@JonasSchaub

Dear all,

@Mila1004 and I suspect that the results generated by the ConjugatedPiSystemsDetector class might be path-dependent, especially for allenes / cumulative double bonds, i.e. they depend on how the atom indices are placed because that determines which path the algorithm takes when iterating through the molecule.

Take these examples:

SmilesParser sp = new SmilesParser(SilentChemObjectBuilder.getInstance());
SmilesGenerator sg = new SmilesGenerator(SmiFlavor.Canonical);
String[] smiles = {"C=CC=C=CC=C", "C(=CC=C)=CC=C", "CC=C=CC=C", "C(=CC=C)=CC", "C=C=CC#N", "C(=C)=CC#N"};
for (String smi : smiles) {
    System.out.println("\nInput : " + smi);
    IAtomContainer mol = sp.parseSmiles(smi);
    IAtomContainerSet acSet = ConjugatedPiSystemsDetector.detect(mol);
    for (int i = 0; i < acSet.getAtomContainerCount(); i++) {
        IAtomContainer ac = acSet.getAtomContainer(i);
        System.out.println("\tOuput: " + sg.create(ac));
    }
}

Output:

Input : C=CC=C=CC=C
	Ouput: [C]=CC=C //as expected
	Ouput: [C]=CC=C

Input : C(=CC=C)=CC=C //same mol as above but differently ordered SMILES code
	Ouput: C(=CC=C)=CC=C //different result, the allene is now part of the conjugated system

Input : CC=C=CC=C
	Ouput: [C]=CC=C //as expected

Input : C(=CC=C)=CC //same mol as above but differently ordered SMILES code
	Ouput: [CH]=C=CC=C //different result, the allene is now part of the conjugated system

Input : C=C=CC#N
	Ouput: [C]=CC#N //as expected

Input : C(=C)=CC#N //same mol as above but differently ordered SMILES code
	Ouput: N#CC=C=C //different result, the allene is now part of the conjugated system

What do you think about this? Are we doing sth. wrong? Do you see a potential fix?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions