Consider the following molecule:
mol1 = Molecule["O=C(N(CC(NCC(F)(F)F)=O)CN1C2=CC=CC=C2)C31CCN(C(C4=CC(C=NN5)=C5C=C4)=O)CC3"];
In AtomList[mol1]
, the first atom is an oxygen. According to the documentation of MoleculePattern, one of the formats of invocation (the third one) is as follows:
MoleculePattern[mol, {id1, id2, …}] returns a molecule pattern consisting of the atoms from mol with index idi and their connecting bonds.
Thus, I would expect that
MoleculePlot[mol1, MoleculePattern[mol1, {1}]]
would highlight only the first oxygen atom (the orange one, and perhaps the double bond that goes with it). Instead, the output is the following:
All three of the oxygen atoms are highlighted. Is this a bug in MoleculePlot
, or is the documentation incorrect? Is there a workaround to highlight only a single atom at a time?
Thanks in advance
MoleculePattern[mol1, {1}]
returns a pattern that should match atom1
inmol1
. In this case, that pattern also matches other oxygen atoms. To get a pattern to specifically match each oxygen requires a recursive SMARTS. The three oxygen atoms should be matched by{MoleculePattern["[$(O=Cc)]"], MoleculePattern["[$(O=C[R0])]"], MoleculePattern["[$(O=C[R2])]"]}
$\endgroup$