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

Input restrictions for EFGF lifted and some general refactoring and fixing #20

Merged
merged 27 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b2f66c1
Commented-out input restrictions;
JonasSchaub Jan 5, 2024
b9c3dab
Moved test classes into the same folder as the tested classes; moved …
JonasSchaub Jan 5, 2024
82d8d0d
Updated copyright year
JonasSchaub Jan 8, 2024
565e448
Started refactoring code according to internal conventions;
JonasSchaub Jan 8, 2024
436b40a
Continued refactoring;
JonasSchaub Jan 9, 2024
b165266
Refactoring of markAtoms method
JonasSchaub Jan 10, 2024
6b222c5
Overhaul of extractGroups
JonasSchaub Jan 10, 2024
9699ef1
Overhaul of expandGeneralizedEnvironments, WIP
JonasSchaub Jan 11, 2024
d6f9004
Continued refactoring
JonasSchaub Jan 12, 2024
9d8edf6
Overhaul of more methods, WIP
JonasSchaub Jan 12, 2024
b13a14c
Overhaul of partitionIntoGroups()
JonasSchaub Jan 15, 2024
a241b13
Finished refactoring of EFGF for now;
JonasSchaub Jan 15, 2024
2531267
Added new environment mode to only extract marked atoms; added factor…
JonasSchaub Jan 15, 2024
c755e3f
Transferred some utility methods for input testing and preprocessing …
JonasSchaub Jan 15, 2024
8b36bc1
Additional documentation;
JonasSchaub Jan 16, 2024
8682e11
Overhaul of EFGFTest;
JonasSchaub Jan 16, 2024
53704f8
Fixed failing javadoc build
JonasSchaub Jan 17, 2024
ab4d3c4
Pseudo atoms are not identified as hetero atoms anymore;
JonasSchaub Jan 17, 2024
5aa839a
Moved ChEBI analysis to evaluation test;
JonasSchaub Jan 17, 2024
a9b58d5
Added molecule from test find 1 to test for extracting only marked at…
JonasSchaub Jan 22, 2024
82531db
Test for charge neutralization;
JonasSchaub Jan 24, 2024
77c822e
Started cleaning up tests;
JonasSchaub Jan 31, 2024
f97e24a
Started looking at evaluation test;
JonasSchaub Feb 1, 2024
6214bac
Finished cleaning up the evaluation test; some more refactoring and d…
JonasSchaub Feb 1, 2024
9f4f57c
Fixed hydrogen bug and disabled evaluation test;
JonasSchaub Feb 1, 2024
4a2f907
Removed duplicated test methods from evaluation test;
JonasSchaub Feb 2, 2024
07e47c8
Removed unused imports;
JonasSchaub Feb 2, 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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ build/
.gradle

