Rsidx
Library for indexing VCF files for random access searches by rsID
Install / Use
/learn @bioforensics/RsidxREADME
rsidx
Daniel Standage, 2019
https://github.com/bioforensics/rsidx
rsidx is a package for random access searches of VCF files by rsID.
This package enables rapid search of large VCF files by rsID in the same way that tabix enables rapid search by genomic coordinates.
In fact, the rsidx search uses tabix under the hood to search by genomic coordinates retrieved from the rsidx index.
This index is simply an sqlite3 database containing a mapping of rsID values to genomic coordinates.
Installation
Installation with bioconda is recommended.
conda install -c bioconda rsidx
If you prefer installation with pip try the following.
pip install git+https://github.com/bioforensics/rsidx
NOTE: If you install
rsidxwith pip, you will need to install the programtabixon your own and ensure it is in your$PATHwhen runningrsidx.
Demo: command line interface
Invoke rsidx index --help and rsidx search --help for complete usage instructions.
# VCF should be sorted by genomic coordinates and indexed by tabix
rsidx index dbSNP151_GRCh38.vcf.gz dbSNP151_GRCh38.rsidx
rsidx search dbSNP151_GRCh38.vcf.gz dbSNP151_GRCh38.rsidx rs3114908 rs10756819
Demo: Python API
import sqlite3
import rsidx
# Index the VCF file
with sqlite3.connect('myidx.db') as dbconn, open('myvar.vcf.gz', 'r') as vcffh:
rsidx.index.index(dbconn, vcffh)
# Search the index
rsidlist = ['rs1260965680', 'rs1309677886', 'rs1174660622', 'rs1291927541']
with sqlite3.connect('myidx.db') as dbconn, open('myvar.vcf.gz', 'r') as vcffh:
for line in rsidx.search.search(rsidlist, dbconn, vcffh)
# process lines of VCF data
Related Skills
node-connect
342.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
342.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.7kCommit, push, and open a PR
