Skip to main content

Biobricks automates bioinformatics data.

Project description

BioBricks

codecov Lifecycle: experimental

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

Installation

To install BioBricks package use the python packagge manager pip.

$ pip install biobricks

Usage

To import BioBricks package use the following state:

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, Tox21 data dataset can be downlaoded with the following statement.

bb.pull('tox21')

Once the dataset is stored locally in the BioBricks library, the data can be loaded 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)

The list of avaible tables can be visulized 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

Complete example

import biobricks as bb

bb.pull('tox21')
tox21 = bb.load('tox21')
tablenames = sorted(list(vars(tox21).keys()))
for tablename in tablenames:
    print(tablename)
ache_p4 = tox21.tox21_ache_p4.to_pandas()
print(ache_p4.head())

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.32.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

biobricks-0.0.32-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file biobricks-0.0.32.tar.gz.

File metadata

  • Download URL: biobricks-0.0.32.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for biobricks-0.0.32.tar.gz
Algorithm Hash digest
SHA256 61f9bc13e0a36850d5d81249c620b35bbca259fdae7313a033484074e2d2eb27
MD5 c2fbde69510128e398559f38f1879b72
BLAKE2b-256 bc0d534ebfe7c416f3553a4575742c465f5cf396ac77d278c655480b3b12b5d2

See more details on using hashes here.

File details

Details for the file biobricks-0.0.32-py3-none-any.whl.

File metadata

  • Download URL: biobricks-0.0.32-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for biobricks-0.0.32-py3-none-any.whl
Algorithm Hash digest
SHA256 fc1b990332f69528deea32680ce5e27e9122197bda99db714e79ac4c25949a54
MD5 e97f25ee2d711306f29111ff66952243
BLAKE2b-256 83e53a903ef53e824e97c15bee1544fb4612e74fc24d339b3e07dee9909e3518

See more details on using hashes here.

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