# EFGF evaluation test output
ErtlFunctionalGroupsFinderEvaluationTest_Output/
ErtlFunctionalGroupsFinderEvaluationTest_Output/
ChEBI_complete.sdf
/Output/
2 changes: 1 addition & 1 deletion License-header/License-header.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ErtlFunctionalGroupsFinder for CDK
* Copyright (c) $today.year Sebastian Fritsch, Stefan Neumann, Jonas Schaub, Christoph Steinbeck, and Achim Zielesny
* Copyright (c) 2024 Sebastian Fritsch, Stefan Neumann, Jonas Schaub, Christoph Steinbeck, and Achim Zielesny
*
* Source code is available at <https://github.com/JonasSchaub/ErtlFunctionalGroupsFinder>
*
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ErtlFunctionalGroupsFinder for CDK
* Copyright (C) 2023 Sebastian Fritsch, Stefan Neumann, Jonas Schaub, Christoph Steinbeck, and Achim Zielesny
* Copyright (C) 2024 Sebastian Fritsch, Stefan Neumann, Jonas Schaub, Christoph Steinbeck, and Achim Zielesny
*
* Source code is available at <https://github.com/zielesny/ErtlFunctionalGroupsFinder>
*
Expand Down
1,628 changes: 1,088 additions & 540 deletions src/main/java/org/openscience/cdk/tools/ErtlFunctionalGroupsFinder.java

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ErtlFunctionalGroupsFinder for CDK
* Copyright (c) 2023 Sebastian Fritsch, Stefan Neumann, Jonas Schaub, Christoph Steinbeck, and Achim Zielesny
* Copyright (c) 2024 Sebastian Fritsch, Stefan Neumann, Jonas Schaub, Christoph Steinbeck, and Achim Zielesny
*
* Source code is available at <https://github.com/JonasSchaub/ErtlFunctionalGroupsFinder>
*
Expand Down Expand Up @@ -62,58 +62,60 @@
/**
* An application for testing the performance of the ErtlFunctionalGroupsFinder.find() method under parallelization on
* multiple threads.
* <br><br>
* Legacy code that still assumes that the old input restrictions are turned on.
*
* @author Jonas Schaub
* @version 1.2.0.0
*/
public class ErtlFunctionalGroupsFinderPerformanceSnapshotApp {

//
//<editor-fold defaultstate="collapsed" desc="Private static final constants">
/**
* Name of file for logging occurred exceptions
*/
private static final String EXCEPTIONS_LOG_FILE_NAME = "Exceptions_Log.txt";

//
/**
* Name of file for writing results
*/
private static final String RESULTS_FILE_NAME = "Results.txt";

//
/**
* All allowed atomic numbers to pass to the ErtlFunctionalGroupsFinder;
* String will be split and resulting integers passed to a set
*/
private static final String NON_METALLIC_ATOMIC_NUMBERS = "1,2,6,7,8,9,10,15,16,17,18,34,35,36,53,54,86";
//</editor-fold>

//
//<editor-fold defaultstate="collapsed" desc="Private class variables">
/**
* All allowed atomic numbers to pass to the ErtlFunctionalGroupsFinder as a set of integers (will be parsed from
* NON_METALLIC_ATOMIC_NUMBERS)
*/
private Set<Integer> nonMetallicAtomicNumbersSet;

//
/**
* The working directory (the jar-file's directory)
*/
private String workingPath;

//
/**
* The given number of different threads to use
*/
private int numberOfThreadsToUse;

//
/**
* All molecules loaded from the SD file
*/
private IAtomContainer[] moleculesArray;

//
/**
* The aromaticity model in use
*/
private Aromaticity aromaticityModel;
//</editor-fold>

//
//<editor-fold defaultstate="collapsed" desc="Constructor">
/**
* Instantiates and starts the application. It first loads all molecules from a given SD file into memory and then
Expand Down Expand Up @@ -265,7 +267,7 @@ public ErtlFunctionalGroupsFinderPerformanceSnapshotApp(String[] anArgs) throws
}
}
//</editor-fold>

//
//<editor-fold defaultstate="collapsed" desc="Private methods">
/**
* Performs all preprocessing needed for the ErtlFunctionalGroupsFinder and throws an IllegalArgumentException
Expand Down Expand Up @@ -311,7 +313,7 @@ private IAtomContainer applyFiltersAndPreprocessing(IAtomContainer aMolecule) th
this.aromaticityModel.apply(aMolecule);
return aMolecule;
}

//
/**
* Appends the given exception's stack trace to a log file.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ErtlFunctionalGroupsFinder for CDK
* Copyright (c) 2023 Sebastian Fritsch, Stefan Neumann, Jonas Schaub, Christoph Steinbeck, and Achim Zielesny
* Copyright (c) 2024 Sebastian Fritsch, Stefan Neumann, Jonas Schaub, Christoph Steinbeck, and Achim Zielesny
*
* Source code is available at <https://github.com/JonasSchaub/ErtlFunctionalGroupsFinder>
*
Expand Down Expand Up @@ -33,11 +33,11 @@
* @version 1.2
*/
public class ExtractFunctionalGroupsTask implements Callable<Integer> {

//
private final IAtomContainer[] moleculesArray;

//
private final ErtlFunctionalGroupsFinder ertlFinder;

//
/**
* Instantiates the thread.
*
Expand All @@ -48,7 +48,7 @@ public ExtractFunctionalGroupsTask(IAtomContainer[] aListOfMolecules) {
this.moleculesArray = aListOfMolecules;
this.ertlFinder = new ErtlFunctionalGroupsFinder();
}

//
/**
* Applies the ErtlFunctionalGroupsFinder.find(IAtomContainer container, boolean clone) method on all given
* molecules (parameter clone = false) and counts the occurring exceptions.
Expand All @@ -68,5 +68,4 @@ public Integer call() throws Exception {
}
return tmpExceptionsCounter;
}

}
9 changes: 4 additions & 5 deletions src/main/java/org/openscience/cdk/tools/efgf/app/Main.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ErtlFunctionalGroupsFinder for CDK
* Copyright (c) 2023 Sebastian Fritsch, Stefan Neumann, Jonas Schaub, Christoph Steinbeck, and Achim Zielesny
* Copyright (c) 2024 Sebastian Fritsch, Stefan Neumann, Jonas Schaub, Christoph Steinbeck, and Achim Zielesny
*
* Source code is available at <https://github.com/JonasSchaub/ErtlFunctionalGroupsFinder>
*
Expand All @@ -27,11 +27,11 @@
* @version 1.2
*/
public class Main {

//
private Main() {

// only created because JavaDoc task complained.
}

//
/**
* Starts the application. Command line arguments must be the name of an SD-file to read (must be located in the
* same directory as the application's .jar file) and the number of different threads to use for calculation.
Expand All @@ -46,5 +46,4 @@ public static void main(String[] args) {
System.exit(1);
}
}

}
Loading
Loading