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.1.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.1-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: omilayers-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 db227a644b017ee04725f1aeef19f8a4320c90a660d5dc712264ef2f181c9867
MD5 30533cd526f97678ed4e0da066538379
BLAKE2b-256 e511a3f0739d484097c74ec7b37765cb95d83fed79998f3bd260b3b751f43c34

See more details on using hashes here.

File details

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

File metadata

  • Download URL: omilayers-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e2f44f131c84527607dd5d54c8a4abd434d386d08bbf93a0e55500e3d8ac85b8
MD5 4ca7bb03c0f3b0ed41005ef71015889c
BLAKE2b-256 948165f7ba5b440f014a4073d3c971b31ec56f007f62edd475504f7f5d4e8535

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