slivar on Biowulf

slivar is a set of command-line tools that enables rapid querying and filtering of VCF files. It facilitates operations on trios and groups and allows arbitrary expressions using simple javascript.

use cases for slivar:

References:

Documentation
Important Notes

Interactive job
Interactive jobs should be used for debugging, graphics, or applications that cannot be run as batch jobs.

Allocate an interactive session and run the program.
Sample session (user input in bold):

[user@biowulf]$ sinteractive
salloc.exe: Pending job allocation 46116226
salloc.exe: job 46116226 queued and waiting for resources
salloc.exe: job 46116226 has been allocated resources
salloc.exe: Granted job allocation 46116226
salloc.exe: Waiting for resource configuration
salloc.exe: Nodes cn3144 are ready for job

[user@cn3144 ~]$ module load slivar

[user@cn3144 ~]$ slivar expr \
    --js $SLIVAR_HOME/js/slivar-functions.js \
    -g /fdb/slivar/gnomad.hg38.genomes.v3.fix.zip \
    --vcf $SLIVAR_HOME/tests/ashk-trio.vcf.gz \
    --ped $SLIVAR_HOME/tests/ashk-trio.ped \
    --info "INFO.gnomad_popmax_af < 0.01 && variant.FILTER == 'PASS'" \
    --trio "example_denovo:denovo(kid, dad, mom)" \
    --family-expr "denovo:fam.every(segregating_denovo)" \
    --trio "custom:kid.het && mom.het && dad.het && kid.GQ > 20 && mom.GQ > 20 && dad.GQ > 20"  \
    --pass-only \
    -o ashk-trio.slivar.vcf

[user@cn3144 ~]$ exit
salloc.exe: Relinquishing job allocation 46116226
[user@biowulf ~]$

Batch job
Most jobs should be run as batch jobs.

Create a batch input file (e.g. slivar.sh). For example:

#!/bin/bash
set -e
module load slivar
slivar expr \
  --js $SLIVAR_HOME/js/slivar-functions.js \
  -g /fdb/slivar/gnomad.hg38.genomes.v3.fix.zip \
  --vcf $SLIVAR_HOME/tests/ashk-trio.vcf.gz \
  --ped $SLIVAR_HOME/tests/ashk-trio.ped \
  --info "INFO.gnomad_popmax_af < 0.01 && variant.FILTER == 'PASS'" \
  --trio "example_denovo:denovo(kid, dad, mom)" \
  --family-expr "denovo:fam.every(segregating_denovo)" \
  --trio "custom:kid.het && mom.het && dad.het && kid.GQ > 20 && mom.GQ > 20 && dad.GQ > 20"  \
  --pass-only \
  -o ashk-trio.slivar.vcf

Submit this job using the Slurm sbatch command.

sbatch [--cpus-per-task=#] [--mem=#] slivar.sh
Swarm of Jobs
A swarm of jobs is an easy way to submit a set of independent commands requiring identical resources.

Create a swarmfile (e.g. slivar.swarm). For example:

slivar expr --js $SLIVAR_HOME/js/slivar-functions.js -g /fdb/slivar/gnomad.hg38.genomes.v3.fix.zip --vcf sample1.vcf --ped sample1.ped -o sample1.slivar.vcf ...
slivar expr --js $SLIVAR_HOME/js/slivar-functions.js -g /fdb/slivar/gnomad.hg38.genomes.v3.fix.zip --vcf sample2.vcf --ped sample2.ped -o sample2.slivar.vcf ...
slivar expr --js $SLIVAR_HOME/js/slivar-functions.js -g /fdb/slivar/gnomad.hg38.genomes.v3.fix.zip --vcf sample3.vcf --ped sample3.ped -o sample3.slivar.vcf ...
slivar expr --js $SLIVAR_HOME/js/slivar-functions.js -g /fdb/slivar/gnomad.hg38.genomes.v3.fix.zip --vcf sample4.vcf --ped sample4.ped -o sample4.slivar.vcf ...

Submit this job using the swarm command.

swarm -f slivar.swarm [-g #] [-t #] --module slivar
where
-g # Number of Gigabytes of memory required for each process (1 line in the swarm command file)
-t # Number of threads/CPUs required for each process (1 line in the swarm command file).
--module slivar Loads the slivar module for each subjob in the swarm