CLI based FreeWilson Analysis #chemoinformatics #RDKit

I love a great blog post by @wpwalters‘s ‘Practical Chemoinformatics‘. The blog is worth to read because it provides not only useful knowledge of chemoinformatics but also code. And one of my favorite post is about Free-Wilson(FW). http://practicalcheminformatics.blogspot.com/2018/05/free-wilson-analysis.html

BTW if SAR has an additive trend, FW will be useful tool for finding the best combination of R-Groups ;) (Sure, I know that MedChem often struggle to none additive SAR…)

Fortunately we can use FW analysis code! So now we can do FW analysis conveniently if we have python env.

I would call the code more conveniently, so I modified original code and finally I could call the code from CLI. The code is still under development so I checkout branch to command.

To use the branch, clone from command branch and install it.

$ git clone git@github.com:iwatobipen/Free-Wilson.git -b command
$ cd Free-Wilson
$ pip install -e .

Now free_wilson_xx command will be available.

$ free_wilson_all --help
Usage: free_wilson_all [OPTIONS]

Options:
  --scaffold TEXT  SCAFFOLD_MOLFILE molfile with labeled R-groups
  --in_smi TEXT    INPUT_SMILES_FILE input SMILES file
  --prefix TEXT    JOB_PREFIX job prefix
  --log TEXT
  --act TEXT       ACTIVITY_FILE activity column should be labeled "Act" in
                   the header

  --smarts TEXT    R_GROUP_SMARTS SMARTS pattern to restrict R-group when the
                   scaffold is symmetric

  --max_str TEXT   MAX_SPEC maximum number of R-groups to enumerate specified
                   as a string for R1,R2,R3 e.g. 'a|2,5,8'

  --help           Show this message and exit.

$ free_wilson_rgroup --help
Usage: free_wilson_rgroup [OPTIONS]

Options:
  --prefix TEXT  JOB_PREFIX job prefix
  --in_smi TEXT  INPUT_SMILES_FILE input SMILES file
  --prefix TEXT  JOB_PREFIX job prefix
  --smarts TEXT  R_GROUP_SMARTS SMARTS pattern to restrict R-group when the
                 scaffold is symmetric

  --help         Show this message and exit.

$ free_wilson_regression --help
Usage: free_wilson_regression [OPTIONS]

Options:
  --desc TEXT    name of DESCRIPTOR_FILE
  --act TEXT     ACTIVITY_FILE activity column should be labeled "Act" in the
                 header

  --prefix TEXT  JOB_PREFIX job prefix
  --log TEXT
  --help         Show this message and exit.

$ free_wilson_rgroup --help
Usage: free_wilson_rgroup [OPTIONS]

Options:
  --prefix TEXT  JOB_PREFIX job prefix
  --in_smi TEXT  INPUT_SMILES_FILE input SMILES file
  --prefix TEXT  JOB_PREFIX job prefix
  --smarts TEXT  R_GROUP_SMARTS SMARTS pattern to restrict R-group when the
                 scaffold is symmetric

  --help         Show this message and exit.

To run the demo, go to the data and run the command.

$ cd data
$ free_wilson_all --scaffold scaffold.mol --in_smi fw_mols.smi --act fw_act.csv --prefix test

It will work as same as original code.

I used click for making CLI because it is easy to make CLI. I would like to help command which return help documents when suitable options aren’t provided.

Advertisement

Published by iwatobipen

I'm medicinal chemist in mid size of pharmaceutical company. I love chemoinfo, cording, organic synthesis, my family.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: