Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

Commit 0f1b3b4

Browse files
committed
added back in graph invarient tie-breaking fix
1 parent 1e7b83a commit 0f1b3b4

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

src/main/java/lychi/LyChIStandardizer.java

+12-12
Original file line numberDiff line numberDiff line change
@@ -2934,18 +2934,18 @@ public static String[] hashKeyArray (Molecule input) {
29342934

29352935
int[] fallbackLookup = new int[atno.length];
29362936

2937-
// try{
2938-
// //set the tie-breaking priority based on the layer-3 information
2939-
// Molecule stdLychi3Mol=getLayer3Equivalent(m1);
2940-
// MolAtom[] matarr1=stdLychi3Mol.getAtomArray();
2941-
//
2942-
// for (int i = 0; i < atno.length; ++i) {
2943-
// fallbackLookup[matarr1[i].getAtomMap()-1]=i;
2944-
// }
2945-
// }catch(Exception e){
2946-
// logger.log(Level.SEVERE,
2947-
// "Can't produce simplified structure from molecule", e);
2948-
// }
2937+
try{
2938+
//set the tie-breaking priority based on the layer-3 information
2939+
Molecule stdLychi3Mol=getLayer3Equivalent(m1);
2940+
MolAtom[] matarr1=stdLychi3Mol.getAtomArray();
2941+
2942+
for (int i = 0; i < atno.length; ++i) {
2943+
fallbackLookup[matarr1[i].getAtomMap()-1]=i;
2944+
}
2945+
}catch(Exception e){
2946+
logger.log(Level.SEVERE,
2947+
"Can't produce simplified structure from molecule", e);
2948+
}
29492949

29502950

29512951
for (int i = 0; i < atno.length; ++i) {

src/test/java/lychi/LychiRegressionTest.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -459,14 +459,14 @@ public static List<Object[]> data(){
459459
"M END","C1CCCCC1").name("meaningless stereo 1"));
460460

461461

462-
// tests.add(LychiTestInstance.equivalentLayer3("[H][C@@](O)(CO)[C@@]([H])(O)[C@]([H])(O)[C@@]([H])(O)C=O", "[H][C@](O)(C=O)[C@@]([H])(O)[C@]([H])(O)[C@]([H])(O)C([2H])([2H])O")
463-
// .name("Hydrogen Isotope Same Layer 3")
464-
// );
465-
//
466-
//
467-
// tests.add(LychiTestInstance.equivalentLayer3("[H][C@]1(CC(O)=O)CCC2=C1N(CC3=CC=C(Cl)C=C3)C4=C2C=C(F)C=C4S(C)(=O)=O", "CS(=O)(=O)C1=CC(F)=CC2=C1N(CC3=CC=C(Cl)C=C3)C4=C2CCC4CC(O)=O")
468-
// .name("Strange graph invariant problem")
469-
// );
462+
tests.add(LychiTestInstance.equivalentLayer3("[H][C@@](O)(CO)[C@@]([H])(O)[C@]([H])(O)[C@@]([H])(O)C=O", "[H][C@](O)(C=O)[C@@]([H])(O)[C@]([H])(O)[C@]([H])(O)C([2H])([2H])O")
463+
.name("Hydrogen Isotope Same Layer 3")
464+
);
465+
466+
467+
tests.add(LychiTestInstance.equivalentLayer3("[H][C@]1(CC(O)=O)CCC2=C1N(CC3=CC=C(Cl)C=C3)C4=C2C=C(F)C=C4S(C)(=O)=O", "CS(=O)(=O)C1=CC(F)=CC2=C1N(CC3=CC=C(Cl)C=C3)C4=C2CCC4CC(O)=O")
468+
.name("Strange graph invariant problem")
469+
);
470470

471471

472472
//tests.add(LychiTestInstance.of("[H][C@](C)(CC)[C@]([H])(NC(=O)[C@]([H])(CCC(O)=O)N=C(O)[C@]([H])(CCC(O)=O)N=C(O)COCCOCCNC(=O)C1=CC2=C(C=C1)C3(OC2=O)C4=C(OC5=C3C=CC(O)=C5)C=C(O)C=C4)C(=O)N[C@@]([H])(CCCC)C(O)=N[C@@]([H])(CCCN=C(N)N)C(O)=N[C@@]([H])(CCCN=C(N)N)C(O)=NCCCOCC(COCCCN=C(O)[C@]([H])(CCCN=C(N)N)N=C(O)[C@]([H])(CCCN=C(N)N)N=C(O)[C@]([H])(CCCC)NC(=O)[C@@]([H])(NC(=O)[C@]([H])(CCC(O)=O)N=C(O)[C@]([H])(CCC(O)=O)N=C(O)COCCOCCNC(=O)C6=CC7=C(C=C6)C8(OC7=O)C9=C(OC%10=C8C=CC(O)=C%10)C=C(O)C=C9)[C@@]([H])(C)CC)(COCCCN=C(O)[C@]([H])(CCCN=C(N)N)N=C(O)[C@]([H])(CCCN=C(N)N)N=C(O)[C@]([H])(CCCC)NC(=O)[C@@]([H])(NC(=O)[C@]([H])(CCC(O)=O)N=C(O)[C@]([H])(CCC(O)=O)N=C(O)COCCOCCNC(=O)C%11=CC%12=C(C=C%11)C%13(OC%12=O)C%14=C(OC%15=C%13C=CC(O)=C%15)C=C(O)C=C%14)[C@@]([H])(C)CC)N=C(N)O","PY2Z7DXNU-UTQVUB5614-U4T1XF2AQV3-U43YSFQF6PCQ").name("big structure"));

0 commit comments

Comments
 (0)