MolEnc: a molecular encoder using rdkit and OCaml.
  • OCaml 53.2%
  • Python 43.9%
  • Shell 2.8%
Find a file
2026-05-12 17:28:03 +01:00
bin bin/molenc_gpr.py: logic error 2026-05-12 17:28:03 +01:00
data new file: data/fda_approved.smi 2024-11-11 16:17:14 +00:00
doc new file: doc/Ester_KDD_1996_DBSCANclustering.pdf 2020-04-06 11:46:22 +09:00
src Get_sdf_tag: robust to SDF lines containing only one '>' character 2025-10-09 10:13:15 +01:00
.gitignore ignore data/*.svg 2020-06-19 14:42:21 +09:00
deepsmi_test.sh new file: deepsmi_test.sh 2021-05-24 12:33:59 +09:00
dune-project added dune-project 2019-09-09 11:57:38 +09:00
fcodec new file: fcodec 2024-04-18 14:40:45 +09:00
histo.gpl new file: histo.gpl 2020-07-15 17:40:25 +09:00
INSTALL.txt new file: INSTALL.txt 2022-07-06 11:41:34 +02:00
kb_test.sh kb_test.sh: tweak 2019-08-30 17:12:51 +09:00
LICENSE BSD-3 finally 2018-09-13 17:21:11 +09:00
Makefile Makefile: fix -j option of dune build 2022-06-16 15:02:28 +02:00
mol_frag_test.sh mol_frag_test.sh: added --view and --big 2021-01-19 16:01:13 +09:00
molenc.opam molenc.opam: rely on bug-corrected version of dokeysto (v4.0.2) 2025-09-22 13:46:19 +01:00
molenc_frag soft link to exe molenc_frag 2021-01-08 10:49:58 +09:00
README.md updated readme 2021-10-08 08:59:43 +09:00
rfp new file: rfp; soft link to exe 2024-04-10 18:23:30 +09:00
smisur_test.sh new file: smisur_test.sh 2021-01-19 16:11:34 +09:00
tani_est.gpl updated gnuplot script 2019-09-02 16:46:31 +09:00
test.sh test.sh: added some regression test for --pairs 2020-04-30 12:05:20 +09:00
test_BBAD.sh test AD union 2022-01-31 18:07:39 +09:00
test_sdf_read.sh test_sdf_read.sh: set -x; also call the exe directly 2022-06-20 15:27:25 +02:00
test_uhd.sh updated test_uhd.sh 2024-04-25 10:35:48 +09:00

Introduction

MolEnc: a molecular encoder using rdkit and OCaml.

DOI

The implemented fingerprint is J-L Faulon's "Signature Molecular Descriptor" (SMD [1]). This is an unfolded-counted chemical fingerprint. Such fingerprints are less lossy than famous chemical fingerprints like ECFP4. SMD encoding doesn't introduce feature collisions upon encoding. Also, a feature dictionary is created at encoding time. This dictionary can be used later on to map a given feature index to an atom environment. Molenc also implements unfolded-counted atom pairs [2].

For SMD, we recommend using a radius of zero to one (molenc.sh -r 0:1 ...) or zero to two.

Currently, the atom typing scheme being used is: (#pi-electrons, element symbol, #HA neighbors, formal charge).

In the future, we might add pharmacophore feature points[3] (Donor, Acceptor, PosIonizable, NegIonizable, Aromatic, Hydrophobe), to allow a fuzzier description of molecules.

How to install the software

For beginners/non opam users: download and execute the latest self-installer shell script from (https://github.com/UnixJunkie/molenc/releases).

Then execute:

./molenc-5.0.1.sh ~/usr/molenc-5.0.1

This will create ~/usr/molenc-5.0.1/bin/molenc.sh, among other things inside the same directory.

For opam users:

opam install molenc

Do not hesitate to contact the author in case you have problems installing or using the software or if you have any question.

Usage

molenc.sh -i input.smi -o output.txt
         [-d encoding.dix]: reuse existing feature dictionary
         [-r i:j]: fingerprint radius (default=0:1)
         [--pairs]: use atom pairs instead of Faulon's FP
         [-m <int>]: maximum allowed atom-pair distance
                     (default: no limit)
         [--seq]: sequential mode (disable parallelization)
         [-v]: debug mode; keep temp files
         [-n <int>]: max jobs in parallel
         [-c <int>]: chunk size
         [--no-std]: don't standardize input file molecules
                     ONLY USE IF THEY HAVE ALREADY BEEN STANDARDIZED

How to encode a database of molecules:

molenc.sh -i molecules.smi -o molecules.txt

How to encode another database of molecules, but reusing the feature dictionary from another database:

molenc.sh -i other_molecules.smi -o other_molecules.txt -d molecules.txt.dix

Bibliography

[1] Faulon, J. L., Visco, D. P., & Pophale, R. S. (2003). The signature molecular descriptor. 1. Using extended valence sequences in QSAR and QSPR studies. Journal of chemical information and computer sciences, 43(3), 707-720.

[2] Carhart, R. E., Smith, D. H., & Venkataraghavan, R. (1985). Atom pairs as molecular features in structure-activity studies: definition and applications. Journal of Chemical Information and Computer Sciences, 25(2), 64-73.

[3] Kearsley, S. K., Sallamack, S., Fluder, E. M., Andose, J. D., Mosley, R. T., & Sheridan, R. P. (1996). Chemical similarity using physiochemical property descriptors. Journal of Chemical Information and Computer Sciences, 36(1), 118-127.