'libraries for rptools'
Project description
brs-libs
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file brs_libs-0.3.0.tar.gz
.
File metadata
- Download URL: brs_libs-0.3.0.tar.gz
- Upload date:
- Size: 43.8 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 849d83bd2c775ee5a49cdb040de227b1f334ac6540192b3ac8edef6c69720d1a |
|
MD5 | 0fc58454150eb7b95ff95589019582fa |
|
BLAKE2b-256 | c4b01f94ecb01b014c1abe68fba229d9269327a8bb55889e3118e43e87aea24b |
File details
Details for the file brs_libs-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: brs_libs-0.3.0-py3-none-any.whl
- Upload date:
- Size: 43.2 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f9673a9651802584f5bac1a508c96b26303ba1bb3d83e86b49060e9e36fb66c |
|
MD5 | 12059022155e437da462230ca0ba2c5f |
|
BLAKE2b-256 | 3aa6cb1ebf58c758bec7a51df8d57af73794588ca945dd2cdfde9bbdc006f416 |