package fasmifra

  1. Overview
  2. Docs
Molecular Generation by Fast Assembly of SMILES Fragments


Dune Dependency






Generate molecules fast given a molecular training set.

Properties of the generated molecules might significantly match those of the training set (training set distribution matching).

Reference implementation for a submitted manuscript.

Published: 02 Sep 2021



Reference implementation for the article "Fast Molecular Generation by Assembly of (Deep)SMILES Fragments". Generate molecules fast from a molecular training set while also doing training-set distribution matching.


Installing the software

On Linux, you need python3-rdkit to be installed.

For OCaml programmers, you can clone this repository then type 'make && make install'. Note that you need to have opam installed and configured.

For end-users:

sudo apt install opam
opam init
eval `opam config env`
opam install fasmifra

For programmer end-users, or if the opam package is not ready yet:

sudo apt install opam
opam init
eval `opam config env`
opam pin add fasmifra

We are currently working on an automated self-installer; stay tuned.

Fragmenting molecules

Those molecules are your "molecular training set". -i my_molecules.smi -o my_molecules_frags.smi

If you fragment rather small molecules, you might want to use the -w option and pass a smaller recommended fragment weight than the default (150 Da).

usage: [-h] [-i input.smi] [-o output.smi] [--seed SEED]
                            [-n NB_PASSES] [-w FRAG_WEIGHT]

fragment molecules (tag cleaved bonds)

optional arguments:
  -h, --help      show this help message and exit
  -i input.smi    molecules input file
  -o output.smi   fragments output file
  --seed SEED     RNG seed
  -n NB_PASSES    number of fragmentation passes
  -w FRAG_WEIGHT  fragment weight (default=150Da)

Generating molecules from fragments

fasmifra -n 100000 -i my_molecules_frags.smi -o my_molecules_gen.smi
  -n <int>: how many molecules to generate
  -i <filename>: smiles fragments input file
  -o <filenams>: output file
  [--seed <int>]: RNG seed
  [--deep-smiles]: input/output molecules in DeepSMILES no-rings format


[1] Berenger, F., & Tsuda, K. (2021). "Fast Molecular Generation by Assembly of (Deep)SMILES Fragments". Submitted manuscript.

[2] O'Boyle, N., & Dalke, A. (2018). "DeepSMILES: an adaptation of SMILES for use in machine-learning of chemical structures".

[3] Weininger, D. (1988). SMILES, a chemical language and information system. "1. Introduction to methodology and encoding rules". Journal of chemical information and computer sciences, 28(1), 31-36.

Dependencies (10)

  1. conf-python-3 >= "1.0.0"
  2. conf-rdkit >= "1"
  3. line_oriented >= "1.0.0"
  4. parany >= "12.0.0" & < "13.0.0"
  5. ocaml
  6. minicli >= "5.0.0"
  7. dune >= "1.11"
  8. dolog >= "6.0.0"
  9. batteries >= "3.3.0"
  10. base-unix

Dev Dependencies


Used by