GithubHelp home page GithubHelp logo

brs-libs's Introduction

brs-libs

Anaconda-Server Badge Anaconda-Server Badge Test suite)

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 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
pytest -v

For further tests and development tools, a CI toolkit is provided in ci folder (see ci/README.md).

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.

brs-libs's People

Contributors

breakthewall avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.