https://github.com/dfornika/ncov-db
Store SARS-CoV-2 genomic analysis results from ncov2019-artic-nf and ncov-tools to a sqlite DB
https://github.com/dfornika/ncov-db
data-management extract-transform-load sars-cov-2 sqlite
Last synced: 3 months ago
JSON representation
Store SARS-CoV-2 genomic analysis results from ncov2019-artic-nf and ncov-tools to a sqlite DB
- Host: GitHub
- URL: https://github.com/dfornika/ncov-db
- Owner: dfornika
- Created: 2021-08-20T23:56:31.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-29T23:11:40.000Z (over 3 years ago)
- Last Synced: 2025-01-24T23:48:45.836Z (4 months ago)
- Topics: data-management, extract-transform-load, sars-cov-2, sqlite
- Language: Python
- Homepage:
- Size: 60.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ncov-db
This tool will pull relevant output data from analysis output directories produced by [BCCDC-PHL/ncov2019-artic-nf](https://github.com/BCCDC-PHL/ncov2019-artic-nf) and [BCCDC-PHL/ncov-tools-nf](https://github.com/BCCDC-PHL/ncov-tools-nf), and load them into a [SQLite](https://www.sqlite.org/index.html) database.
It is designed with our specific analysis output directory structure in mind, so may not be generally applicable to other COVID analysis datasets.
## Installation
ncov-db is pip-installable. It is recommended to create a conda environment or python virtual environment for dependency management.
```
conda create -n ncov-db python=3
conda activate ncov-db
pip install git+https://github.com/dfornika/ncov-db.git
```## Usage
### Initialize a new database
Before loading any data, a new database must be initialized with the appropriate database schema. This is done using the `ncov-db init` command.
The `ncov-db init` command takes a single argument: the path to the sqlite database file to be created.```
usage: ncov-db init [-h] --db DBoptional arguments:
-h, --help show this help message and exit
--db DB
```Example:
```
ncov-db init --db ncov.db
```### Load data from an analyzed sequencing run into an existing database
Once a database has been initialized, new data can be loaded using the `ncov-db load-run` command. The `ncov-db load-run` command takes two arguments: the path to the analysis directory of the run
to be loaded, and the path to the database to load the data into.```
usage: ncov-db load-run [-h] --db DB run_dirpositional arguments:
run_diroptional arguments:
-h, --help show this help message and exit
--db DB
```Example:
```
ncov-db load-run --db ncov.db /path/to/analysis_by_run/210501_M01234_0123_000000000-ABC12
```