User 870ab5b546
03-05-2009 15:50:48
I'm sure I must be missing something obvious here, but I can't figure out what it could be.
I am comparing the sigma-bond networks of two compounds. I want "exact" stereo searching, that is, a query nonstereo bond matches to a target bond with any stereochemistry.
The code:
debugPrint("matchSigmaNetwork: response after "
+ "adding H atoms and sigmanormalizing: \n"
+ respMol.toFormat("mrv"));
debugPrint("matchSigmaNetwork: author structure after "
+ "adding H atoms and sigmanormalizing: \n"
+ authMol.toFormat("mrv"));
MolSearch search = new MolSearch();
MolSearchOptions searchOpts = new MolSearchOptions();
searchOpts.setSearchType(SearchConstants.EXACT);
searchOpts.setExactBondMatching(false);
searchOpts.setChargeMatching(SearchConstants.CHARGE_MATCHING_IGNORE);
searchOpts.setRadicalMatching(SearchConstants.RADICAL_MATCHING_IGNORE);
searchOpts.setIsotopeMatching(SearchConstants.ISOTOPE_MATCHING_EXACT);
searchOpts.setValenceMatching(false);
searchOpts.setStereoSearchType(SearchConstants.STEREO_SPECIFIC);
searchOpts.setStereoModel(SearchConstants.STEREO_MODEL_GLOBAL);
search.setSearchOptions(searchOpts);
search.setTarget(authMol);
search.setQuery(respMol);
try {
debugPrint("MolFunctions.matchSigmaNetwork: without "
+ "explicit H comparator, match = "
+ search.isMatching());
search.addComparator(new ExplicitHMatcher());
boolean match = search.isMatching();
debugPrint("MolFunctions.matchSigmaNetwork: returning " + match);
return match;
The debug output:
matchSigmaNetwork: response after adding H atoms and sigmanormalizing:
<?xml version="1.0" ?>
<cml>
<MDocument>
<MChemicalStruct>
<molecule molID="m1">
<atomArray>
<atom id="a1" elementType="O"
x2="-2.0693750381469727" y2="1.9356172690826714" />
<atom id="a2" elementType="C"
x2="-3.315241367164001" y2="1.0304006705706712" />
<atom id="a3" elementType="C"
x2="-2.839378949776778" y2="-0.4341467693492209" />
<atom id="a4" elementType="O"
x2="-1.2993711265171655" y2="-0.4341467693492209" />
<atom id="a5" elementType="C"
x2="-0.8235087091299444" y2="1.0304006705706712" />
<atom id="a6" elementType="C"
x2="-3.928323392804061" y2="-1.5230912123765041" />
<atom id="a7" elementType="O"
x2="-5.262002514632096" y2="-0.7530912123765036" />
<atom id="a8" elementType="C"
x2="0.6640170633552206" y2="0.6318193411127893" />
<atom id="a9" elementType="C"
x2="-0.05350870912994421" y2="2.364079792398707" />
<atom id="a10" elementType="O" formalCharge="1"
x2="-0.452090038587826" y2="3.8516055648838723" />
<atom id="a11" elementType="C" formalCharge="-1"
x2="1.4864912908700558" y2="2.364079792398707" />
<atom id="a12" elementType="C"
x2="1.0625983928131038" y2="-0.8557064313723761" />
<atom id="a13" elementType="H"
x2="-4.357646249447952" y2="2.16397557387022" />
<atom id="a14" elementType="H"
x2="-4.82485617388603" y2="0.7259944693762628" />
<atom id="a15" elementType="H"
x2="-2.4720378794394415" y2="-1.9296936720050422" />
<atom id="a16" elementType="H"
x2="-3.727313056785182" y2="-3.049916298892172" />
<atom id="a17" elementType="H"
x2="2.1367263875382956" y2="1.0820717663858035" />
<atom id="a18" elementType="H"
x2="1.893915748828051" y2="1.5586144767669434" />
<atom id="a19" elementType="H"
x2="0.6368544044394577" y2="4.940550007911155" />
<atom id="a20" elementType="H"
x2="2.630934322105242" y2="1.3336186586060648" />
<atom id="a21" elementType="H"
x2="2.2564912908700565" y2="3.697758914226742" />
<atom id="a22" elementType="H"
x2="-0.4249273796720612" y2="-1.2542877608302592" />
<atom id="a23" elementType="H"
x2="1.4611797222709866" y2="-2.343232203857541" />
<atom id="a24" elementType="H"
x2="2.5501241652982687" y2="-0.4571251019144933" />
</atomArray>
<bondArray>
<bond atomRefs2="a1 a2" order="1" />
<bond atomRefs2="a1 a5" order="1" />
<bond atomRefs2="a2 a3" order="1" />
<bond atomRefs2="a3 a4" order="1" />
<bond atomRefs2="a3 a6" order="1">
<bondStereo>W</bondStereo>
</bond>
<bond atomRefs2="a4 a5" order="1" />
<bond atomRefs2="a5 a9" order="1">
<bondStereo>W</bondStereo>
</bond>
<bond atomRefs2="a5 a8" order="1">
<bondStereo>H</bondStereo>
</bond>
<bond atomRefs2="a6 a7" order="1" />
<bond atomRefs2="a12 a8" order="1" />
<bond atomRefs2="a9 a10" order="1" />
<bond atomRefs2="a9 a11" order="1" />
<bond atomRefs2="a2 a13" order="1" />
<bond atomRefs2="a2 a14" order="1" />
<bond atomRefs2="a3 a15" order="1">
<bondStereo>H</bondStereo>
</bond>
<bond atomRefs2="a6 a16" order="1" />
<bond atomRefs2="a8 a17" order="1" />
<bond atomRefs2="a8 a18" order="1" />
<bond atomRefs2="a10 a19" order="1" />
<bond atomRefs2="a11 a20" order="1" />
<bond atomRefs2="a11 a21" order="1" />
<bond atomRefs2="a12 a22" order="1" />
<bond atomRefs2="a12 a23" order="1" />
<bond atomRefs2="a12 a24" order="1" />
</bondArray>
</molecule>
</MChemicalStruct>
</MDocument>
</cml>
matchSigmaNetwork: author structure after adding H atoms and sigmanormalizing:
<?xml version="1.0" ?>
<cml>
<MDocument>
<MChemicalStruct>
<molecule molID="m1">
<atomArray
atomID="a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 a21 a22 a23 a24"
elementType="O C C O C C O C C O C C H H H H H H H H H H H H"
x2="-2.0693750381469727 -3.315241367164001 -2.839378949776778 -1.2993711265171655 -0.8235087091299444 -3.928323392804061 -5.262002514632096 0.6640170633552206 -0.05350870912994421 -0.452090038587826 1.4864912908700558 1.0625983928131038 -4.357646249447952 -4.82485617388603 -2.4720378794394415 -3.727313056785182 2.1367263875382956 1.893915748828051 0.6368544044394577 2.630934322105242 2.2564912908700565 -0.4249273796720612 1.4611797222709866 2.5501241652982687"
y2="1.9356172690826714 1.0304006705706712 -0.4341467693492209 -0.4341467693492209 1.0304006705706712 -1.5230912123765041 -0.7530912123765036 0.6318193411127893 2.364079792398707 3.8516055648838723 2.364079792398707 -0.8557064313723761 2.16397557387022 0.7259944693762628 -1.9296936720050422 -3.049916298892172 1.0820717663858035 1.5586144767669434 4.940550007911155 1.3336186586060648 3.697758914226742 -1.2542877608302592 -2.343232203857541 -0.4571251019144933"
/>
<bondArray>
<bond atomRefs2="a1 a2" order="1" />
<bond atomRefs2="a1 a5" order="1" />
<bond atomRefs2="a2 a3" order="1" />
<bond atomRefs2="a3 a4" order="1" />
<bond atomRefs2="a4 a5" order="1" />
<bond atomRefs2="a3 a6" order="1" />
<bond atomRefs2="a6 a7" order="1" />
<bond atomRefs2="a5 a9" order="1" />
<bond atomRefs2="a9 a10" order="1" />
<bond atomRefs2="a9 a11" order="1" />
<bond atomRefs2="a5 a8" order="1" />
<bond atomRefs2="a12 a8" order="1" />
<bond atomRefs2="a2 a13" order="1" />
<bond atomRefs2="a2 a14" order="1" />
<bond atomRefs2="a3 a15" order="1" />
<bond atomRefs2="a6 a16" order="1" />
<bond atomRefs2="a8 a17" order="1" />
<bond atomRefs2="a8 a18" order="1" />
<bond atomRefs2="a10 a19" order="1" />
<bond atomRefs2="a11 a20" order="1" />
<bond atomRefs2="a11 a21" order="1" />
<bond atomRefs2="a12 a22" order="1" />
<bond atomRefs2="a12 a23" order="1" />
<bond atomRefs2="a12 a24" order="1" />
</bondArray>
</molecule>
</MChemicalStruct>
</MDocument>
</cml>
MolFunctions.matchSigmaNetwork: without explicit H comparator, match = false
MolFunctions.matchSigmaNetwork: returning false
The method ought to return true, but it doesn't. Why not?
The code above is for JChem 5.1.5, but I see similar behavior in JChem 3.2.13. (In the JChem 3.2.13, rather than setting charge and radical matching to IGNORE, we set the charge of every atom to 0 and turn off every radical flag. But we still set search type to EXACT, stereosearch to true, and exact bond matching to false.)