SpliceAI Variant Lookup and Prediction with RocksDB

public public 1yr ago Version: v1.0.0 0 bookmarks

Fast look up interface and prediction for missing variants in look table for spliceAI with rocksdb.

Installation

Clone this git repository:

 

Code Snippets

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import tarfile
import rocksdb


db = rocksdb.DB(snakemake.input['db'], 
                rocksdb.Options(max_open_files=5000), 
                read_only=True)
backup = rocksdb.BackupEngine(snakemake.output['backup'])
backup.create_backup(db, flush_before_backup=True)

tar = tarfile.open(snakemake.output['backup_gzip'], "w:gz")
tar.add(snakemake.output['backup'], arcname="backup")
tar.close()
1
2
3
4
5
6
7
8
9
from spliceai_rocksdb.create import create_spliceai_rocksdb


vcfs = [
    snakemake.input['snv'],
    snakemake.input['indel']
]
create_spliceai_rocksdb(snakemake.output['db'], vcfs,
                        batch_size=snakemake.params['batch_size'])
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
from spliceai_rocksdb.spliceAI import SpliceAI


if snakemake.params['lookup_only']:
    model = SpliceAI(db_path=snakemake.params['db_path'])
else:
    model = SpliceAI(snakemake.input['fasta'],
                     annotation=snakemake.params['genome'],
                     db_path=snakemake.params['db_path'])


model.predict_save(snakemake.input['vcf'],
                   snakemake.output['csv'])
30
31
shell:
    "wget -O - {params} | gunzip -c > {output}"
38
39
shell:
    "bcftools view -O z -o {output.indel_by_chr} {input.indel} --regions {wildcards.chromosome}"
46
47
shell:
    "bcftools view -O z -o {output.snv_by_chr} {input.snv} --regions {wildcards.chromosome}"
58
59
script:
    "./scripts/create_rocksdb.py"
68
69
script:
    "./scripts/backup_rocksdb.py"
98
99
script:
    "./scripts/predict.py"
ShowHide 6 more snippets with no or duplicated tags.

Login to post a comment if you would like to share your experience with this workflow.

Do you know this workflow well? If so, you can request seller status , and start supporting this workflow.

Free

Created: 1yr ago
Updated: 1yr ago
Maitainers: public
URL: https://github.com/gagneurlab/spliceai_rocksdb
Name: spliceai_rocksdb
Version: v1.0.0
Badge:
workflow icon

Insert copied code into your website to add a link to this workflow.

Downloaded: 0
Copyright: Public Domain
License: None
  • Future updates

Related Workflows

cellranger-snakemake-gke
snakemake workflow to run cellranger on a given bucket using gke.
A Snakemake workflow for running cellranger on a given bucket using Google Kubernetes Engine. The usage of this workflow ...