mojaie / MolecularGraph.jl

Graph-based molecule modeling toolkit for cheminformatics
MIT License
189 stars 27 forks source link

Some oxygens appear to be SP3 hybridized and aromatic at the same time #100

Open Boxylmer opened 10 months ago

Boxylmer commented 10 months ago

Hey Mojaie!

Should this be happening? I've found a few molecules that have oxygens showing up as SP3 and aromatic, see the MWE below for the ones I've caught.


smiles = [
    "C1=CC=C2C(=C1)C=CC(=O)O2"
    "CC1=NOC=C1"
    "C1=CON=C1"
    "C1=CC=C2C(=C1)C=CO2"
    "C1=COC(=C1)C=O"
    "C1=COC(=C1)C#N"
]
for smile in smiles
    mol = smilestomol(smile)
    hybs = hybridization(mol)
    as = atomsymbol(mol)
    ar = is_aromatic(mol)
    for i in eachindex(hybs, as, ar)
        if hybs[i] == :sp3 && as[i] == :O && ar[i]
            println(smile)
            break
        end
    end
end

Best, Will.

Boxylmer commented 10 months ago

Similarly I'm catching some sp3 aromatic nitrogen and sulfur as well, but not carbon. The full table of the combinations are shown below (I'm working on some fragmentation schemes)

sp3 O (aromatic) => 6
sp3 S => 11
H => 1875
sp3 N => 39
sp2 N (aromatic) => 18
sp2 C (aromatic) => 1425
sp3 O => 166
sp2 C => 118
sp3 I => 2
sp3 Cl => 152
sp2 O => 134
sp3 P => 1
S => 10
sp2 N => 34
sp3 S (aromatic) => 5
P => 2
sp3 F => 35
sp3 N (aromatic) => 11
sp2 S => 3
sp3 Br => 40
sp3 C => 344
sp N => 11
sp C => 16
mojaie commented 7 months ago

Thank you for the comment. I'm working on hybridization now and there maybe some degradation. For now, newly introduced hybridization_delocalized(mol) method may work better.

mojaie commented 7 months ago

Still discretized aromaticity and orbital hybridization is a difficult problem and there should be options which types of atoms are considered aromatic/hybridized