Skip to content

CLI to search molecules with substructures matches

Notifications You must be signed in to change notification settings

pagel-s/molgrep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Conference Stargazers

molgrep

Small Rust CLI interface to search for molecules with matching substructures from the command line.

molgrep is built on top of rdkitcffi.
Currently directly searching .txt (one smiles per line) and SDF-files is supported (see examples).

Examples

For searching .txt files/ files with a single smiles string per entry

molgrep --smarts c1ccccc1 --path ./smiles.txt

A example input file with 1000 molecules is provided in smiles.txt

To search SDF files just add the file-type flag

molgrep --smarts c1ccccc1 --path ./smiles.sdf --file-type sdf

Either will return all molecules matching the smarts pattern in smiles notation!

Prerequisites:

NOTE: rdkitcffi currently only supports linux , molgrep will thus also only work on linux.

Installation

Download the repo:

git clone https://github.com/pagel-s/molgrep.git  

If you have a rust/cargo installation, just run

cd molgrep
cargo build  
cargo test --lib  

Usage

To execute the molgrep program from anywhere, you need to add the compiled binary to your system's PATH. After building the project, you can do this by running:

export PATH=$PATH:/PATH/TO/REPO/molgrep/target/debug

You can also add this line to your shell's configuration file (e.g., .bashrc or .zshrc) to make the change permanent.

Make sure to set your LD_LIBRARY_PATH environment variable according to rdkitcffi: After installation you may want to update your LD_LIBRARY_PATH in order to run binaries without cargo, e.g.: export LD_LIBRARY_PATH=/home/username/rdkitcffi/lib/rdkitcffi_linux/linux-64/:$LD_LIBRARY_PATH

About

CLI to search molecules with substructures matches

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages