Skip to main content

brs-libs

Anaconda-Server Badge Anaconda-Server Badge

Libraries for rpTools:

  • rpSBML
  • rpCache
  • inchikeyMIRIAM

rpSBML

Defines SBML structure with additional fields relative to RetroPath2 objects.

rpCache

Memory management

File mode

This is the default mode. All cache data are stored into files on disk and loaded in memory each time the tool is used. In this mode, fingerprint in memory is equal to the size of cache files loaded in memory multiplied by the number of processes which are running at the same time. Option can be specified by --store-mode file.

DB mode

In order to save memory space, cache data can be loaded once in a database (redis) so that the memory space taken is equal to one instance of the cache, whatever the number of processes whic are running. Option can be specified by --store-mode <db_host>, where db_host is the hostname on which redis server is running.

Install

From pip

rpCompletion requires RDKit which is not available through pip. It can be installed through Conda:

[sudo] conda install -c conda-forge rdkit

Then, install brs_libs:

[sudo] python -m pip install brs_libs

From Conda

[sudo] conda install -c brsynth -c conda-forge brs_libs

Use

Load rpCache in memory

Full cache into files

from brs_libs import rpCache

rpcache = rpCache(db='file')
print(rpcache.cid_src)

Full cache into Redis DB For multiple instances of rpCache simultaneously, rpCache can be loaded into one single Redis database:

from brs_libs import rpCache

rpcache = rpCache(db='localhost')
print(rpcache.cid_src)

localhost means that rpCache will look for a redis database locally. If there is not, it will start a brand new redis server. localhost could be replaced by any hostname that hosts the Redis database.

A part of cache For less loading time and memory footprint, a part of the cache can be loaded:

from brs_libs import rpCache

rpcache = rpCache(attrs='cid_strc')
print(rpcache.cid_src)

(Re-)generate the cache

From Python code

from brs_libs import rpCache

rpCache.generate_cache(outdir)

From CLI After having installed brs_libs Python module:

python -m brs_libs --gen_cache <folder>

Test

Please follow instructions below ti run tests:

cd tests
./test-in-docker.sh

inchikeyMIRIAM

Uses the rpCache to parse an SBML file to find all the chemical species, and try to recover the inchikey and add it to the MIRIAM annotation.

Authors

  • Melchior du Lac
  • Joan Hérisson

Acknowledgments

  • Thomas Duigou

Licence

brs_libs is released under the MIT licence. See the LICENCE file for details.

Metadata

Release files for brs-libs 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for brs-libs 0.3.0
File Size Uploaded Provenance Actions
brs_libs-0.3.0.tar.gz 43.8 kB Without provenance Details for brs_libs-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for brs-libs 0.3.0
File Interpreter ABI Platform Actions
brs_libs-0.3.0-py3-none-any.whl Python 3 none any Details for brs_libs-0.3.0-py3-none-any.whl

Total release size: 87.0 kB

Release files / brs_libs-0.3.0.tar.gz

Download URL brs_libs-0.3.0.tar.gz
Size 43.8 kB
Tags Source
SHA-256 checksum
How to use checksums
849d83bd2c775ee5a49cdb040de227b1f334ac6540192b3ac8edef6c69720d1a
BLAKE2b-256 checksum
How to use checksums
c4b01f94ecb01b014c1abe68fba229d9269327a8bb55889e3118e43e87aea24b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

Release files / brs_libs-0.3.0-py3-none-any.whl

Download URL brs_libs-0.3.0-py3-none-any.whl
Size 43.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f9673a9651802584f5bac1a508c96b26303ba1bb3d83e86b49060e9e36fb66c
BLAKE2b-256 checksum
How to use checksums
3aa6cb1ebf58c758bec7a51df8d57af73794588ca945dd2cdfde9bbdc006f416
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

Security for brs-libs 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page