https://github.com/mlin/genomicsqlite-examples
https://github.com/mlin/genomicsqlite-examples
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mlin/genomicsqlite-examples
- Owner: mlin
- License: mit
- Created: 2021-03-28T02:45:05.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-03-30T00:52:32.000Z (about 5 years ago)
- Last Synced: 2025-01-07T20:46:11.684Z (over 1 year ago)
- Language: C
- Size: 8.79 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GenomicSQLite-examples
This repo exhibits a simple example program using [Genomics Extension for SQLite](https://github.com/mlin/GenomicSQLite), implemented in several supported programming languages. It's a minimal starting point to fork into your own program. See the [Programming Guide](https://mlin.github.io/GenomicSQLite) for full documentation.
Each implementation provides two subcommands:
1. `gsqlex load exons.gff exons.db` imports a small [GFF file](https://en.wikipedia.org/wiki/General_feature_format) into a new database, indexed by genomic range
2. `gsqlex query exons.db chr17:43,104,800-43,105,000` prints the records overlapping the given genomic range
General requirements: x86-64, Linux or macOS, installed development package for SQLite 3.31.0+.
### Python (3.6+)
```
pip3 install genomicsqlite
git clone https://github.com/mlin/GenomicSQLite-examples.git
cd GenomicSQLite-examples/python
python3 gsqlex.py load ../exons.gff exons.db
python3 gsqlex.py query exons.db chr17:43,104,800-43,105,000
```
### C
```
git clone https://github.com/mlin/GenomicSQLite-examples.git
cd GenomicSQLite-examples/c
wget https://github.com/mlin/GenomicSQLite/releases/download/v0.8.0/GenomicSQLite-v0.8.0.zip
unzip GenomicSQLite-v0.8.0.zip
cc -o gsqlex -L$(pwd) gsqlex.c -lsqlite3 -lgenomicsqlite -Wl,-rpath,\$ORIGIN
./gsqlex load ../exons.gff exons.db
./gsqlex query exons.db chr17:43,104,800-43,105,000
```