VG on Biowulf
Variation graphs provide a succinct encoding of the sequences of many genomes. A variation graph (in particular as implemented in vg) is composed of:This model is similar to sequence graphs that have been used in assembly and multiple sequence alignment.
- nodes, which are labeled by sequences and ids
- edges, which connect two nodes via either of their respective ends
- paths, which describe genomes, sequence alignments, and annotations (such as gene models and transcripts) as walks through nodes connected by edges
References:
- Garrison, E., Sirén, J., Novak, A. et al. Variation graph toolkit improves read mapping by representing genetic variation in the reference. Nature Biotechnology 36, 875–879 (2018)
Documentation
Important Notes
- Module Name: vg (see the modules page for more information)
- Some subcommands are multithreaded. See usage (e.g., vg giraffe --help).
- Environment variables set
- VG_HOME
- Example files in $VG_HOME/test
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 vg [user@cn3144 ~]$ vg construct -r $VG_HOME/test/small/x.fa -v $VG_HOME/test/small/x.vcf.gz > x.vg [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. vg.sh). For example:
#!/bin/bash set -e module load vg vg autoindex --workflow giraffe -r $VG_HOME/test/small/x.fa -v $VG_HOME/test/small/x.vcf.gz -p x vg sim -n 1000 -l 150 -x x.giraffe.gbz -a > x.sim.gam vg giraffe -Z x.giraffe.gbz -G x.sim.gam -o BAM > aln.bam
Submit this job using the Slurm sbatch command.
sbatch [--cpus-per-task=#] [--mem=#] vg.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. vg.swarm). For example:
vg giraffe -t $SLURM_CPUS_PER_TASK -Z x.giraffe.gbz -G x.sim.gam -o BAM > x-aln.bam vg giraffe -t $SLURM_CPUS_PER_TASK -Z y.giraffe.gbz -G y.sim.gam -o BAM > y-aln.bam vg giraffe -t $SLURM_CPUS_PER_TASK -Z z.giraffe.gbz -G z.sim.gam -o BAM > z-aln.bam
Submit this job using the swarm command.
swarm -f vg.swarm [-g #] [-t #] --module vgwhere
-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 vg | Loads the VG module for each subjob in the swarm |