Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AlkylStructureFragmenter Implementation #10

Draft
wants to merge 107 commits into
base: production
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
0d207da
added new algorithm AlkylStructureFragmenter.java; exemplary added fi…
Mila1004 Apr 20, 2023
8011316
added further algorithm settings without functionality
Mila1004 Apr 21, 2023
e796701
WIP, Does not Compile! started implementing filter for alkyl structures
Mila1004 Apr 24, 2023
89988ad
added alkyl structure filter functionality in shouldBeFiltered;
Mila1004 Apr 25, 2023
5c283d3
added carbohydrate filter; added longest chain detection; added ring …
Mila1004 Apr 26, 2023
9555f0a
added different ring detection algorithm;
Mila1004 May 2, 2023
a3f5ab2
WIP! working on ring/chain detection
Mila1004 May 3, 2023
543f941
WIP! working on carbon chain detection
Mila1004 May 5, 2023
41b8474
added new algorithm AlkylStructureFragmenter.java; exemplary added fi…
Mila1004 Apr 20, 2023
9326006
added further algorithm settings without functionality
Mila1004 Apr 21, 2023
6b71b46
WIP, Does not Compile! started implementing filter for alkyl structures
Mila1004 Apr 24, 2023
c563270
added alkyl structure filter functionality in shouldBeFiltered;
Mila1004 Apr 25, 2023
7139641
added carbohydrate filter; added longest chain detection; added ring …
Mila1004 Apr 26, 2023
c0ae663
added different ring detection algorithm;
Mila1004 May 2, 2023
1800a8e
WIP! working on ring/chain detection
Mila1004 May 3, 2023
ca4a5c8
WIP! working on carbon chain detection
Mila1004 May 5, 2023
9c9d1ca
Merge branch 'dev-Max-alkylfragmentation' of github.com:FelixBaensch/…
FelixBaensch May 5, 2023
23cc8e5
Depict structure image with fill to fit depending on atom count;
FelixBaensch May 5, 2023
2e328bb
WIP! working on chain detection and extraction
Mila1004 May 9, 2023
7c75ece
WIP! working on carbon chain detection
Mila1004 May 10, 2023
cbc1c84
WIP! Does not compile!
Mila1004 May 11, 2023
e59e0f7
WIP! working on alkyl chain detection
Mila1004 May 12, 2023
b49017c
WIP! fixed alkyl detection bug;
Mila1004 May 15, 2023
e06b346
added detection of conjugated pi systems; fixed filter bug;
Mila1004 May 17, 2023
0c83d87
WIP! working on ring system detection
Mila1004 May 22, 2023
02d12d6
WIP! working on chain detection and extraction
Mila1004 May 23, 2023
7eaa4d2
added ConjugatedPiSystemDetector implementation as ConjugatedPiSystem…
Mila1004 May 23, 2023
276e9f7
WIP! working on ring detection and fragment return;
Mila1004 May 24, 2023
a5645d4
WIP! added hydrogen saturation; added ring system detection;
Mila1004 May 25, 2023
31a2788
WIP! overhauled ring and ring system detection; working on removal of…
Mila1004 May 26, 2023
2e7d7b6
WIP! overhauled ring and ring system detection; working on removal of…
Mila1004 May 26, 2023
dfd4063
Merge branch 'dev-Max-alkylfragmentation' of https://github.com/Felix…
Mila1004 May 30, 2023
a6df6bb
WIP! working on ring system mapping;
Mila1004 May 31, 2023
93c4d8b
added ring system mapping;
Mila1004 Jun 1, 2023
50737bb
added ring and conjugated pi system mapping; added non-ring alkyl ret…
Mila1004 Jun 2, 2023
7480fe8
cleaned code of unnecessary parts;
Mila1004 Jun 5, 2023
66b79db
WIP! working on ring system extraction bug;
Mila1004 Jun 7, 2023
14ff3c0
WIP! working on bond extraction bug for connected rings and ring systems
Mila1004 Jun 14, 2023
c4015db
WIP! working on extraction bug
Mila1004 Jun 21, 2023
204d4df
WIP! working on fragment extraction;
Mila1004 Jun 22, 2023
59aaf45
overhauled molecule mapping;
Mila1004 Jun 23, 2023
ebe88e8
WIP! on hashmap implementation for molecule mapping;
Mila1004 Jun 28, 2023
66e8c10
added hashmap implementation for molecule mapping;
Mila1004 Jun 29, 2023
98f5564
WIP! on extraction from HashMap;
Mila1004 Jul 4, 2023
3c6fd9e
Merge branch 'master' into dev-Max-alkylfragmentation
JonasSchaub Jul 5, 2023
736d007
WIP! on Fragment Extraction;
Mila1004 Jul 5, 2023
ceb9227
fixed ring_bond_ring extraction bug; fragmentation now done inside ar…
Mila1004 Jul 6, 2023
dd3eb2d
cleaned code of deprecated and unnecessary parts;
Mila1004 Jul 6, 2023
27f8952
WIP! on merge changes;
Mila1004 Jul 16, 2023
994119c
WIP! on further merge changes;
Mila1004 Jul 17, 2023
fe10aa3
WIP! on merge changes; reworked fragmentation to include properties;
Mila1004 Jul 18, 2023
37ac325
WIP! on merge changes for AlkylStructureFragmenter;
Mila1004 Jul 19, 2023
fc98e64
added final merge changes;
Mila1004 Jul 20, 2023
e55f047
WIP! started test implementation;
Mila1004 Jul 21, 2023
8457307
WIP! separate fragmentation into private methods;
Mila1004 Jul 24, 2023
975b890
WIP! fragmentation separation into private methods;
Mila1004 Jul 25, 2023
92abad3
added further private methods;
Mila1004 Jul 26, 2023
faba162
added missing JavaDoc;
Mila1004 Jul 28, 2023
91b0ae1
added test classes for ASF and CPSF; added test structures as mol fil…
Mila1004 Jul 31, 2023
722a79c
added extraction functionality for tertiary and quaternary carbons fr…
Mila1004 Aug 1, 2023
9de9877
WIP! overhaul test classes for ASF and CPSF;
Mila1004 Aug 8, 2023
0167c04
WIP! dissect side chains into smaller fragments;
Mila1004 Aug 10, 2023
9c67569
WIP! dissect side chains into smaller fragments;
Mila1004 Aug 11, 2023
1b2ae70
added dissection of linear chains into separate molecules of defined …
Mila1004 Aug 12, 2023
b0ff2cc
added setting for maximum chain length;
Mila1004 Aug 13, 2023
6753a04
fixed ASF test class;
Mila1004 Aug 14, 2023
ad4945b
fixed linear dissection bug; fixed ASF test;
Mila1004 Aug 23, 2023
80ad1bd
pushed ASF test file;
Mila1004 Sep 18, 2023
9745ee6
Merge branch 'master' into dev-Max-alkylfragmentation
JonasSchaub Oct 10, 2023
c898b01
code cleanup;
Mila1004 Oct 25, 2023
be7c4d1
added further pull request changes;
Mila1004 Oct 26, 2023
295d5c3
pull request changes;
Mila1004 Oct 27, 2023
3761c2c
added restriction turn off setting; further pull request changes;
Mila1004 Nov 3, 2023
1610a50
WIP! started test rework;
Mila1004 Nov 6, 2023
6037327
changed side chain fragmentation setting;
Mila1004 Nov 10, 2023
f35de14
further test rework; code cleanup;
Mila1004 Nov 14, 2023
a6bc0aa
WIP! test coverage for private methods;
Mila1004 Nov 16, 2023
79a8c52
Does not Compile! Switch to protected methods and variables;
Mila1004 Nov 17, 2023
facaa7d
WIP! on test coverage; extracted array filling into methods;
Mila1004 Dec 18, 2023
68928fc
WIP! on test coverage and fragmentation architecture rework;
Mila1004 Dec 20, 2023
a0a417b
reworked data stream architecture for atom- and bondarray in all meth…
Mila1004 Jan 19, 2024
9dcab44
Merge branch 'production' into dev-Max-alkylfragmentation
JonasSchaub Apr 19, 2024
5002211
applied IMoleculeFragmenter changes to AlkylStructureFragmenter and C…
Mila1004 Apr 22, 2024
60848fb
solved FileNotFoundException in AlkylStructureFragmenterTest; impleme…
Mila1004 Apr 24, 2024
df30210
WIP! changed test resource getter; changing comparison of resulting a…
Mila1004 Apr 26, 2024
69fa1c0
fixed issue with hydrogen saturation in ASF and its test class;
Mila1004 Jun 11, 2024
26c6481
added check for correct molecular formula/atom count after fragmentat…
Mila1004 Jun 11, 2024
b06caac
added rule in molecular formula check for ignoring CDK pseudo atoms;
Mila1004 Jun 12, 2024
74574d8
added switch/setting for alternative single carbon handling;
Mila1004 Jun 13, 2024
7bca034
fixed bug in ASF test class imported molecule saturation;
Mila1004 Jun 14, 2024
4d4f007
added tests for different ring detection methods;
Mila1004 Jul 6, 2024
f38737d
WIP! spiro carbon detection and extraction;
Mila1004 Jul 8, 2024
bba7d15
WIP! on isolated double-triple bond extraction; WIP! on spiro carbon …
Mila1004 Jul 8, 2024
cc96daa
WIP! on isolated double and triple bond extraction;
Mila1004 Jul 15, 2024
d04d734
added extraction of isolated double and triple bonds;
Mila1004 Jul 17, 2024
1ad9741
WIP extraction of neighbor atoms of tertiary and quaternary carbons;
Mila1004 Jul 18, 2024
cd9aa96
WIP extraction of neighbor atoms of tertiary and quaternary carbons;
Mila1004 Jul 19, 2024
b363891
WIP! in general; added neighbor extraction for tertiary and quaternar…
Mila1004 Jul 22, 2024
9064e97
WIP! rework of general fragment extraction;
Mila1004 Jul 26, 2024
9bf6a3e
reworked ring and conjugated pi system marking; WIP! on test class;
Mila1004 Jul 30, 2024
0e47cc6
fixed falsely placed isolated rings in fused ring systems bug; WIP! o…
Mila1004 Aug 1, 2024
1e5c822
added toggleable extraction of spiro configuration carbons; WIP! on t…
Mila1004 Sep 3, 2024
4bcfa15
reworked basic tests for AlkylStructureFragmenter;
Mila1004 Sep 5, 2024
498151e
merge branch 'production' into dev-Max-alkylfragmentation;
Mila1004 Oct 14, 2024
480cd41
minor adjustments and changes to fragmentation and settings;
Mila1004 Oct 29, 2024
0c089b5
further adjustments regarding code quality;
Mila1004 Oct 31, 2024
1bfcc22
WIP! fixed bug in extraction of double bonded carbon connected to rin…
Mila1004 Nov 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ public boolean hasMoleculeUndergoneSpecificFragmentation(String aKey){
public ImageView getStructure() {
try {
IAtomContainer tmpAtomContainer = this.getAtomContainer();
return new ImageView(DepictionUtil.depictImageWithZoomAndFillToFit(tmpAtomContainer, 1, this.getStructureImageWidth(), this.getStructureImageHeight(), true));
boolean tmpFillToFit = tmpAtomContainer.getAtomCount() > 6;
return new ImageView(DepictionUtil.depictImageWithZoomAndFillToFit(tmpAtomContainer, 1, this.getStructureImageWidth(), this.getStructureImageHeight(), tmpFillToFit));
} catch (CDKException aCDKException) {
Logger.getLogger(MoleculeDataModel.class.getName()).log(Level.SEVERE, aCDKException.toString(), aCDKException);
return new ImageView(DepictionUtil.depictErrorImage(aCDKException.getMessage(), 250, 250));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
import de.unijena.cheminf.mortar.message.Message;
import de.unijena.cheminf.mortar.model.data.FragmentDataModel;
import de.unijena.cheminf.mortar.model.data.MoleculeDataModel;
import de.unijena.cheminf.mortar.model.fragmentation.algorithm.ErtlFunctionalGroupsFinderFragmenter;
import de.unijena.cheminf.mortar.model.fragmentation.algorithm.IMoleculeFragmenter;
import de.unijena.cheminf.mortar.model.fragmentation.algorithm.ScaffoldGeneratorFragmenter;
import de.unijena.cheminf.mortar.model.fragmentation.algorithm.SugarRemovalUtilityFragmenter;
import de.unijena.cheminf.mortar.model.fragmentation.algorithm.*;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check your import settings!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert wildcard import as discussed (even though this is a very special case where this might almost make sense...)

import de.unijena.cheminf.mortar.model.settings.SettingsContainer;
import de.unijena.cheminf.mortar.model.util.BasicDefinitions;
import de.unijena.cheminf.mortar.model.util.ChemUtil;
Expand Down Expand Up @@ -153,6 +150,14 @@ public class FragmentationService {
* Scaffold Generator
*/
private IMoleculeFragmenter ScaffoldGF;
/**
* Alkyl Structure Fragmenter
*/
private IMoleculeFragmenter AlkylSF;
/**
* Conjugated Pi System Fragmenter
*/
private IMoleculeFragmenter ConjPiSysF;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two new fragmenter variables should go to the final class constants like the others.

/**
* List of names of fragmentation algorithms that have already been run
*/
Expand Down Expand Up @@ -198,13 +203,17 @@ public class FragmentationService {
*/
public FragmentationService(SettingsContainer aSettingsContainer){
//Note: Every fragmenter class should only be added once to the array or there will be problems with setting persistence!
this.fragmenters = new IMoleculeFragmenter[3];
this.fragmenters = new IMoleculeFragmenter[5];
this.ertlFGF = new ErtlFunctionalGroupsFinderFragmenter();
this.fragmenters[0] = this.ertlFGF;
this.sugarRUF = new SugarRemovalUtilityFragmenter();
this.fragmenters[1] = this.sugarRUF;
this.ScaffoldGF = new ScaffoldGeneratorFragmenter();
this.fragmenters[2] = this.ScaffoldGF;
this.AlkylSF = new AlkylStructureFragmenter();
this.fragmenters[3] = this.AlkylSF;
this.ConjPiSysF = new ConjugatedPiSystemFragmenter();
this.fragmenters[4] = this.ConjPiSysF;
//
Objects.requireNonNull(aSettingsContainer, "aSettingsContainer must not be null");
this.settingsContainer = aSettingsContainer;
Expand Down
Loading