From b7b6d78d88424de907a8bf0df07e0a0639f55f00 Mon Sep 17 00:00:00 2001 From: MaxR <60234321+Mila1004@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:59:34 +0100 Subject: [PATCH] WIP! bug with false fragment saturation after separation of double bonded carbon with ring structure; --- .../algorithm/AlkylStructureFragmenter.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/unijena/cheminf/mortar/model/fragmentation/algorithm/AlkylStructureFragmenter.java b/src/main/java/de/unijena/cheminf/mortar/model/fragmentation/algorithm/AlkylStructureFragmenter.java index 9c10350d..6bfe75d8 100644 --- a/src/main/java/de/unijena/cheminf/mortar/model/fragmentation/algorithm/AlkylStructureFragmenter.java +++ b/src/main/java/de/unijena/cheminf/mortar/model/fragmentation/algorithm/AlkylStructureFragmenter.java @@ -215,7 +215,8 @@ public class AlkylStructureFragmenter implements IMoleculeFragmenter{ * Logger of this class. */ private static final Logger logger = Logger.getLogger(AlkylStructureFragmenter.class.getName()); - + //WIP + private IAtomContainer builderInstanceAtomContainer; // // // @@ -606,6 +607,10 @@ public List fragmentMolecule(IAtomContainer aMolecule) } // IAtomContainer tmpClone = aMolecule.clone(); + //WIP + this.builderInstanceAtomContainer = null; + this.builderInstanceAtomContainer = tmpClone.getBuilder().newInstance(IAtomContainer.class); + //IAtomContainer tmpBuilderAtomContainer = tmpClone.getBuilder().newInstance(IAtomContainer.class); int tmpPreFragmentationAtomCount = 0; for (IAtom tmpAtom: tmpClone.atoms()) { if (tmpAtom.getAtomicNumber() != 0) { @@ -672,7 +677,7 @@ public List fragmentMolecule(IAtomContainer aMolecule) // // // - // + // /** * Method to fill an IAtom array with the atoms of the input IAtomContainer @@ -1047,7 +1052,9 @@ protected IAtomContainerSet extractFragments(IAtom[] anAtomArray, IBond[] aBondA Objects.requireNonNull(aBondArray); // IAtomContainerSet tmpExtractionSet = new AtomContainerSet(); - IAtomContainer tmpRingFragmentationContainer = new AtomContainer(); + //WIP + IAtomContainer tmpRingFragmentationContainer = this.builderInstanceAtomContainer.clone(); + //IAtomContainer tmpRingFragmentationContainer = new AtomContainer(); IAtomContainer tmpChainFragmentationContainer = new AtomContainer(); IAtomContainer tmpIsolatedMultiBondsContainer = new AtomContainer(); IAtomContainer tmpTertQuatCarbonContainer = new AtomContainer(); @@ -1094,6 +1101,7 @@ else if (tmpAtom.getProperty(AlkylStructureFragmenter.INTERNAL_ASF_DOUBLE_BOND_M boolean tmpEnd = tmpDoubleToRingBond.getEnd().getProperty(AlkylStructureFragmenter.INTERNAL_ASF_RING_MARKER_KEY); if (tmpBegin || tmpEnd) { tmpRingFragmentationContainer.addAtom(tmpAtom); + //WIP //System.out.println("double bond to ring atom added"); } else { tmpIsolatedMultiBondsContainer.addAtom(tmpAtom);