High-Performance Computing at the NIH
GitHub YouTube @nih_hpc RSS Feed
Bcl2fastq on Biowulf & Helix

Description

The primary output of Illumina sequencing instruments are per-cycle base call files in BCL format. Bcl2fastq converts BCL files to fastq files used by most downstream software. It also separates reads into individual fastq files based on their barcode (demultiplexing), does adapter masking/trimming and moves unique molecular identifier (UMI) bases from the read to the fastq header. Bcl2fastq operates on Illumina run folders.

bcl2fastq creates a number of files summarizing statistics of the conversion in the InterOp folder of the run folder. They can be examined with the Illumina Sequence Analysis Viewer.

There may be multiple versions of bcl2fastq available. An easy way of selecting the version is to use modules. To see the modules available, type

module avail bcl2fastq 

To select a module use

module load bcl2fastq/[version]

where [version] is the version of choice.

bcl2fastq is a multithreaded application. By default it will run as many threads as there are CPUs for the conversion/demultiplexing plus additional threads for reading/writing data. You must therefore limit the threads to the number of threads allocated to your job or allocate nodes exclusively.

The relevant options for limiting the number of threads are

-r [ --loading-threads ] arg (=4)     number of threads used for loading BCL data
-d [ --demultiplexing-threads ] arg   number of threads used for demultiplexing
-p [ --processing-threads ] arg       number of threads used for processing demultiplexed data
-w [ --writing-threads ] arg (=4)     number of threads used for writing FASTQ data

For a job allocated 16 CPUs these options should be set to

bcl2fastq -r 2 -w 2 -d 4 -p 14 ...

This leads to a nominal overload but according to testing by Illumina this should yield optimal throughput.

Environment variables set

Documentation

On Helix

This software should not be run on helix. Please submit as a batch job or allocate an interactive session with sinteractive

Batch job on Biowulf

Create a batch script similar to the following example:

#! /bin/bash
#SBATCH --cpus-per-task=16
# this file is bcl2fastq.sh

module load bcl2fastq/2.17 || exit 1
bcl2fastq --runfolder-dir /path/to/your/run/folder/160601_mach1_0023 \
          --output-dir ./160601_mach1_0023 \
          -r 2 -w 2 -d 4 -p 14 \
          --barcode-mismatches 0

See the Illumina manual or bcl2fastq --help for a description of all other available options.

Submit to the queue with sbatch:

biowulf$ sbatch bcl2fastq.sh
Swarm of jobs on Biowulf

Create a swarm command file similar to the following example:

# this file is bcl2fastq.swarm
bcl2fastq --runfolder-dir /path/to/your/run/folder/160601_mach1_0023 \
          --output-dir ./160601_mach1_0023 \
          -r 2 -w 2 -d 4 -p 14
bcl2fastq --runfolder-dir /path/to/your/run/folder/160602_mach1_0024 \
          --output-dir ./160602_mach1_0024 \
          -r 2 -w 2 -d 4 -p 14
bcl2fastq --runfolder-dir /path/to/your/run/folder/160603_mach1_0025 \
          --output-dir ./160603_mach1_0025 \
          -r 2 -w 2 -d 4 -p 14

And submit to the queue with swarm

biowulf$ swarm -f bcl2fastq.swarm -t 16 --module bcl2fastq
Interactive job on Biowulf

Allocate an interactive session with sinteractive and use as described above

biowulf$ sinteractive --cpus-per-task 16
node$ module load bcl2fastq
node$ bcl2fastq --help
BCL to FASTQ file converter
bcl2fastq v2.17.1.14
Copyright (c) 2007-2015 Illumina, Inc.

2016-06-30 07:41:22 [2b3ea2868180] Command-line invocation: bcl2fastq --help 
2016-06-30 07:41:22 [2b3ea2868180] INFO: Minimum log level: INFO
[...snip...]
node$ bcl2fastq -r 2 -w 2 -d 4 -p 14 \
    --runfolder-dir /path/to/your/run/folder/160601_mach1_0023 ...
node$ exit
biowulf$