Biowulf High Performance Computing at the NIH
Bamgineer on Biowulf

The tool introduces simulated copy number variants into exome and other targeted sequencing data. From the authors:

Bamgineer is a tool that can be used to introduce user-defined haplotype-phased allele-specific copy number variations (CNV) into an existing Binary Alignment Mapping (BAM) file with demonstrated applicability to simulate somatic cancer CNVs in phased whole-genome sequencing datsets. This is done by introducing new read pairs sampled from existing reads, thereby retaining biases of the original data such as local coverage, strand bias, and insert size. As input, Bamgineer requires a BAM file and a list of non-overlapping genomic coordinates to introduce allele-specific gains and losses. We implemented parallelization of the Bamgineer algorithm for both standalone and high performance computing cluster environments, significantly improving the scalability of the algorithm. Bamgineer has been extensively tested on phased, whole-genome sequencing samples.

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 bamgineer

[user@cn3144 ~]$ tar -jxf $BAMGINEER_TEST_DATA/splitbams.tarbz2

[user@cn3144 ~]$ simulate.py -config $BAMGINEER_TEST_DATA/config.cfg \
              -splitbamdir splitbams \
              -cnv_bed $BAMGINEER_TEST_DATA/cnv.bed \
              -vcf $BAMGINEER_TEST_DATA/normal_het.vcf \
              -exons $BAMGINEER_TEST_DATA/exons.bed \
              -outbam tumour.bam \
              -results outputs \
              -cancertype LUAC1

('OPTIONS:', Namespace(cancerType='LUAC1', chrList=None, cnvBed='cnv.bed', configfile='config.cfg', ctDNA=False, exons='exons.bed', inbamFile=None, outBamFile='tumour.bam', outputDir='outputs', phase=False, singleXY=False, splitbams='splitbams', vcf='normal_het.vcf'))
outputs
 ___ generating phased bed ___
 ___ filtering bed file columns for gainAAB30227447_tmp2.bed ___
 ___ extracting roi bams  ___
 ___ splitting original bam into hap1 and hap2 ___
 ___ re-pairing hap1 bam reads ___
...

[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. bamgineer.sh). For example:

#!/bin/bash
set -e
module load bamgineer
tar -jxf $BAMGINEER_TEST_DATA/splitbams.tarbz2
simulate.py -config $BAMGINEER_TEST_DATA/config.cfg \
            -splitbamdir splitbams \
            -cnv_bed $BAMGINEER_TEST_DATA/cnv.bed \
            -vcf $BAMGINEER_TEST_DATA/normal_het.vcf \
            -exons $BAMGINEER_TEST_DATA/exons.bed \
            -outbam tumour.bam \
            -results outputs \
            -cancertype LUAC1

Submit this job using the Slurm sbatch command.

sbatch [--cpus-per-task=#] [--mem=#] bamgineer.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. bamgineer.swarm). For example:

simulate.py -config config.cfg -inbam chr1.bam -cnv_bed cnv1.bed -vcf het1.vcf \
            -exons exons1.bed -outbam tumour1.bam -results outputs -cancertype LUAC1
simulate.py -config config.cfg inbam chr2.bam -cnv_bed cnv2.bed -vcf het2.vcf \
            -exons exons2.bed -outbam tumour2.bam -results outputs -cancertype LUAC1
simulate.py -config config.cfg -inbam chr3.bam -cnv_bed cnv3.bed -vcf het3.vcf \
            -exons exons3.bed -outbam tumour3.bam -results outputs -cancertype LUAC1

Submit this job using the swarm command.

swarm -f bamgineer.swarm [-g #] [-t #] --module bamgineer
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 bamgineer Loads the Bamgineer module for each subjob in the swarm