Molecular Property Table

The OEFilter object allows for the calculation of all the molecular properties it uses during the filtering process without actually applying the filter. This may be useful for caching the OEFilter object results into a database. The OEFilter.SetTable method can be used to specify where to write a tab-delimited table of every property in the associated filter file. This example demonstrates how to write the tabular output to standard out.


A tab-delimited file format was chosen to integrate better with Unix commandline utilities. For example, this allows for quick and easy filter experimentation with the awk command line utility. The following snippet will print the number of molecules (plus one for the header) with a molecular weight greater than 200.

> molproptable drugs.sdf > drugs.txt
> cat drugs.txt | awk -F\t '{if ($12 > 200) { print $12 }}' | wc -l

Furthermore, all database programs have utilities for importing tab-delimited files. Loading the filter results into a third-party database would provide very speedy filter experimentation since the properties would only have to be calculated once and then cached in the database.


Download code