User 870ab5b546
02-05-2013 02:18:30
I am normalizing all coordinate bonds A -> B to A+–B– before comparing two structures.
target: P[Pd](P)P |C:0.0,2.1,3.2|
query: [H]P([H])([H])[Pd](P([H])([H])[H])P([H])([H])[H] |C:1.3,5.4,9.8|
The MolSearch is FULL, with charge, radical, and isotope matching set to exact and stereo search type set to STEREO_SPECIFIC.
When my normalization method is the following, JChem returns false for search.isMatching().
public static void normalizeCoordinateBondsNoClone(Molecule mol) {
final String SELF = "Normalize.normalizeCoordinateBondsNoClone: ";
for (MolBond bond : mol.getBondArray()) {
if (bond.getType() == MolBond.COORDINATE) {
final MolAtom atom1 = bond.getAtom1();
if (!ChemUtils.isMulticenterAtom(atom1)) {
final MolAtom atom2 = bond.getAtom2();
bond.setType(1);
atom1.setCharge(atom1.getCharge() + 1);
atom2.setCharge(atom2.getCharge() - 1);
} // if bond involves multiatom group
} // if bond is coordinate
} // for each bond
} // normalizeCoordinateBondsNoClone(Molecule)
Here are the MRVs of the Molecules after bond normalization in this case:
MolCompare.matchExact: target:
<?xml version="1.0"?>
<cml version="ChemAxon file format v5.10.0, generated by v5.11.5">
<MDocument>
<MChemicalStruct>
<molecule molID="m1">
<atomArray atomID="a1 a2 a3 a4" elementType="P Pd P P" formalCharge="1 -3 1 1" x2="2.3099999999999996 1.54 2.3100000000000005 0.0" y2="1.3336791218280357 0.0 -1.3336791218280353 0.0"/>
<bondArray>
<bond atomRefs2="a1 a2" order="1"/>
<bond atomRefs2="a3 a2" order="1"/>
<bond atomRefs2="a4 a2" order="1"/>
</bondArray>
</molecule>
</MChemicalStruct>
</MDocument>
</cml>
query:
<?xml version="1.0"?>
<cml version="ChemAxon file format v5.10.0, generated by v5.11.5">
<MDocument>
<MChemicalStruct>
<molecule molID="m1">
<atomArray atomID="a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13" elementType="H P H H Pd P H H H P H H H" formalCharge="0 1 0 0 -3 1 0 0 0 1 0 0 0" x2="3.6436791218280353 2.3099999999999996 3.079999999999999 0.9763208781719639 1.54 2.3100000000000005 0.9763208781719652 3.080000000000001 3.643679121828036 0.0 9.42978035343462E-17 -1.54 -2.828934106030386E-16" y2="0.563679121828036 1.3336791218280357 2.6673582436560714 2.1036791218280357 0.0 -1.3336791218280353 -2.1036791218280357 -2.6673582436560705 -0.563679121828035 0.0 1.54 1.885956070686924E-16 -1.54"/>
<bondArray>
<bond atomRefs2="a1 a2" order="1"/>
<bond atomRefs2="a2 a3" order="1"/>
<bond atomRefs2="a2 a4" order="1"/>
<bond atomRefs2="a2 a5" order="1"/>
<bond atomRefs2="a6 a5" order="1"/>
<bond atomRefs2="a6 a7" order="1"/>
<bond atomRefs2="a6 a8" order="1"/>
<bond atomRefs2="a6 a9" order="1"/>
<bond atomRefs2="a10 a5" order="1"/>
<bond atomRefs2="a10 a11" order="1"/>
<bond atomRefs2="a10 a12" order="1"/>
<bond atomRefs2="a10 a13" order="1"/>
</bondArray>
</molecule>
</MChemicalStruct>
</MDocument>
</cml>
However, if I move the command bond.setType(1) to after setting the atom charges, JChem returns true. Here are the MRVs of the Molecules after bond normalization in this case:
MolCompare.matchExact: target:
<?xml version="1.0"?>
<cml version="ChemAxon file format v5.10.0, generated by v5.11.5">
<MDocument>
<MChemicalStruct>
<molecule molID="m1">
<atomArray atomID="a1 a2 a3 a4" elementType="P Pd P P" formalCharge="1 -3 1 1" x2="2.3099999999999996 1.54 2.3100000000000005 0.0" y2="1.3336791218280357 0.0 -1.3336791218280353 0.0"/>
<bondArray>
<bond atomRefs2="a1 a2" order="1"/>
<bond atomRefs2="a3 a2" order="1"/>
<bond atomRefs2="a4 a2" order="1"/>
</bondArray>
</molecule>
</MChemicalStruct>
</MDocument>
</cml>
query:
<?xml version="1.0"?>
<cml version="ChemAxon file format v5.10.0, generated by v5.11.5">
<MDocument>
<MChemicalStruct>
<molecule molID="m1">
<atomArray atomID="a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13" elementType="H P H H Pd P H H H P H H H" formalCharge="0 1 0 0 -3 1 0 0 0 1 0 0 0" x2="3.6436791218280353 2.3099999999999996 3.079999999999999 0.9763208781719639 1.54 2.3100000000000005 0.9763208781719652 3.080000000000001 3.643679121828036 0.0 9.42978035343462E-17 -1.54 -2.828934106030386E-16" y2="0.563679121828036 1.3336791218280357 2.6673582436560714 2.1036791218280357 0.0 -1.3336791218280353 -2.1036791218280357 -2.6673582436560705 -0.563679121828035 0.0 1.54 1.885956070686924E-16 -1.54"/>
<bondArray>
<bond atomRefs2="a1 a2" order="1"/>
<bond atomRefs2="a2 a3" order="1"/>
<bond atomRefs2="a2 a4" order="1"/>
<bond atomRefs2="a2 a5" order="1"/>
<bond atomRefs2="a6 a5" order="1"/>
<bond atomRefs2="a6 a7" order="1"/>
<bond atomRefs2="a6 a8" order="1"/>
<bond atomRefs2="a6 a9" order="1"/>
<bond atomRefs2="a10 a5" order="1"/>
<bond atomRefs2="a10 a11" order="1"/>
<bond atomRefs2="a10 a12" order="1"/>
<bond atomRefs2="a10 a13" order="1"/>
</bondArray>
</molecule>
</MChemicalStruct>
</MDocument>
</cml>
I don't see any difference in the MRVs in the two cases, yet in one case they match, and the other, they don't. Why would setting the bond type before or after setting the atom charges make a difference in whether the structures match???