Skip to content

Commit

Permalink
Corrections in readme and wiki code added to test class;
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasSchaub committed Dec 15, 2023
1 parent 2cb7daf commit e0da3a6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ An open implementation of the [Ertl algorithm for functional group identificatio
## Description
The algorithm for automated functional groups detection and extraction of organic molecules developed by Dr Peter Ertl
is implemented on the basis of the [Chemistry Development Kit (CDK)](https://github.com/cdk/cdk). <br/>
The open reimplementation named ErtlFunctionalGroupsFinder is described in a [scientific article](https://doi.org/10.1186/s13321-019-0361-8). <br/>
This open reimplementation named ErtlFunctionalGroupsFinder is described in a [scientific article](https://doi.org/10.1186/s13321-019-0361-8). <br/>
<br>ErtlFunctionalGroupsFinder is also available in the open Java rich client application MORTAR ('MOlecule fRagmenTation fRamework')
where <i>in silico</i> molecule fragmentation can be easily conducted on a given data set and the results visualised
([MORTAR GitHub repository](https://github.com/FelixBaensch/MORTAR), [MORTAR article preprint](https://doi.org/10.26434/chemrxiv-2022-zgg8s)).
Expand Down Expand Up @@ -79,9 +79,12 @@ be pre-installed.

# Acknowledgments
Project team: Sebastian Fritsch, Stefan Neumann, Jonas Schaub, Christoph Steinbeck, and Achim Zielesny.<br/>
The authors like to thank Peter Ertl for describing his algorithm in a way that allowed easy re-implementation.
<br>
Logo: [Kohulan Rajan](https://github.com/Kohulan) <br>
<br>
The authors thank Peter Ertl for describing his algorithm in a way that allowed easy re-implementation.
This is not always the case. We also thank him for valuable discussions.
We appreciate help from Egon Willighagen and John Mayfield with the CDK integration
<br>We appreciate help from Egon Willighagen and John Mayfield with the CDK integration
and from Felix Bänsch for unbiased release testing.

# References
Expand All @@ -96,4 +99,4 @@ and from Felix Bänsch for unbiased release testing.
* [Steinbeck C, Han Y, Kuhn S, Horlacher O, Luttmann E, Willighagen EL. The Chemistry Development Kit (CDK): An Open-Source Java Library for Chemo- and Bioinformatics. J Chem Inform Comput Sci. 2003;43(2):493-500.](https://dx.doi.org/10.1021%2Fci025584y) <br/>
* [Steinbeck C, Hoppe C, Kuhn S, Floris M, Guha R, Willighagen EL. Recent Developments of the Chemistry Development Kit (CDK) - An Open-Source Java Library for Chemo- and Bioinformatics. Curr Pharm Des. 2006; 12(17):2111-2120.](https://doi.org/10.2174/138161206777585274) <br/>
* [May JW and Steinbeck C. Efficient ring perception for the Chemistry Development Kit. J. Cheminform. 2014; 6:3.](https://dx.doi.org/10.1186%2F1758-2946-6-3) <br/>
* [Willighagen EL, Mayfield JW, Alvarsson J, Berg A, Carlsson L, Jeliazkova N, Kuhn S, Pluska T, Rojas-Chertó M, Spjuth O, Torrance G, Evelo CT, Guha R, Steinbeck C, The Chemistry Development Kit (CDK) v2.0: atom typing, depiction, molecular formulas, and substructure searching. J Cheminform. 2017; 9:33.](https://doi.org/10.1186/s13321-017-0220-4)
* [Willighagen EL, Mayfield JW, Alvarsson J, Berg A, Carlsson L, Jeliazkova N, Kuhn S, Pluskal T, Rojas-Chertó M, Spjuth O, Torrance G, Evelo CT, Guha R, Steinbeck C, The Chemistry Development Kit (CDK) v2.0: atom typing, depiction, molecular formulas, and substructure searching. J Cheminform. 2017; 9:33.](https://doi.org/10.1186/s13321-017-0220-4)
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
import org.openscience.cdk.isomorphism.Pattern;
import org.openscience.cdk.isomorphism.VentoFoggia;
import org.openscience.cdk.silent.SilentChemObjectBuilder;
import org.openscience.cdk.smiles.SmiFlavor;
import org.openscience.cdk.smiles.SmilesGenerator;
import org.openscience.cdk.smiles.SmilesParser;
import org.openscience.cdk.tools.ErtlFunctionalGroupsFinder;
import org.openscience.cdk.tools.manipulator.AtomContainerManipulator;
Expand Down Expand Up @@ -198,6 +200,38 @@ public void testFind20() throws Exception {
testFind(moleculeSmiles, expectedFGs);
}

/**
* Example code to be used in the GitHub wiki of the project.
*
* @throws Exception if anything goes wrong
* @author Jonas Schaub
*/
@Test
public void gitHubWikiTest() throws Exception {
//Prepare input
SmilesParser tmpSmiPar = new SmilesParser(SilentChemObjectBuilder.getInstance());
IAtomContainer tmpInputMol = tmpSmiPar.parseSmiles("C[C@@H]1CN(C[C@H](C)N1)C2=C(C(=C3C(=C2F)N(C=C(C3=O)C(=O)O)C4CC4)N)F"); //PubChem CID 5257
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(tmpInputMol);
Aromaticity tmpAromaticity = new Aromaticity(ElectronDonation.cdk(), Cycles.cdkAromaticSet());
tmpAromaticity.apply(tmpInputMol);
//Identify functional groups
ErtlFunctionalGroupsFinder tmpEFGF = new ErtlFunctionalGroupsFinder(); //default: generalization turned on
List<IAtomContainer> tmpFunctionalGroupsList = tmpEFGF.find(tmpInputMol);
SmilesGenerator tmpSmiGen = new SmilesGenerator(SmiFlavor.Canonical | SmiFlavor.UseAromaticSymbols);
for (IAtomContainer tmpFunctionalGroup : tmpFunctionalGroupsList) {
String tmpSmilesString = tmpSmiGen.create(tmpFunctionalGroup);
System.out.println(tmpSmilesString);
}
//non-generalized functional groups
System.out.println("----------------");
tmpEFGF = new ErtlFunctionalGroupsFinder(ErtlFunctionalGroupsFinder.Mode.NO_GENERALIZATION);
tmpFunctionalGroupsList = tmpEFGF.find(tmpInputMol);
for (IAtomContainer tmpFunctionalGroup : tmpFunctionalGroupsList) {
String tmpSmilesString = tmpSmiGen.create(tmpFunctionalGroup);
System.out.println(tmpSmilesString);
}
}

private void testFind(String moleculeSmiles, String[] fGStrings) throws Exception {
testFind(moleculeSmiles, fGStrings, new Aromaticity(ElectronDonation.daylight(), Cycles.all()));
}
Expand Down

0 comments on commit e0da3a6

Please sign in to comment.