Is there a simple way to count functional groups?

Hello!

I'm having a list of SMILES and I would like to receive columns which contain the numbers of each functional group for a molecule.

 

I've noticed that there is an RDKit Functional Group Filter Node which lists many functional groups. Since there is a node to filter by functional groups I assumed that there might also be one that counts and lists those functional groups.

 

Help is much appreciated!

Kind regards

mtest

The SMARTS patterns for the functional groups are viewable if you press the 'i' button in the Functional Group filter node - the best you could do probably at the moment is to use those as the basis for a second input table for the RDKit Substructure Counter node, although I would assume that it wouldn't be a huge leap for the RDKit developers to create a counter rather than filter version of the FG node

Steve

1 Like

Hey,

that helped me a lot already - thank you very much!

Also I'd really appreciate such a node for future...

 

mtest

The functional group definitions that the RDKit uses for the Functional Group Filter node happen to all be in github:

https://github.com/rdkit/rdkit/blob/master/Data/Functional_Group_Hierarchy.txt

Thanks to the fact that KNIME's file reader node can read from a URL, you can use these directly in a workflow after a bit of post-processing.

The attached workflow does just that.

Since the RDKit repo has another set of functional groups (these were collected for a different purpose and are broader, but perhaps not as carefully defined):

https://github.com/rdkit/rdkit/blob/master/Data/FunctionalGroups.txt

I created a second metanode that reads those in and does the required post-processing. 

And, finally, since there is also a set of SMARTS for "Topliss descriptors":

https://github.com/rdkit/rdkit/blob/master/Data/FragmentDescriptors.csv

I created a metanode for those as well.

Hopefully the general pattern I use here, as well as the workflow itself, is useful.

-greg

 

2 Likes

Hey greg,

thanks this workflow is very helpful!!