Skip to main content

Biobricks automates bioinformatics data.

Project description

BioBricks

codecov Lifecycle: experimental

Biobricks automates bioinformatics data.

Installation

$ pip install biobricks

Usage

BioBricks is a tool to load data from biological datasets in an easy and automated way.

To import BioBricks package use:

import biobricks as bb

The first time you use BioBricks package, an initialization is required with the following process.

  1. Set an environment variable BBLIB in your shell with the desired location path of BioBricks library. Be sure you have enough available space to save locally your bricks.
export BBLIB=/opt/biobricks
echo $BBLIB
  1. Obtain a BioBricks account from the following link: https://members.biobricks.ai/register. Go to your email an validate your account. Once you succefully login to BioBricks website go to the link https://members.biobricks.ai/token to obtain a token. Copy your token and use it in the following statement:
bb.initialize(<YOUR TOKEN>)

To download a brick and save it locally in your library use the function bb.pull. As an example, with the following statement we can download the Tox21 data dataset

bb.pull('tox21')

Once the dataset is stored locally in the BioBricks library, you can load the data with bb.load function.

tox21 = bb.load('tox21')

This function returns a SimpleNamespace object with all the tables available in the dataset. The tables are store in pyarrow.Table type. To list the available table the in the SimpleNamespace object use:

tablenames = sorted(list(vars(tox21).keys()))
for tablename in tablenames:
    print(tablename)

You can also check the avaible table with the autocomplete functionality in your python editor.

To convert a pyarrow table to a pandas data frame use the following statement:

ache_p4 = tox21.tox21_ache_p4.to_pandas()

To list the bricks currently available in the BioBricks GitHub repository you can visit:

https://github.com/biobricks-ai

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

biobricks-0.0.31.tar.gz (9.8 kB view hashes)

Uploaded Source

Built Distribution

biobricks-0.0.31-py3-none-any.whl (8.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page