Skip to content

Commit

Permalink
WIP! bug with false fragment saturation after separation of double bo…
Browse files Browse the repository at this point in the history
…nded carbon with ring structure;
  • Loading branch information
Mila1004 committed Nov 21, 2024
1 parent fd1df0e commit b7b6d78
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
//</editor-fold>
//
//<editor-fold desc="Constructor">
Expand Down Expand Up @@ -606,6 +607,10 @@ public List<IAtomContainer> fragmentMolecule(IAtomContainer aMolecule)
}
//<editor-fold desc="Molecule Cloning, Property and Arrays Set" defaultstate="collapsed">
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) {
Expand Down Expand Up @@ -672,7 +677,7 @@ public List<IAtomContainer> fragmentMolecule(IAtomContainer aMolecule)
//
//</editor-fold>
//
//<editor-fold desc="Private Methods" defaultstate="collapsed">
//<editor-fold desc="Protected Methods" defaultstate="collapsed">

/**
* Method to fill an IAtom array with the atoms of the input IAtomContainer
Expand Down Expand Up @@ -1047,7 +1052,9 @@ protected IAtomContainerSet extractFragments(IAtom[] anAtomArray, IBond[] aBondA
Objects.requireNonNull(aBondArray);
//<editor-fold desc="Extraction">
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();
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b7b6d78

Please sign in to comment.