Biowulf High Performance Computing at the NIH
binlorry on Biowulf

BinLorry is a tool for binning and filtering sequencing reads into distinct files. Reads can be binned and filtered by any attributes encoded in their headers, documented in a CSV file or by length.

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@biowulf]$ sinteractive --gres=lscratch:20 --mem=10g
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]$ cd /lscratch/$SLURM_JOB_ID
[user@cn3144]$ module load binlorry
[user@cn3144]$ cp $BINLORRY_TEST_DATA/test.fastq .
[user@cn3144]$ # split by the header field 'barcode' (using made up barcodes for this example)
[user@cn3144]$ binlorry -i test.fastq -o barcode --bin-by barcode
Bins and filters:
Filter reads unless length not more than 4294967296
Bin reads by barcode
Header delimiters  =

Read files found:
test.fastq

Processing read file:
test.fastq

Summary:
Total reads read: 8000
Total reads written: 8000

Read files written:
barcode_pikachu.fastq
barcode_mewtwo.fastq
barcode_eevee.fastq
barcode_snorlax.fastq

[user@cn3144]$ # filter by barcode and only output reads between 500 and 1000 nucleotides
[user@cn3144]$ binlorry -i test.fastq -o pikachu --filter-by barcode pikachu -n 500 -x 1000
Bins and filters:
Filter reads unless barcode is pikachu
Filter reads unless length between 500 and 1000
Header delimiters  =

Read files found:
test.fastq

Processing read file:
test.fastq

Summary:
Total reads read: 8000
Total reads written: 102

Read files written:
pikachu.fastq

[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. binlorry.sh), which uses the input file 'binlorry.in'. For example:

#!/bin/bash
module load binlorry/1.1.0 || exit 1
binlorry -i $BINLORRY_TEST_DATA/test.fastq -o barcode --bin-by barcode

Submit this job using the Slurm sbatch command.

sbatch --cpus-per-task=2 --mem=4g binlorry.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. binlorry.swarm). For example:

binlorry -i sample1.fastq -o sample1 --bin-by barcode
binlorry -i sample2.fastq -o sample2 --bin-by barcode
binlorry -i sample3.fastq -o sample3 --bin-by barcode

Submit this job using the swarm command.

swarm -f binlorry.swarm -g 4 --module binlorry/1.1.0
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 binlorry Loads the binlorry module for each subjob in the swarm