High-Performance Computing at the NIH
GitHub YouTube @nih_hpc RSS Feed
BFC and BFC-KMC on Biowulf

BFC is a standalone tool for correcting sequencing errors from Illumina sequencing data. It is specifically designed for high-coverage whole-genome human data, though also performs well for small genomes.

BFC-KMC is an alternative implementation of the algorithm. It uses KMC for k-mer counting and keeps high-occurrence k-mers in a bloom filter.

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@biowulf]$ sinteractive --cpus-per-task 16
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 bfc
[user@cn3144 ~]$ bfc -s 3g -t $SLURM_CPUS_PER_TASK reads.fq.gz | gzip -1 > corrected.fq.gz
[user@cn3144 ~]$ exit
salloc.exe: Relinquishing job allocation 46116226
[user@biowulf ~]$

Sample session for BFC-KMC:

[user@biowulf]$ sinteractive --cpus-per-task 16 --gres lscratch:10
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 kmc bfc
[user@cn3144 ~]$ kmc -t $SLURM_CPUS_PER_TASK -k55 reads.fq.gz prefix /lscratch/$SLURM_JOB_ID
[user@cn3144 ~]$ bfc-kmc -t $SLURM_CPUS_PER_TASK prefix reads.fq.gz | gzip -1 > corrected.fq.gz
[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. bfc.sh). For example:

#!/bin/sh
set -e
test -n "$SLURM_CPUS_PER_TASK" || SLURM_CPUS_PER_TASK=1
module load bfc
bfc -s 3g -t$SLURM_CPUS_PER_TASK reads.fq.gz | gzip -1 > corrected.fq.gz

Submit this job using the Slurm sbatch command.

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

bfc -s 3g -t$SLURM_CPUS_PER_TASK reads1.fq.gz | gzip -1 > corrected1.fq.gz
bfc -s 3g -t$SLURM_CPUS_PER_TASK reads2.fq.gz | gzip -1 > corrected2.fq.gz
bfc -s 3g -t$SLURM_CPUS_PER_TASK reads3.fq.gz | gzip -1 > corrected3.fq.gz
bfc -s 3g -t$SLURM_CPUS_PER_TASK reads4.fq.gz | gzip -1 > corrected4.fq.gz

Submit this job using the swarm command.

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