Skip to main content

A SQLite and DuckDB wrapper suitable for bioinformatic analysis of multi-omic data.

Project description

omilayers

Documentation Status Downloads

omilayers is a Python data management library. It is suitable for multi-omic data analysis, hence the omi prefix, that involves the handling of diverse datasets usually referred to as omic layers. omilayers wraps the APIs of SQLite and DuckDB and provides a high-level interface for frequent and repetitive tasks that involve fast storage, processing and retrieval of data without the need to constantly write SQL queries.

The rationale behind omilayers is the following:

  • User stores layers of omic data (tables in SQL lingo).
  • User creates new layers by processing and restructuring existing layers.
  • User can group layers using tags.
  • User can store a brief description for each layer.

Why omilayers?

Although SQL is a straightfoward language, it can become quite tedious task if it needs to be repeated multiple times. Since data analysis involves highly repetitive procedures, a user would need to create functions as a means to abstract the process of writing SQL queries. The aim of omilayers is to provide this level of abstaction to facilitate bioinformatic data analysis. The omilayers API resembles the pandas API and the user needs to write the following code to parse a column named foo from a layer called omicdata:

with DuckDB (default database)

from omilayers import Omilayers

omi = Omilayers("dbname.duckdb")
result = omi.layers['omicdata']['foo']

with SQLite

from omilayers import Omilayers

omi = Omilayers("dbname.sqlite", engine="sqlite")
result = omi.layers['omicdata']['foo']

Installation

pip install omilayers

Perform unittests

The directory testing includes predefined unittests for SQLite and DuckDB.

To test the functionality of omilayers with SQLite:

python -m unittests -v tests_sqlite.py

To test the functionality of omilayers with DuckDB:

python -m unittests -v tests_duckdb.py

Testing with synthetic omic data

The directory synthetic_data includes two jupyter notebooks (one for SQLite and one for DuckDB) for testing omilayers using synthetic multi-omic data. It also includes the Python script create_synthetic_vcf/synthesize_vcf.py that was used to create the synthetic VCF that is hosted in Zenodo DOI.

The recreation of the synthetic VCF can be done as following:

for i in {1..22} {X,Y,M};do python synthesize_vcf.py $i;done

To join the generated VCFs into a single VCF:

for i in {1..22} {X,Y,M};do cat chr${i}.vcf >> simulated.vcf;done

Documentation

You can read the full documentation here: https://omilayers.readthedocs.io

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

omilayers-0.2.3.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

omilayers-0.2.3-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file omilayers-0.2.3.tar.gz.

File metadata

  • Download URL: omilayers-0.2.3.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for omilayers-0.2.3.tar.gz
Algorithm Hash digest
SHA256 45527d4be1d5725f2bf7c48ebda49db834583ffa8f99a54b2e46316b32d4212c
MD5 ff3f944d8f8719ff0665cd2394761dd5
BLAKE2b-256 44aba4114bbabec1af2bcd37d63f5b289e3a9cb9957ebe1df6869bc21866290f

See more details on using hashes here.

File details

Details for the file omilayers-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: omilayers-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for omilayers-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8595e26c43514eba6e43e03b72acf86bd88545b311d8304e43a2047aa8739625
MD5 ec949581bf99a1ae15d0410fcef9954a
BLAKE2b-256 7f207b40a216cedb92dd2455da02918b52e096f45b278df27406ec792feb010e

See more details on using hashes here.

Supported by

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