Skip to content

Commit

Permalink
Merge pull request #20 from JonasSchaub/input_restrictions
Browse files Browse the repository at this point in the history
Input restrictions for EFGF lifted and some general refactoring and fixing
  • Loading branch information
JonasSchaub committed Feb 2, 2024
2 parents 5445f23 + 07e47c8 commit 3ef7f6d
Show file tree
Hide file tree
Showing 14 changed files with 2,116 additions and 1,471 deletions.
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

0 comments on commit 3ef7f6d

Please sign in to comment.