CLI logo Command Line Interface

Installation

To install Leruli CLI, run this command in your terminal:

$ pip install -U leruli

This is the preferred method to install Leruli CLI, as it will always install the most recent stable release.

If you don’t have pip installed, this Python installation guide can guide you through the process.

Leruli CLI

Use leruli.com from both command line and within Python code: a convenience wrapper around the corresponding API .

Features

Cheminformatics

  • graph-to-solvation-energy : Estimate the free energy of solvation in kcal/mol.

  • graph-to-geometry : Returns an approximate 3D geometry from a given graph input.

  • graph-to-formula : Calculates the chemical formula in the Hill system given a graph representation like SMILES.

  • canonical-formula : Expands nested or ill-ordered chemical formulas to conform to the Hill system.)

  • canonical-graph : Returns a canonical version of the input graph-based representation.

Chemical space

  • formula-to-graphs : Returns a list of up to 12 known molecules that are relevant for the given sum formula.

  • graph-to-name : SMILES string to IUPAC name

  • name-to-graph : IUPAC or trivial name to SMILES

Compute

  • formula-to-cost : Estimates the resources required for a single point calculation of a given sum formula and basis set.

  • graph-to-boiling-point : Predicts a boiling point in deg C.

  • graph-to-logD : Predicts logD.

  • graph-to-logP : Predicts logP.

  • graph-to-melting-point : Predicts a melting point in deg C.

  • graph-to-pKa : Predicts the pKa.

Images

  • graph-to-image : Renders a molecule as SVG, PNG, or PDF

Arguments and usage are explained in the documentation .

Examples for command line usage

$ leruli name-to-graph acetone
CC(=O)C

$ leruli graph-to-geometry "CC(=O)C"
10
Generated with https://api.leruli.com/latest/references/BCE2020,BEG2019,rdkit/bibtex
C -1.27026192165113 0.14084775426444 0.00476447523142
C 0.02515865734774 -0.50330451875543 -0.42395679691615
C 1.2579793305529 0.10253815475833 0.20100853006798
O 0.07157373218152 -1.42176383766864 -1.19973295254716
H -1.22116019071807 1.21731682582838 -0.14125628889309
H -1.4330436431626 -0.04892803967934 1.06432799065161
H -2.10110516465872 -0.27062142792271 -0.56236052059465
H 1.38126815602784 1.12055904935252 -0.16250100941439
H 2.13759306261 -0.4780527025027 -0.06252115184424
H 1.15199798147051 0.14140874232516 1.28222772425865

$ leruli graph-to-formula "CC(=O)C"
C3H6O

$ leruli graph-to-solvation-energy CC water 298,300,400,200
  Temperature [K]  Energy of solvation [kcal/mol]
-----------------  --------------------------------
              200  N/A
              298  0.8636409650058766
              300  0.902919806812065
              400  1.9950388437192126

Examples for usage in Python

Load the library

>>> import leruli

Get a SMILES string from a molecule name.

>>> leruli.name_to_graph("acetone")
{'graph': 'CC(=O)C', 'reference': 'wikidata'}

Get a geometry for given molecular graph.

>>> print(leruli.graph_to_geometry('CC(=O)C', "XYZ")['geometry'])
10
Generated with https://api.leruli.com/latest/references/BCE2020,BEG2019,rdkit/bibtex
C -1.27026192165113 0.14084775426444 0.00476447523142
C 0.02515865734774 -0.50330451875543 -0.42395679691615
C 1.2579793305529 0.10253815475833 0.20100853006798
O 0.07157373218152 -1.42176383766864 -1.19973295254716
H -1.22116019071807 1.21731682582838 -0.14125628889309
H -1.4330436431626 -0.04892803967934 1.06432799065161
H -2.10110516465872 -0.27062142792271 -0.56236052059465
H 1.38126815602784 1.12055904935252 -0.16250100941439
H 2.13759306261 -0.4780527025027 -0.06252115184424
H 1.15199798147051 0.14140874232516 1.28222772425865

Get the sum formula from a molecular graph.

>>> leruli.graph_to_formula("CC=O")
{'formula': 'C2H4O', 'reference': 'M2013,rdkit'}

Cheminformatics

leruli canonical-formula

Canonicalize a sum formula.

leruli canonical-formula [OPTIONS] FORMULA

Options

--version <version>

Request specific API version.

--reference

Print references for the result.

Arguments

FORMULA

Required argument

leruli canonical-graph

Canonicalize a graph.

leruli canonical-graph [OPTIONS] GRAPH

Options

--version <version>

Request specific API version.

--reference

Print references for the result.

Arguments

GRAPH

Required argument

