A SQLite and DuckDB wrapper suitable for bioinformatic analysis of multi-omic data.
Project description
omilayers
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 .
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file omilayers-0.2.2.tar.gz.
File metadata
- Download URL: omilayers-0.2.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e46112503fe6d8e6a9bdcfce53a20a1e3481fdde1d40ed323fb413ea36844aca
|
|
| MD5 |
68e5dcce1f28a8f88a6d281b51440170
|
|
| BLAKE2b-256 |
deb6e1a057ee36eb3b3f2a42a9417d340cbead1e23d3f7bc47487bca6edf2113
|
File details
Details for the file omilayers-0.2.2-py3-none-any.whl.
File metadata
- Download URL: omilayers-0.2.2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
683c8d8dce19b90cab0269b1292cbd7858efa215c52be65a6ed7da3f19d6cd50
|
|
| MD5 |
c259054229b3cf9a55fd968f2f46c1ed
|
|
| BLAKE2b-256 |
c9a5e8c8ce81580d9f1b3211846ed0e18987f1f95b80e3ad66cec07c927e0a9f
|