leruli graph-to-formula

Obtain a formula from a graph.

leruli graph-to-formula [OPTIONS] GRAPH

Options

--version <version>

Request specific API version.

--reference

Print references for the result.

Arguments

GRAPH

Required argument

leruli graph-to-geometry

Molecular geometry from a graph.

leruli graph-to-geometry [OPTIONS] GRAPH

Options

--format <format>

File format for output, defaults to XYZ.

Options

XYZ | PDB | SDF

--version <version>

Request specific API version.

--reference

Print references for the result.

Arguments

GRAPH

Required argument

leruli graph-to-solvation-energy

Estimate the free energy of solvation.

leruli graph-to-solvation-energy [OPTIONS] GRAPH SOLVENT TEMPERATURES

Options

--version <version>

Request specific API version.

--reference

Print references for the result.

--quiet

Hide progress bar.

Arguments

GRAPH

Required argument

SOLVENT

Required argument

TEMPERATURES

Required argument

leruli graph-to-image

Structure formula as image file.

leruli graph-to-image [OPTIONS] GRAPH FILENAME

Options

--version <version>

Request specific API version.

--angle <angle>

Rotation angle.

--format <format>

File format for output, defaults to SVG.

Options

SVG | PNG | PDF

--reference

Print references for the result.

Arguments

GRAPH

Required argument

FILENAME

Required argument

Chemical Space

leruli formula-to-cost

Obtain a cost estimate for a molecule.

leruli formula-to-cost [OPTIONS] FORMULA BASISSET

Options

--version <version>

Request specific API version.

--reference

Print references for the result.

Arguments

FORMULA

Required argument

BASISSET

Required argument

leruli graph-to-name

Obtain a name from a graph.

leruli graph-to-name [OPTIONS] GRAPH

Options

--version <version>

Request specific API version.

--reference

Print references for the result.

Arguments

GRAPH

Required argument

leruli name-to-graph

Obtain a graph from a name.

leruli name-to-graph [OPTIONS] NAME

Options

--version <version>

Request specific API version.

--reference

Print references for the result.

Arguments

NAME

Required argument

leruli formula-to-graphs

Find molecular graphs of a given sum formula.

leruli formula-to-graphs [OPTIONS] FORMULA

Options

--version <version>

Request specific API version.

--reference

Print references for the result.

Arguments

FORMULA

Required argument

Physical Chemistry

leruli graph-to-boiling-point

Estimate a boiling point in deg C.

leruli graph-to-boiling-point [OPTIONS] GRAPH

Options

--version <version>

Request specific API version.

--reference

Print references for the result.

Arguments

GRAPH

Required argument

leruli graph-to-melting-point

Estimate a melting point in deg C.

leruli graph-to-melting-point [OPTIONS] GRAPH

Options

--version <version>

Request specific API version.

--reference

Print references for the result.

Arguments

GRAPH

Required argument

leruli graph-to-logp

Estimate a logP.

leruli graph-to-logp [OPTIONS] GRAPH

Options

--version <version>

Request specific API version.

--reference

Print references for the result.

Arguments

GRAPH

Required argument

leruli graph-to-logd

Estimate a logD.

leruli graph-to-logd [OPTIONS] GRAPH

Options

--version <version>

Request specific API version.

--reference

Print references for the result.

Arguments

GRAPH

Required argument

leruli graph-to-pka

Estimate a pKa.

leruli graph-to-pka [OPTIONS] GRAPH

Options

--version <version>

Request specific API version.

--reference

Print references for the result.

Arguments

GRAPH

Required argument

Cloud Compute

leruli task-get

Get the status of a job in the queue.

leruli task-get [OPTIONS] [BUCKET]

Arguments

BUCKET

Optional argument

leruli task-prune

Deletes the input/output files of a bucket.

leruli task-prune [OPTIONS] [BUCKET]

Arguments

BUCKET

Optional argument

leruli task-publish-code

Uploads a local docker image to the queue.

leruli task-publish-code [OPTIONS] CODE VERSION

Arguments

CODE

Required argument

VERSION

Required argument

leruli task-status

Get the status of a job in the queue.

leruli task-status [OPTIONS] [JOBID]

Arguments

JOBID

Optional argument

leruli task-submit

Submit a job to the Leruli queue. This is a paid feature requiring an API secret, which can be obtained from info @ leruli . com .

leruli task-submit [OPTIONS] CODE VERSION COMMAND...

Options

--memory <memory>

Memory limit in MB.

--time <time>

Time limit in minutes.

--cores <cores>

Number of cores to allocate.

Arguments

CODE

Required argument

VERSION

Required argument

COMMAND

Required argument(s)