Repository files navigation

idemuxCPP - inline barcode demultiplexing

GitHub releaseBuild StatusCondaConda Downloads

idemuxCPP is a command line tool designed to demultiplex paired-end fastq files from QuantSeq-Pool.

idemuxCPP can demultiplex based on i7, i5 and i1 inline barcodes. While this tool can generally be used to demultiplex on any barcodes (as long as they are correctly supplied and in the fastq header), it best performs when used in combination with Lexogen indices, as it will correct common sequencing errors in the sequenced barcodes. This will allow you to retain more reads from your sequencing experiment, while minimizing cross contamination.

idemuxCPP use is permitted under the following licence.

idemuxCPP is a direct translation of the python tool idemux (https://github.com/lexogen-tools/idemux) in order to decrease the runtime. It is 2 times faster than the python version.

General usage:

 idemuxCPP [-h] --r1 READ1 --r2 READ2 [--sample-sheet SAMPLE_SHEET] --out OUTPUT_DIR
[--i1-start I1_START] [--i5-rc] [-v]

Run idemuxCPP:

 idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out /some/output/path --i1-start pos_in_read_2

Features

  • FASTQ file demultiplexing based on i7, i5 or i1 barcodes
  • Correction of barcode sequencing errors to maximize read yield (only works with Lexogen 12 nt UDIs, that have been sequenced at least 8 nt.

Getting started

To get stated with demultiplexing you need to:

  1. Install idemuxCPP
  2. Prepare a sample sheet csv
  3. Run idemuxCPP

1. Installation

dependencies:

  • compiler supporting C++11 standard and OpenMP

  • boost C++ library version >= 1.55.0 (install the development versions of the following libraries (or install all e.g. in Ubuntu via package libboost-all-dev)

    • libboost-filesystem
    • libboost-system
    • libboost-iostreams
    • libboost-test (only required if you want to compile unit tests)
  • zlib (e.g. zlib1g-dev in Ubuntu)

  • gengetopt

Windows 10 64bit binary For windows you do not need to install any dependencies (they are included in the package). Simply download the pre-compiled windows binary from here windows binary. Extract the zip file. To execute the tool press windows+r, enter cmd, cd C:\\location_of_the_extracted_zip_file\bin and execute .\\idemuxCPP

From Source (distribution tar)

To configure, compile and install execute the following commands on your command line:

 ./configure [--help for additional configuration options]
make
make install

From Source (git) The installation from source requires additional tools and libraries:

  • gnulib (autoconf, automake, etc.)

Generate the configure file with:

 autoreconf -i

Then proceed with ./configure and make like in the previous section.

From Linux Package

Debian Ubuntu Fedora
Debian_12

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_11

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_10

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_9.0

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_24.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_23.10

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_23.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_22.10

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_22.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_20.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_18.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_16.04

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Fedora 40

idemuxcpp - 0.3.0 - 64 bit

Fedora 39

idemuxcpp - 0.3.0 - 64 bit

Fedora 38

idemuxcpp - 0.3.0 - 64 bit

Fedora 37

idemuxcpp - 0.3.0 - 64 bit

Fedora 36

idemuxcpp - 0.3.0 - 64 bit

on ubuntu you can install it for example with:

dpkg -i <idemuxcpp*.deb>

idemuxCPP is available via bioconda!

2. Preparing the sample sheet

In order to run idemuxCPP on your QuantSeq-Pool data you first need to prepare a csv file. We call this csv a sample sheet and it specifies which barcodes correspond to each sample.

This is a necessity as the software needs to know into which bins reads should be sorted during demultiplexing. A sample sheet can easily be generated by filling in an excel spreadsheet and exporting it as csv.

Example sample sheet (i7, i5 and i1 demuliplexing):

 sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
sample_2,GAAAATTTACGC,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,CCCATCCATGTA,AAACTAACTGTC

A sample sheet consists of 4 columns and always starts with the header illustrated above. 'Sample_name' values will be used as output file names, while the sequences specified in i7,i5 & i1 will be used for demultiplexing.

Therefore, only specific, unique unambiguous combinations of sample names and barcodes are allowed. This means using duplicated or ambiguous combinations will result in an error. However, idemuxCPP will do its best to tell you where the problem lies, once this happens.

In brief the rules are:

  1. Sample names need to be unique.
  2. Barcode combinations need to be unique.
  3. i7 and/or i5 indices have to be used consistently within the csv file. i7 and/or i5 indices need to be either present for all samples or none at all.
  4. In contrast to i7/i5 indices, i1 indices can be used for a subset of samples in the csv file.
  5. Absence of a barcode needs to be indicated by an empty field (no value between comas ,,).
  6. If your i5 has been sequenced as reverse complement, enter the reverse complement sequences in the sample sheet and use the --i5-rc option! If you are not sure, you can also use the --auto-detect option as alternative.

See below. for more showcases of sample/barcode combinations that are allowed or disallowed.

3. Extract non-demultiplexed read data from a sequencing run

The read input files for idemux are non-demultiplexed read files which you can get by using demultiplexing software to extract reads from a sequencing run without demultiplexing by sample.
You can use any demultiplexing software available to you, but the resulting read file(s) should contain all reads of the sequencing run you want to demultiplex with idemux. Further, the reads should contain the read-out of the i7 + i5 barcode sequences in the read ID.

The following part of this section outlines how to use Illumina's bcl2fastq software to obtain the reads.

Demultiplexing with bcl2fastq:

bcl2fastq -R /path/to/sequencing/run -o /path/to/output -l WARNING --no-lane-splitting --sample-sheet Illumina_EMPTY_SampleSheet.csv --barcode-mismatches 0 --mask-short-adapter-reads 10

This commands bcl2fastq to "demultiplex" the run at /path/to/sequencing/run to the output directory /path/to/output. The content of the file Illumina_EMPTY_SampleSheet.csv has to match Illumina's format for the respective sequencer.

The following text is an example for the content of a SampleSheet for a Illumina Nextseq run:

[Header],,,,,,,
IEMFileVersion,4,,,,,,
Date,30.05.2017,,,,,,
Workflow,GenerateFASTQ,,,,,,
Application,NextSeq FASTQ Only,,,,,,
Assay,TruSeq RNA,,,,,,
Description,,,,,,,
Chemistry,Default,,,,,,
,,,,,,,
[Reads],,,,,,,
,,,,,,,
[Settings],,,,,,,
,,,,,,,
[Data],,,,,,,
Sample_ID,Sample_Name,Sample_Plate,Sample_Well,I7_Index_ID,index,I5_Index_ID,index2,Sample_Project,Description
1,1,,,9999,AAAAAAAAAAAA,9999,AAAAAAAAAAAA,,

As you can see, no settings are specified and only one 'sample' was defined with a squence combination that is not likely to be close to any of the utilized barcode sequences. You have to adjust the length of the A* stretches to the sequenced length of the i7/i5 barcodes! This specification is necessary to command bcl2fastq to write the i7+i5 sequence information in each read in the Undetermined_S0_R1_001.fastq.gz (Undetermined_S0_R2_001.fastq.gz) file(s) The resulting reads in Undetermined_S0_R1_001.fastq.gz (Undetermined_S0_R2_001.fastq.gz) should follow this formatting style:

@NB502007:379:HM7H2BGXF:1:11101:19231:1159 1:N:0:TTAGGACGCAAA+GGGTCTGCCGAA
GCTCATCCATCTTTTTGAAAACTCTTCATACTCGTTAGATCGGAAGAG
+
AAAAAEEEAEEEEEEAEEEEEEEEEEEEEEEEEEEE/E/EEEEE/EEE
@NB502007:379:HM7H2BGXF:1:11101:17406:1159 1:N:0:AAGTAACAGCTT+AATCGTGGACGG
CACACCTCCGTTCACGACGCTCTTCCGATATAGATGTAACTGGAGGAA
+
AAAAAEEEEEAEE/EEEEEEEEEE/EEEEAEA/EEEEEEEEEEEEEEE
@NB502007:379:HM7H2BGXF:1:11101:18203:1159 1:N:0:CTGCCAACACGA+GCTGTGGTTCAT
GACATGTATACAGTCTACGGATGAACGTTTAGATCGGAAGAGCACACG
+
AAAAAEEEEEEEEEEEEEEEEEEEEEEEEEAEEEEEEEEEEEEEEEEE
@NB502007:379:HM7H2BGXF:1:11101:7322:1159 1:N:0:TACATGGCCACT+ATGTTCCAGTGA
CTTGGTCACGCTACTGTACTCCAGCCAGGGCGACAGAGCAAGACCTAT
+
AAAAAEEEEEEEEEEEE/EEEEEEEEAEEEEEAEEEEEEEEEEEAEEE
...

4. Running idemuxCPP

Once you have installed the tool you can run it by typing idemuxCPP in the terminal.

idemuxCPP accepts the following arguments:

 -h, --help Print help and exit
-V, --version Print version and exit
Required arguments:
-1, --r1=STRING Fastq.gz read file 1 (or .fastq file).
(default='')
-2, --r2=STRING Fastq.gz read file 2 (required only in paired
end mode).
(default='')
-o, --out=STRING Where to write the output files.
(default='./')
-s, --sample-sheet=STRING Input a csv file describing sample names and
barcode combinations (i7, i5 and i1
barcodes).
(default='sample-sheet.csv')
Optional arguments:
-b, --barcode-corrections=STRING
Outputs a csv file that contains the number of
corrected barcodes
-5, --i5-rc Should be set when the i5 barcode has been
sequenced as reverse complement. Make sure to
enter reverse complement sequences in the
barcode file. (default=off)
-i, --i1-start=INT Start position of the i1 index (1-based) on
read 2.
(default='11')
--i1-read=INT Read in which the i1 index should be corrected
(1 or 2).
(default='2')
-q, --queue-size=INT Queue size for reads that will be processed in
one block.
(default='4000000')
-r, --reading-threads=INT Number of threads used for reading gz files.
Either 1 or 2 (one thread per input file is
used).
(default='2')
-w, --writing-threads=INT Number of threads used for writing gz files.
Default is the number of processor cores.
-p, --processing-threads=INT Number of threads used for processing the error
correction. Default is the number of
processor cores.
-d, --demux-only Do a one on one mapping for the barcodes
specified in the sample sheet. No error
correction will be done. Barcodes that do not
match are written to the undetermined reads
file. (default=off)
-v, --verbose Verbose.
(default=off)

Example commands:

 # demultiplexes read 1 and 2 into the folder 'demux'
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux
# demultiplexing assuming the i1 barcode starts at the first base
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux --i1_start 1
# demultiplexing assuming i5 is present as reverse complement in the fastq header
# if he i5 has been sequenced as reverse complement use this option and provide
# the reverse complement sequences in the sample sheet.
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux

After a successful completed run idemuxCPP will write summary report to the output folder ('demultipexing_stats.tsv').

Technicalities

When you run idemuxCPP the following will happen:

  • It will check if your sample sheet is okay. See here for examples

  • It will check the fastq header for barcodes and expects them in the following format:

    single index (i7 or i5): @NB502007:379:HM7H2BGXF:1:11101:24585:1069 1:N:0:TCAGGTAANNTT
    dual index (i7 and i5): @NB502007:379:HM7H2BGXF:1:11101:24585:1069 1:N:0:TCAGGTAANNTT+NANGGNNCNNNN
    
  • Reads that cannot be demultiplexed will be written to undetermined_R{1/2}.fastq.gz

  • When you demultiplex based on i1 inline barcodes, the a successful recognized barcode sequence will be cut out and removed from read 2. This is a design choice and will leave you with the 10 nt UMI + the nucleotides that potentially follow the i1 barcode (or don't).

This allows you to:

  1. Use other software, such as UMI_tools to deal with the 10nt UMI if desired
  2. To demuliplex lanes where QuantSeq-Pool has been pooled with other libraries and read 2 has been sequenced longer than the actual barcode.

If you sequenced i5 as a reverse complement, make sure to fill in reverse complement barcodes into the sample sheet and to use the --i5-rc parameter.

Help

If you are demuliplexing a large number of samples (more than 500) you might encounter the following error:

  • OSError: [Errno 24] Too many open files

This error occurs because most OS have a limit on how many files can be opened and written to at the ame time. In order to temporarily increase the limit run:

 # multiply your sample number*2 (as data is paired end)
# then round to the next multiple of 1024
ulimit -n the_number_above

If you are looking for a permanent solution you can change your ulimit values this way.

In case you experience any issues with this software please open an issue describing your problem. Make sure to post the version of the tool you are running (-v, --version) and your os.

Sample sheet examples

This is allowed:

 # demultiplexing via full i7, i5, i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
# demultiplexing via full i7, i5 and sparse i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,
# demultiplexing via full i7, i5
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,
# demultiplexing via full i7, no i5 and sparse i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,,AAAACATGCGTT
sample_1,AAAATCCCAGTT,,
# demultiplexing via full i7 only
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,,
sample_1,AAAATCCCAGTT,,
# demultiplexing via full i5 and i1
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,,CCCCTAAACGTT,AAAATCCCAGTT
# demultiplexing via full i5 and sparse i1
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,,CCCCTAAACGTT,
# demultiplexing via full i5
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,
sample_1,,CCCCTAAACGTT,
# demultiplexing via full i1
sample_name,i7,i5,i1
sample_0,,,AAAACATGCGTT
sample_1,,,AAAATCCCAGTT
# mixed indexing (if not ambiguous) (full i7 and sparse i5, i1)
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,,AAAATCCCAGTT
sample_2,GAAAATTTACGC,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,,AAACTAACTGTC
# mixed indexing (if not ambiguous) (no i7, sparse i5 & i1)
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,
sample_1,,,AAAATCCCAGTT
# mixed indexing (if not ambiguous) (sparse i7, full i5 & i1)
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
sample_2,,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,CCCATCCATGTA,AAACTAACTGTC
# additional parameter columns for i1_read and i1_start index (1-based).
sample_name,i7,i5,i1,i1_read,i1_start
sample_0,AANACATGCGTT,,TTTTAG,2,1
sample_1,AANACATGCG,,AAAACATG,2,11
sample_2,AANACA,,CACCCC,1,5

This is not allowed:

 # missing i1 column (or any other)
sample_name,i7,i5,
sample_0,AAAACATGCGTT,CCCCACTGAGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT
# duplicated barcode combination
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
# duplicated sample names
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_0,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
# missing comma separator
sample_name,i7,i5,i1
sample_0,AAAACATGCGTTCCCCACTGAGTT,AAAACATGCGTT
# no barcodes
sample_name,i7,i5,i1
sample_0,,,
# wrong column headers
wrong_col_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT

© Lexogen GmbH, 2020

About

iDemux is an all-in-one command line tool that can be used for both demultiplexing and error correction of FASTQ files. It enables demultiplexing of i1 inline barcodes of Lexogen’s QuantSeq-Pool as well as demultiplexing of i7 and/or i5 indices of any other RNA-Seq library prep. iDemux can also be used for superior error correction of RNA-Seq libr…

Resources

Contributing

Stars

8 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

idemuxCPP - inline barcode demultiplexing

GitHub releaseBuild StatusCondaConda Downloads

idemuxCPP is a command line tool designed to demultiplex paired-end fastq files from QuantSeq-Pool.

idemuxCPP can demultiplex based on i7, i5 and i1 inline barcodes. While this tool can generally be used to demultiplex on any barcodes (as long as they are correctly supplied and in the fastq header), it best performs when used in combination with Lexogen indices, as it will correct common sequencing errors in the sequenced barcodes. This will allow you to retain more reads from your sequencing experiment, while minimizing cross contamination.

idemuxCPP use is permitted under the following licence.

idemuxCPP is a direct translation of the python tool idemux (https://github.com/lexogen-tools/idemux) in order to decrease the runtime. It is 2 times faster than the python version.

General usage:

 idemuxCPP [-h] --r1 READ1 --r2 READ2 [--sample-sheet SAMPLE_SHEET] --out OUTPUT_DIR
[--i1-start I1_START] [--i5-rc] [-v]

Run idemuxCPP:

 idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out /some/output/path --i1-start pos_in_read_2

Features

  • FASTQ file demultiplexing based on i7, i5 or i1 barcodes
  • Correction of barcode sequencing errors to maximize read yield (only works with Lexogen 12 nt UDIs, that have been sequenced at least 8 nt.

Getting started

To get stated with demultiplexing you need to:

  1. Install idemuxCPP
  2. Prepare a sample sheet csv
  3. Run idemuxCPP

1. Installation

dependencies:

  • compiler supporting C++11 standard and OpenMP

  • boost C++ library version >= 1.55.0 (install the development versions of the following libraries (or install all e.g. in Ubuntu via package libboost-all-dev)

    • libboost-filesystem
    • libboost-system
    • libboost-iostreams
    • libboost-test (only required if you want to compile unit tests)
  • zlib (e.g. zlib1g-dev in Ubuntu)

  • gengetopt

Windows 10 64bit binary For windows you do not need to install any dependencies (they are included in the package). Simply download the pre-compiled windows binary from here windows binary. Extract the zip file. To execute the tool press windows+r, enter cmd, cd C:\\location_of_the_extracted_zip_file\bin and execute .\\idemuxCPP

From Source (distribution tar)

To configure, compile and install execute the following commands on your command line:

 ./configure [--help for additional configuration options]
make
make install

From Source (git) The installation from source requires additional tools and libraries:

  • gnulib (autoconf, automake, etc.)

Generate the configure file with:

 autoreconf -i

Then proceed with ./configure and make like in the previous section.

From Linux Package

Debian Ubuntu Fedora
Debian_12

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_11

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_10

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_9.0

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_24.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_23.10

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_23.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_22.10

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_22.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_20.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_18.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_16.04

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Fedora 40

idemuxcpp - 0.3.0 - 64 bit

Fedora 39

idemuxcpp - 0.3.0 - 64 bit

Fedora 38

idemuxcpp - 0.3.0 - 64 bit

Fedora 37

idemuxcpp - 0.3.0 - 64 bit

Fedora 36

idemuxcpp - 0.3.0 - 64 bit

on ubuntu you can install it for example with:

dpkg -i <idemuxcpp*.deb>

idemuxCPP is available via bioconda!

2. Preparing the sample sheet

In order to run idemuxCPP on your QuantSeq-Pool data you first need to prepare a csv file. We call this csv a sample sheet and it specifies which barcodes correspond to each sample.

This is a necessity as the software needs to know into which bins reads should be sorted during demultiplexing. A sample sheet can easily be generated by filling in an excel spreadsheet and exporting it as csv.

Example sample sheet (i7, i5 and i1 demuliplexing):

 sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
sample_2,GAAAATTTACGC,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,CCCATCCATGTA,AAACTAACTGTC

A sample sheet consists of 4 columns and always starts with the header illustrated above. 'Sample_name' values will be used as output file names, while the sequences specified in i7,i5 & i1 will be used for demultiplexing.

Therefore, only specific, unique unambiguous combinations of sample names and barcodes are allowed. This means using duplicated or ambiguous combinations will result in an error. However, idemuxCPP will do its best to tell you where the problem lies, once this happens.

In brief the rules are:

  1. Sample names need to be unique.
  2. Barcode combinations need to be unique.
  3. i7 and/or i5 indices have to be used consistently within the csv file. i7 and/or i5 indices need to be either present for all samples or none at all.
  4. In contrast to i7/i5 indices, i1 indices can be used for a subset of samples in the csv file.
  5. Absence of a barcode needs to be indicated by an empty field (no value between comas ,,).
  6. If your i5 has been sequenced as reverse complement, enter the reverse complement sequences in the sample sheet and use the --i5-rc option! If you are not sure, you can also use the --auto-detect option as alternative.

See below. for more showcases of sample/barcode combinations that are allowed or disallowed.

3. Extract non-demultiplexed read data from a sequencing run

The read input files for idemux are non-demultiplexed read files which you can get by using demultiplexing software to extract reads from a sequencing run without demultiplexing by sample.
You can use any demultiplexing software available to you, but the resulting read file(s) should contain all reads of the sequencing run you want to demultiplex with idemux. Further, the reads should contain the read-out of the i7 + i5 barcode sequences in the read ID.

The following part of this section outlines how to use Illumina's bcl2fastq software to obtain the reads.

Demultiplexing with bcl2fastq:

bcl2fastq -R /path/to/sequencing/run -o /path/to/output -l WARNING --no-lane-splitting --sample-sheet Illumina_EMPTY_SampleSheet.csv --barcode-mismatches 0 --mask-short-adapter-reads 10

This commands bcl2fastq to "demultiplex" the run at /path/to/sequencing/run to the output directory /path/to/output. The content of the file Illumina_EMPTY_SampleSheet.csv has to match Illumina's format for the respective sequencer.

The following text is an example for the content of a SampleSheet for a Illumina Nextseq run:

[Header],,,,,,,
IEMFileVersion,4,,,,,,
Date,30.05.2017,,,,,,
Workflow,GenerateFASTQ,,,,,,
Application,NextSeq FASTQ Only,,,,,,
Assay,TruSeq RNA,,,,,,
Description,,,,,,,
Chemistry,Default,,,,,,
,,,,,,,
[Reads],,,,,,,
,,,,,,,
[Settings],,,,,,,
,,,,,,,
[Data],,,,,,,
Sample_ID,Sample_Name,Sample_Plate,Sample_Well,I7_Index_ID,index,I5_Index_ID,index2,Sample_Project,Description
1,1,,,9999,AAAAAAAAAAAA,9999,AAAAAAAAAAAA,,

As you can see, no settings are specified and only one 'sample' was defined with a squence combination that is not likely to be close to any of the utilized barcode sequences. You have to adjust the length of the A* stretches to the sequenced length of the i7/i5 barcodes! This specification is necessary to command bcl2fastq to write the i7+i5 sequence information in each read in the Undetermined_S0_R1_001.fastq.gz (Undetermined_S0_R2_001.fastq.gz) file(s) The resulting reads in Undetermined_S0_R1_001.fastq.gz (Undetermined_S0_R2_001.fastq.gz) should follow this formatting style:

@NB502007:379:HM7H2BGXF:1:11101:19231:1159 1:N:0:TTAGGACGCAAA+GGGTCTGCCGAA
GCTCATCCATCTTTTTGAAAACTCTTCATACTCGTTAGATCGGAAGAG
+
AAAAAEEEAEEEEEEAEEEEEEEEEEEEEEEEEEEE/E/EEEEE/EEE
@NB502007:379:HM7H2BGXF:1:11101:17406:1159 1:N:0:AAGTAACAGCTT+AATCGTGGACGG
CACACCTCCGTTCACGACGCTCTTCCGATATAGATGTAACTGGAGGAA
+
AAAAAEEEEEAEE/EEEEEEEEEE/EEEEAEA/EEEEEEEEEEEEEEE
@NB502007:379:HM7H2BGXF:1:11101:18203:1159 1:N:0:CTGCCAACACGA+GCTGTGGTTCAT
GACATGTATACAGTCTACGGATGAACGTTTAGATCGGAAGAGCACACG
+
AAAAAEEEEEEEEEEEEEEEEEEEEEEEEEAEEEEEEEEEEEEEEEEE
@NB502007:379:HM7H2BGXF:1:11101:7322:1159 1:N:0:TACATGGCCACT+ATGTTCCAGTGA
CTTGGTCACGCTACTGTACTCCAGCCAGGGCGACAGAGCAAGACCTAT
+
AAAAAEEEEEEEEEEEE/EEEEEEEEAEEEEEAEEEEEEEEEEEAEEE
...

4. Running idemuxCPP

Once you have installed the tool you can run it by typing idemuxCPP in the terminal.

idemuxCPP accepts the following arguments:

 -h, --help Print help and exit
-V, --version Print version and exit
Required arguments:
-1, --r1=STRING Fastq.gz read file 1 (or .fastq file).
(default='')
-2, --r2=STRING Fastq.gz read file 2 (required only in paired
end mode).
(default='')
-o, --out=STRING Where to write the output files.
(default='./')
-s, --sample-sheet=STRING Input a csv file describing sample names and
barcode combinations (i7, i5 and i1
barcodes).
(default='sample-sheet.csv')
Optional arguments:
-b, --barcode-corrections=STRING
Outputs a csv file that contains the number of
corrected barcodes
-5, --i5-rc Should be set when the i5 barcode has been
sequenced as reverse complement. Make sure to
enter reverse complement sequences in the
barcode file. (default=off)
-i, --i1-start=INT Start position of the i1 index (1-based) on
read 2.
(default='11')
--i1-read=INT Read in which the i1 index should be corrected
(1 or 2).
(default='2')
-q, --queue-size=INT Queue size for reads that will be processed in
one block.
(default='4000000')
-r, --reading-threads=INT Number of threads used for reading gz files.
Either 1 or 2 (one thread per input file is
used).
(default='2')
-w, --writing-threads=INT Number of threads used for writing gz files.
Default is the number of processor cores.
-p, --processing-threads=INT Number of threads used for processing the error
correction. Default is the number of
processor cores.
-d, --demux-only Do a one on one mapping for the barcodes
specified in the sample sheet. No error
correction will be done. Barcodes that do not
match are written to the undetermined reads
file. (default=off)
-v, --verbose Verbose.
(default=off)

Example commands:

 # demultiplexes read 1 and 2 into the folder 'demux'
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux
# demultiplexing assuming the i1 barcode starts at the first base
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux --i1_start 1
# demultiplexing assuming i5 is present as reverse complement in the fastq header
# if he i5 has been sequenced as reverse complement use this option and provide
# the reverse complement sequences in the sample sheet.
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux

After a successful completed run idemuxCPP will write summary report to the output folder ('demultipexing_stats.tsv').

Technicalities

When you run idemuxCPP the following will happen:

  • It will check if your sample sheet is okay. See here for examples

  • It will check the fastq header for barcodes and expects them in the following format:

    single index (i7 or i5): @NB502007:379:HM7H2BGXF:1:11101:24585:1069 1:N:0:TCAGGTAANNTT
    dual index (i7 and i5): @NB502007:379:HM7H2BGXF:1:11101:24585:1069 1:N:0:TCAGGTAANNTT+NANGGNNCNNNN
    
  • Reads that cannot be demultiplexed will be written to undetermined_R{1/2}.fastq.gz

  • When you demultiplex based on i1 inline barcodes, the a successful recognized barcode sequence will be cut out and removed from read 2. This is a design choice and will leave you with the 10 nt UMI + the nucleotides that potentially follow the i1 barcode (or don't).

This allows you to:

  1. Use other software, such as UMI_tools to deal with the 10nt UMI if desired
  2. To demuliplex lanes where QuantSeq-Pool has been pooled with other libraries and read 2 has been sequenced longer than the actual barcode.

If you sequenced i5 as a reverse complement, make sure to fill in reverse complement barcodes into the sample sheet and to use the --i5-rc parameter.

Help

If you are demuliplexing a large number of samples (more than 500) you might encounter the following error:

  • OSError: [Errno 24] Too many open files

This error occurs because most OS have a limit on how many files can be opened and written to at the ame time. In order to temporarily increase the limit run:

 # multiply your sample number*2 (as data is paired end)
# then round to the next multiple of 1024
ulimit -n the_number_above

If you are looking for a permanent solution you can change your ulimit values this way.

In case you experience any issues with this software please open an issue describing your problem. Make sure to post the version of the tool you are running (-v, --version) and your os.

Sample sheet examples

This is allowed:

 # demultiplexing via full i7, i5, i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
# demultiplexing via full i7, i5 and sparse i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,
# demultiplexing via full i7, i5
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,
# demultiplexing via full i7, no i5 and sparse i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,,AAAACATGCGTT
sample_1,AAAATCCCAGTT,,
# demultiplexing via full i7 only
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,,
sample_1,AAAATCCCAGTT,,
# demultiplexing via full i5 and i1
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,,CCCCTAAACGTT,AAAATCCCAGTT
# demultiplexing via full i5 and sparse i1
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,,CCCCTAAACGTT,
# demultiplexing via full i5
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,
sample_1,,CCCCTAAACGTT,
# demultiplexing via full i1
sample_name,i7,i5,i1
sample_0,,,AAAACATGCGTT
sample_1,,,AAAATCCCAGTT
# mixed indexing (if not ambiguous) (full i7 and sparse i5, i1)
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,,AAAATCCCAGTT
sample_2,GAAAATTTACGC,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,,AAACTAACTGTC
# mixed indexing (if not ambiguous) (no i7, sparse i5 & i1)
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,
sample_1,,,AAAATCCCAGTT
# mixed indexing (if not ambiguous) (sparse i7, full i5 & i1)
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
sample_2,,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,CCCATCCATGTA,AAACTAACTGTC
# additional parameter columns for i1_read and i1_start index (1-based).
sample_name,i7,i5,i1,i1_read,i1_start
sample_0,AANACATGCGTT,,TTTTAG,2,1
sample_1,AANACATGCG,,AAAACATG,2,11
sample_2,AANACA,,CACCCC,1,5

This is not allowed:

 # missing i1 column (or any other)
sample_name,i7,i5,
sample_0,AAAACATGCGTT,CCCCACTGAGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT
# duplicated barcode combination
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
# duplicated sample names
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_0,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
# missing comma separator
sample_name,i7,i5,i1
sample_0,AAAACATGCGTTCCCCACTGAGTT,AAAACATGCGTT
# no barcodes
sample_name,i7,i5,i1
sample_0,,,
# wrong column headers
wrong_col_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT

© Lexogen GmbH, 2020

About

iDemux is an all-in-one command line tool that can be used for both demultiplexing and error correction of FASTQ files. It enables demultiplexing of i1 inline barcodes of Lexogen’s QuantSeq-Pool as well as demultiplexing of i7 and/or i5 indices of any other RNA-Seq library prep. iDemux can also be used for superior error correction of RNA-Seq libr…

Resources

Contributing

Stars

8 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

idemuxCPP - inline barcode demultiplexing

GitHub releaseBuild StatusCondaConda Downloads

idemuxCPP is a command line tool designed to demultiplex paired-end fastq files from QuantSeq-Pool.

idemuxCPP can demultiplex based on i7, i5 and i1 inline barcodes. While this tool can generally be used to demultiplex on any barcodes (as long as they are correctly supplied and in the fastq header), it best performs when used in combination with Lexogen indices, as it will correct common sequencing errors in the sequenced barcodes. This will allow you to retain more reads from your sequencing experiment, while minimizing cross contamination.

idemuxCPP use is permitted under the following licence.

idemuxCPP is a direct translation of the python tool idemux (https://github.com/lexogen-tools/idemux) in order to decrease the runtime. It is 2 times faster than the python version.

General usage:

 idemuxCPP [-h] --r1 READ1 --r2 READ2 [--sample-sheet SAMPLE_SHEET] --out OUTPUT_DIR
[--i1-start I1_START] [--i5-rc] [-v]

Run idemuxCPP:

 idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out /some/output/path --i1-start pos_in_read_2

Features

  • FASTQ file demultiplexing based on i7, i5 or i1 barcodes
  • Correction of barcode sequencing errors to maximize read yield (only works with Lexogen 12 nt UDIs, that have been sequenced at least 8 nt.

Getting started

To get stated with demultiplexing you need to:

  1. Install idemuxCPP
  2. Prepare a sample sheet csv
  3. Run idemuxCPP

1. Installation

dependencies:

  • compiler supporting C++11 standard and OpenMP

  • boost C++ library version >= 1.55.0 (install the development versions of the following libraries (or install all e.g. in Ubuntu via package libboost-all-dev)

    • libboost-filesystem
    • libboost-system
    • libboost-iostreams
    • libboost-test (only required if you want to compile unit tests)
  • zlib (e.g. zlib1g-dev in Ubuntu)

  • gengetopt

Windows 10 64bit binary For windows you do not need to install any dependencies (they are included in the package). Simply download the pre-compiled windows binary from here windows binary. Extract the zip file. To execute the tool press windows+r, enter cmd, cd C:\\location_of_the_extracted_zip_file\bin and execute .\\idemuxCPP

From Source (distribution tar)

To configure, compile and install execute the following commands on your command line:

 ./configure [--help for additional configuration options]
make
make install

From Source (git) The installation from source requires additional tools and libraries:

  • gnulib (autoconf, automake, etc.)

Generate the configure file with:

 autoreconf -i

Then proceed with ./configure and make like in the previous section.

From Linux Package

Debian Ubuntu Fedora
Debian_12

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_11

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_10

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_9.0

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_24.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_23.10

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_23.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_22.10

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_22.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_20.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_18.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_16.04

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Fedora 40

idemuxcpp - 0.3.0 - 64 bit

Fedora 39

idemuxcpp - 0.3.0 - 64 bit

Fedora 38

idemuxcpp - 0.3.0 - 64 bit

Fedora 37

idemuxcpp - 0.3.0 - 64 bit

Fedora 36

idemuxcpp - 0.3.0 - 64 bit

on ubuntu you can install it for example with:

dpkg -i <idemuxcpp*.deb>

idemuxCPP is available via bioconda!

2. Preparing the sample sheet

In order to run idemuxCPP on your QuantSeq-Pool data you first need to prepare a csv file. We call this csv a sample sheet and it specifies which barcodes correspond to each sample.

This is a necessity as the software needs to know into which bins reads should be sorted during demultiplexing. A sample sheet can easily be generated by filling in an excel spreadsheet and exporting it as csv.

Example sample sheet (i7, i5 and i1 demuliplexing):

 sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
sample_2,GAAAATTTACGC,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,CCCATCCATGTA,AAACTAACTGTC

A sample sheet consists of 4 columns and always starts with the header illustrated above. 'Sample_name' values will be used as output file names, while the sequences specified in i7,i5 & i1 will be used for demultiplexing.

Therefore, only specific, unique unambiguous combinations of sample names and barcodes are allowed. This means using duplicated or ambiguous combinations will result in an error. However, idemuxCPP will do its best to tell you where the problem lies, once this happens.

In brief the rules are:

  1. Sample names need to be unique.
  2. Barcode combinations need to be unique.
  3. i7 and/or i5 indices have to be used consistently within the csv file. i7 and/or i5 indices need to be either present for all samples or none at all.
  4. In contrast to i7/i5 indices, i1 indices can be used for a subset of samples in the csv file.
  5. Absence of a barcode needs to be indicated by an empty field (no value between comas ,,).
  6. If your i5 has been sequenced as reverse complement, enter the reverse complement sequences in the sample sheet and use the --i5-rc option! If you are not sure, you can also use the --auto-detect option as alternative.

See below. for more showcases of sample/barcode combinations that are allowed or disallowed.

3. Extract non-demultiplexed read data from a sequencing run

The read input files for idemux are non-demultiplexed read files which you can get by using demultiplexing software to extract reads from a sequencing run without demultiplexing by sample.
You can use any demultiplexing software available to you, but the resulting read file(s) should contain all reads of the sequencing run you want to demultiplex with idemux. Further, the reads should contain the read-out of the i7 + i5 barcode sequences in the read ID.

The following part of this section outlines how to use Illumina's bcl2fastq software to obtain the reads.

Demultiplexing with bcl2fastq:

bcl2fastq -R /path/to/sequencing/run -o /path/to/output -l WARNING --no-lane-splitting --sample-sheet Illumina_EMPTY_SampleSheet.csv --barcode-mismatches 0 --mask-short-adapter-reads 10

This commands bcl2fastq to "demultiplex" the run at /path/to/sequencing/run to the output directory /path/to/output. The content of the file Illumina_EMPTY_SampleSheet.csv has to match Illumina's format for the respective sequencer.

The following text is an example for the content of a SampleSheet for a Illumina Nextseq run:

[Header],,,,,,,
IEMFileVersion,4,,,,,,
Date,30.05.2017,,,,,,
Workflow,GenerateFASTQ,,,,,,
Application,NextSeq FASTQ Only,,,,,,
Assay,TruSeq RNA,,,,,,
Description,,,,,,,
Chemistry,Default,,,,,,
,,,,,,,
[Reads],,,,,,,
,,,,,,,
[Settings],,,,,,,
,,,,,,,
[Data],,,,,,,
Sample_ID,Sample_Name,Sample_Plate,Sample_Well,I7_Index_ID,index,I5_Index_ID,index2,Sample_Project,Description
1,1,,,9999,AAAAAAAAAAAA,9999,AAAAAAAAAAAA,,

As you can see, no settings are specified and only one 'sample' was defined with a squence combination that is not likely to be close to any of the utilized barcode sequences. You have to adjust the length of the A* stretches to the sequenced length of the i7/i5 barcodes! This specification is necessary to command bcl2fastq to write the i7+i5 sequence information in each read in the Undetermined_S0_R1_001.fastq.gz (Undetermined_S0_R2_001.fastq.gz) file(s) The resulting reads in Undetermined_S0_R1_001.fastq.gz (Undetermined_S0_R2_001.fastq.gz) should follow this formatting style:

@NB502007:379:HM7H2BGXF:1:11101:19231:1159 1:N:0:TTAGGACGCAAA+GGGTCTGCCGAA
GCTCATCCATCTTTTTGAAAACTCTTCATACTCGTTAGATCGGAAGAG
+
AAAAAEEEAEEEEEEAEEEEEEEEEEEEEEEEEEEE/E/EEEEE/EEE
@NB502007:379:HM7H2BGXF:1:11101:17406:1159 1:N:0:AAGTAACAGCTT+AATCGTGGACGG
CACACCTCCGTTCACGACGCTCTTCCGATATAGATGTAACTGGAGGAA
+
AAAAAEEEEEAEE/EEEEEEEEEE/EEEEAEA/EEEEEEEEEEEEEEE
@NB502007:379:HM7H2BGXF:1:11101:18203:1159 1:N:0:CTGCCAACACGA+GCTGTGGTTCAT
GACATGTATACAGTCTACGGATGAACGTTTAGATCGGAAGAGCACACG
+
AAAAAEEEEEEEEEEEEEEEEEEEEEEEEEAEEEEEEEEEEEEEEEEE
@NB502007:379:HM7H2BGXF:1:11101:7322:1159 1:N:0:TACATGGCCACT+ATGTTCCAGTGA
CTTGGTCACGCTACTGTACTCCAGCCAGGGCGACAGAGCAAGACCTAT
+
AAAAAEEEEEEEEEEEE/EEEEEEEEAEEEEEAEEEEEEEEEEEAEEE
...

4. Running idemuxCPP

Once you have installed the tool you can run it by typing idemuxCPP in the terminal.

idemuxCPP accepts the following arguments:

 -h, --help Print help and exit
-V, --version Print version and exit
Required arguments:
-1, --r1=STRING Fastq.gz read file 1 (or .fastq file).
(default='')
-2, --r2=STRING Fastq.gz read file 2 (required only in paired
end mode).
(default='')
-o, --out=STRING Where to write the output files.
(default='./')
-s, --sample-sheet=STRING Input a csv file describing sample names and
barcode combinations (i7, i5 and i1
barcodes).
(default='sample-sheet.csv')
Optional arguments:
-b, --barcode-corrections=STRING
Outputs a csv file that contains the number of
corrected barcodes
-5, --i5-rc Should be set when the i5 barcode has been
sequenced as reverse complement. Make sure to
enter reverse complement sequences in the
barcode file. (default=off)
-i, --i1-start=INT Start position of the i1 index (1-based) on
read 2.
(default='11')
--i1-read=INT Read in which the i1 index should be corrected
(1 or 2).
(default='2')
-q, --queue-size=INT Queue size for reads that will be processed in
one block.
(default='4000000')
-r, --reading-threads=INT Number of threads used for reading gz files.
Either 1 or 2 (one thread per input file is
used).
(default='2')
-w, --writing-threads=INT Number of threads used for writing gz files.
Default is the number of processor cores.
-p, --processing-threads=INT Number of threads used for processing the error
correction. Default is the number of
processor cores.
-d, --demux-only Do a one on one mapping for the barcodes
specified in the sample sheet. No error
correction will be done. Barcodes that do not
match are written to the undetermined reads
file. (default=off)
-v, --verbose Verbose.
(default=off)

Example commands:

 # demultiplexes read 1 and 2 into the folder 'demux'
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux
# demultiplexing assuming the i1 barcode starts at the first base
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux --i1_start 1
# demultiplexing assuming i5 is present as reverse complement in the fastq header
# if he i5 has been sequenced as reverse complement use this option and provide
# the reverse complement sequences in the sample sheet.
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux

After a successful completed run idemuxCPP will write summary report to the output folder ('demultipexing_stats.tsv').

Technicalities

When you run idemuxCPP the following will happen:

  • It will check if your sample sheet is okay. See here for examples

  • It will check the fastq header for barcodes and expects them in the following format:

    single index (i7 or i5): @NB502007:379:HM7H2BGXF:1:11101:24585:1069 1:N:0:TCAGGTAANNTT
    dual index (i7 and i5): @NB502007:379:HM7H2BGXF:1:11101:24585:1069 1:N:0:TCAGGTAANNTT+NANGGNNCNNNN
    
  • Reads that cannot be demultiplexed will be written to undetermined_R{1/2}.fastq.gz

  • When you demultiplex based on i1 inline barcodes, the a successful recognized barcode sequence will be cut out and removed from read 2. This is a design choice and will leave you with the 10 nt UMI + the nucleotides that potentially follow the i1 barcode (or don't).

This allows you to:

  1. Use other software, such as UMI_tools to deal with the 10nt UMI if desired
  2. To demuliplex lanes where QuantSeq-Pool has been pooled with other libraries and read 2 has been sequenced longer than the actual barcode.

If you sequenced i5 as a reverse complement, make sure to fill in reverse complement barcodes into the sample sheet and to use the --i5-rc parameter.

Help

If you are demuliplexing a large number of samples (more than 500) you might encounter the following error:

  • OSError: [Errno 24] Too many open files

This error occurs because most OS have a limit on how many files can be opened and written to at the ame time. In order to temporarily increase the limit run:

 # multiply your sample number*2 (as data is paired end)
# then round to the next multiple of 1024
ulimit -n the_number_above

If you are looking for a permanent solution you can change your ulimit values this way.

In case you experience any issues with this software please open an issue describing your problem. Make sure to post the version of the tool you are running (-v, --version) and your os.

Sample sheet examples

This is allowed:

 # demultiplexing via full i7, i5, i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
# demultiplexing via full i7, i5 and sparse i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,
# demultiplexing via full i7, i5
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,
# demultiplexing via full i7, no i5 and sparse i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,,AAAACATGCGTT
sample_1,AAAATCCCAGTT,,
# demultiplexing via full i7 only
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,,
sample_1,AAAATCCCAGTT,,
# demultiplexing via full i5 and i1
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,,CCCCTAAACGTT,AAAATCCCAGTT
# demultiplexing via full i5 and sparse i1
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,,CCCCTAAACGTT,
# demultiplexing via full i5
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,
sample_1,,CCCCTAAACGTT,
# demultiplexing via full i1
sample_name,i7,i5,i1
sample_0,,,AAAACATGCGTT
sample_1,,,AAAATCCCAGTT
# mixed indexing (if not ambiguous) (full i7 and sparse i5, i1)
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,,AAAATCCCAGTT
sample_2,GAAAATTTACGC,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,,AAACTAACTGTC
# mixed indexing (if not ambiguous) (no i7, sparse i5 & i1)
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,
sample_1,,,AAAATCCCAGTT
# mixed indexing (if not ambiguous) (sparse i7, full i5 & i1)
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
sample_2,,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,CCCATCCATGTA,AAACTAACTGTC
# additional parameter columns for i1_read and i1_start index (1-based).
sample_name,i7,i5,i1,i1_read,i1_start
sample_0,AANACATGCGTT,,TTTTAG,2,1
sample_1,AANACATGCG,,AAAACATG,2,11
sample_2,AANACA,,CACCCC,1,5

This is not allowed:

 # missing i1 column (or any other)
sample_name,i7,i5,
sample_0,AAAACATGCGTT,CCCCACTGAGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT
# duplicated barcode combination
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
# duplicated sample names
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_0,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
# missing comma separator
sample_name,i7,i5,i1
sample_0,AAAACATGCGTTCCCCACTGAGTT,AAAACATGCGTT
# no barcodes
sample_name,i7,i5,i1
sample_0,,,
# wrong column headers
wrong_col_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT

© Lexogen GmbH, 2020

About

iDemux is an all-in-one command line tool that can be used for both demultiplexing and error correction of FASTQ files. It enables demultiplexing of i1 inline barcodes of Lexogen’s QuantSeq-Pool as well as demultiplexing of i7 and/or i5 indices of any other RNA-Seq library prep. iDemux can also be used for superior error correction of RNA-Seq libr…

Resources

Contributing

Stars

8 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

idemuxCPP - inline barcode demultiplexing

GitHub releaseBuild StatusCondaConda Downloads

idemuxCPP is a command line tool designed to demultiplex paired-end fastq files from QuantSeq-Pool.

idemuxCPP can demultiplex based on i7, i5 and i1 inline barcodes. While this tool can generally be used to demultiplex on any barcodes (as long as they are correctly supplied and in the fastq header), it best performs when used in combination with Lexogen indices, as it will correct common sequencing errors in the sequenced barcodes. This will allow you to retain more reads from your sequencing experiment, while minimizing cross contamination.

idemuxCPP use is permitted under the following licence.

idemuxCPP is a direct translation of the python tool idemux (https://github.com/lexogen-tools/idemux) in order to decrease the runtime. It is 2 times faster than the python version.

General usage:

 idemuxCPP [-h] --r1 READ1 --r2 READ2 [--sample-sheet SAMPLE_SHEET] --out OUTPUT_DIR
[--i1-start I1_START] [--i5-rc] [-v]

Run idemuxCPP:

 idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out /some/output/path --i1-start pos_in_read_2

Features

  • FASTQ file demultiplexing based on i7, i5 or i1 barcodes
  • Correction of barcode sequencing errors to maximize read yield (only works with Lexogen 12 nt UDIs, that have been sequenced at least 8 nt.

Getting started

To get stated with demultiplexing you need to:

  1. Install idemuxCPP
  2. Prepare a sample sheet csv
  3. Run idemuxCPP

1. Installation

dependencies:

  • compiler supporting C++11 standard and OpenMP

  • boost C++ library version >= 1.55.0 (install the development versions of the following libraries (or install all e.g. in Ubuntu via package libboost-all-dev)

    • libboost-filesystem
    • libboost-system
    • libboost-iostreams
    • libboost-test (only required if you want to compile unit tests)
  • zlib (e.g. zlib1g-dev in Ubuntu)

  • gengetopt

Windows 10 64bit binary For windows you do not need to install any dependencies (they are included in the package). Simply download the pre-compiled windows binary from here windows binary. Extract the zip file. To execute the tool press windows+r, enter cmd, cd C:\\location_of_the_extracted_zip_file\bin and execute .\\idemuxCPP

From Source (distribution tar)

To configure, compile and install execute the following commands on your command line:

 ./configure [--help for additional configuration options]
make
make install

From Source (git) The installation from source requires additional tools and libraries:

  • gnulib (autoconf, automake, etc.)

Generate the configure file with:

 autoreconf -i

Then proceed with ./configure and make like in the previous section.

From Linux Package

Debian Ubuntu Fedora
Debian_12

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_11

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_10

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_9.0

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_24.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_23.10

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_23.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_22.10

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_22.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_20.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_18.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_16.04

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Fedora 40

idemuxcpp - 0.3.0 - 64 bit

Fedora 39

idemuxcpp - 0.3.0 - 64 bit

Fedora 38

idemuxcpp - 0.3.0 - 64 bit

Fedora 37

idemuxcpp - 0.3.0 - 64 bit

Fedora 36

idemuxcpp - 0.3.0 - 64 bit

on ubuntu you can install it for example with:

dpkg -i <idemuxcpp*.deb>

idemuxCPP is available via bioconda!

2. Preparing the sample sheet

In order to run idemuxCPP on your QuantSeq-Pool data you first need to prepare a csv file. We call this csv a sample sheet and it specifies which barcodes correspond to each sample.

This is a necessity as the software needs to know into which bins reads should be sorted during demultiplexing. A sample sheet can easily be generated by filling in an excel spreadsheet and exporting it as csv.

Example sample sheet (i7, i5 and i1 demuliplexing):

 sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
sample_2,GAAAATTTACGC,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,CCCATCCATGTA,AAACTAACTGTC

A sample sheet consists of 4 columns and always starts with the header illustrated above. 'Sample_name' values will be used as output file names, while the sequences specified in i7,i5 & i1 will be used for demultiplexing.

Therefore, only specific, unique unambiguous combinations of sample names and barcodes are allowed. This means using duplicated or ambiguous combinations will result in an error. However, idemuxCPP will do its best to tell you where the problem lies, once this happens.

In brief the rules are:

  1. Sample names need to be unique.
  2. Barcode combinations need to be unique.
  3. i7 and/or i5 indices have to be used consistently within the csv file. i7 and/or i5 indices need to be either present for all samples or none at all.
  4. In contrast to i7/i5 indices, i1 indices can be used for a subset of samples in the csv file.
  5. Absence of a barcode needs to be indicated by an empty field (no value between comas ,,).
  6. If your i5 has been sequenced as reverse complement, enter the reverse complement sequences in the sample sheet and use the --i5-rc option! If you are not sure, you can also use the --auto-detect option as alternative.

See below. for more showcases of sample/barcode combinations that are allowed or disallowed.

3. Extract non-demultiplexed read data from a sequencing run

The read input files for idemux are non-demultiplexed read files which you can get by using demultiplexing software to extract reads from a sequencing run without demultiplexing by sample.
You can use any demultiplexing software available to you, but the resulting read file(s) should contain all reads of the sequencing run you want to demultiplex with idemux. Further, the reads should contain the read-out of the i7 + i5 barcode sequences in the read ID.

The following part of this section outlines how to use Illumina's bcl2fastq software to obtain the reads.

Demultiplexing with bcl2fastq:

bcl2fastq -R /path/to/sequencing/run -o /path/to/output -l WARNING --no-lane-splitting --sample-sheet Illumina_EMPTY_SampleSheet.csv --barcode-mismatches 0 --mask-short-adapter-reads 10

This commands bcl2fastq to "demultiplex" the run at /path/to/sequencing/run to the output directory /path/to/output. The content of the file Illumina_EMPTY_SampleSheet.csv has to match Illumina's format for the respective sequencer.

The following text is an example for the content of a SampleSheet for a Illumina Nextseq run:

[Header],,,,,,,
IEMFileVersion,4,,,,,,
Date,30.05.2017,,,,,,
Workflow,GenerateFASTQ,,,,,,
Application,NextSeq FASTQ Only,,,,,,
Assay,TruSeq RNA,,,,,,
Description,,,,,,,
Chemistry,Default,,,,,,
,,,,,,,
[Reads],,,,,,,
,,,,,,,
[Settings],,,,,,,
,,,,,,,
[Data],,,,,,,
Sample_ID,Sample_Name,Sample_Plate,Sample_Well,I7_Index_ID,index,I5_Index_ID,index2,Sample_Project,Description
1,1,,,9999,AAAAAAAAAAAA,9999,AAAAAAAAAAAA,,

As you can see, no settings are specified and only one 'sample' was defined with a squence combination that is not likely to be close to any of the utilized barcode sequences. You have to adjust the length of the A* stretches to the sequenced length of the i7/i5 barcodes! This specification is necessary to command bcl2fastq to write the i7+i5 sequence information in each read in the Undetermined_S0_R1_001.fastq.gz (Undetermined_S0_R2_001.fastq.gz) file(s) The resulting reads in Undetermined_S0_R1_001.fastq.gz (Undetermined_S0_R2_001.fastq.gz) should follow this formatting style:

@NB502007:379:HM7H2BGXF:1:11101:19231:1159 1:N:0:TTAGGACGCAAA+GGGTCTGCCGAA
GCTCATCCATCTTTTTGAAAACTCTTCATACTCGTTAGATCGGAAGAG
+
AAAAAEEEAEEEEEEAEEEEEEEEEEEEEEEEEEEE/E/EEEEE/EEE
@NB502007:379:HM7H2BGXF:1:11101:17406:1159 1:N:0:AAGTAACAGCTT+AATCGTGGACGG
CACACCTCCGTTCACGACGCTCTTCCGATATAGATGTAACTGGAGGAA
+
AAAAAEEEEEAEE/EEEEEEEEEE/EEEEAEA/EEEEEEEEEEEEEEE
@NB502007:379:HM7H2BGXF:1:11101:18203:1159 1:N:0:CTGCCAACACGA+GCTGTGGTTCAT
GACATGTATACAGTCTACGGATGAACGTTTAGATCGGAAGAGCACACG
+
AAAAAEEEEEEEEEEEEEEEEEEEEEEEEEAEEEEEEEEEEEEEEEEE
@NB502007:379:HM7H2BGXF:1:11101:7322:1159 1:N:0:TACATGGCCACT+ATGTTCCAGTGA
CTTGGTCACGCTACTGTACTCCAGCCAGGGCGACAGAGCAAGACCTAT
+
AAAAAEEEEEEEEEEEE/EEEEEEEEAEEEEEAEEEEEEEEEEEAEEE
...

4. Running idemuxCPP

Once you have installed the tool you can run it by typing idemuxCPP in the terminal.

idemuxCPP accepts the following arguments:

 -h, --help Print help and exit
-V, --version Print version and exit
Required arguments:
-1, --r1=STRING Fastq.gz read file 1 (or .fastq file).
(default='')
-2, --r2=STRING Fastq.gz read file 2 (required only in paired
end mode).
(default='')
-o, --out=STRING Where to write the output files.
(default='./')
-s, --sample-sheet=STRING Input a csv file describing sample names and
barcode combinations (i7, i5 and i1
barcodes).
(default='sample-sheet.csv')
Optional arguments:
-b, --barcode-corrections=STRING
Outputs a csv file that contains the number of
corrected barcodes
-5, --i5-rc Should be set when the i5 barcode has been
sequenced as reverse complement. Make sure to
enter reverse complement sequences in the
barcode file. (default=off)
-i, --i1-start=INT Start position of the i1 index (1-based) on
read 2.
(default='11')
--i1-read=INT Read in which the i1 index should be corrected
(1 or 2).
(default='2')
-q, --queue-size=INT Queue size for reads that will be processed in
one block.
(default='4000000')
-r, --reading-threads=INT Number of threads used for reading gz files.
Either 1 or 2 (one thread per input file is
used).
(default='2')
-w, --writing-threads=INT Number of threads used for writing gz files.
Default is the number of processor cores.
-p, --processing-threads=INT Number of threads used for processing the error
correction. Default is the number of
processor cores.
-d, --demux-only Do a one on one mapping for the barcodes
specified in the sample sheet. No error
correction will be done. Barcodes that do not
match are written to the undetermined reads
file. (default=off)
-v, --verbose Verbose.
(default=off)

Example commands:

 # demultiplexes read 1 and 2 into the folder 'demux'
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux
# demultiplexing assuming the i1 barcode starts at the first base
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux --i1_start 1
# demultiplexing assuming i5 is present as reverse complement in the fastq header
# if he i5 has been sequenced as reverse complement use this option and provide
# the reverse complement sequences in the sample sheet.
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux

After a successful completed run idemuxCPP will write summary report to the output folder ('demultipexing_stats.tsv').

Technicalities

When you run idemuxCPP the following will happen:

  • It will check if your sample sheet is okay. See here for examples

  • It will check the fastq header for barcodes and expects them in the following format:

    single index (i7 or i5): @NB502007:379:HM7H2BGXF:1:11101:24585:1069 1:N:0:TCAGGTAANNTT
    dual index (i7 and i5): @NB502007:379:HM7H2BGXF:1:11101:24585:1069 1:N:0:TCAGGTAANNTT+NANGGNNCNNNN
    
  • Reads that cannot be demultiplexed will be written to undetermined_R{1/2}.fastq.gz

  • When you demultiplex based on i1 inline barcodes, the a successful recognized barcode sequence will be cut out and removed from read 2. This is a design choice and will leave you with the 10 nt UMI + the nucleotides that potentially follow the i1 barcode (or don't).

This allows you to:

  1. Use other software, such as UMI_tools to deal with the 10nt UMI if desired
  2. To demuliplex lanes where QuantSeq-Pool has been pooled with other libraries and read 2 has been sequenced longer than the actual barcode.

If you sequenced i5 as a reverse complement, make sure to fill in reverse complement barcodes into the sample sheet and to use the --i5-rc parameter.

Help

If you are demuliplexing a large number of samples (more than 500) you might encounter the following error:

  • OSError: [Errno 24] Too many open files

This error occurs because most OS have a limit on how many files can be opened and written to at the ame time. In order to temporarily increase the limit run:

 # multiply your sample number*2 (as data is paired end)
# then round to the next multiple of 1024
ulimit -n the_number_above

If you are looking for a permanent solution you can change your ulimit values this way.

In case you experience any issues with this software please open an issue describing your problem. Make sure to post the version of the tool you are running (-v, --version) and your os.

Sample sheet examples

This is allowed:

 # demultiplexing via full i7, i5, i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
# demultiplexing via full i7, i5 and sparse i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,
# demultiplexing via full i7, i5
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,
# demultiplexing via full i7, no i5 and sparse i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,,AAAACATGCGTT
sample_1,AAAATCCCAGTT,,
# demultiplexing via full i7 only
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,,
sample_1,AAAATCCCAGTT,,
# demultiplexing via full i5 and i1
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,,CCCCTAAACGTT,AAAATCCCAGTT
# demultiplexing via full i5 and sparse i1
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,,CCCCTAAACGTT,
# demultiplexing via full i5
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,
sample_1,,CCCCTAAACGTT,
# demultiplexing via full i1
sample_name,i7,i5,i1
sample_0,,,AAAACATGCGTT
sample_1,,,AAAATCCCAGTT
# mixed indexing (if not ambiguous) (full i7 and sparse i5, i1)
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,,AAAATCCCAGTT
sample_2,GAAAATTTACGC,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,,AAACTAACTGTC
# mixed indexing (if not ambiguous) (no i7, sparse i5 & i1)
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,
sample_1,,,AAAATCCCAGTT
# mixed indexing (if not ambiguous) (sparse i7, full i5 & i1)
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
sample_2,,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,CCCATCCATGTA,AAACTAACTGTC
# additional parameter columns for i1_read and i1_start index (1-based).
sample_name,i7,i5,i1,i1_read,i1_start
sample_0,AANACATGCGTT,,TTTTAG,2,1
sample_1,AANACATGCG,,AAAACATG,2,11
sample_2,AANACA,,CACCCC,1,5

This is not allowed:

 # missing i1 column (or any other)
sample_name,i7,i5,
sample_0,AAAACATGCGTT,CCCCACTGAGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT
# duplicated barcode combination
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
# duplicated sample names
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_0,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
# missing comma separator
sample_name,i7,i5,i1
sample_0,AAAACATGCGTTCCCCACTGAGTT,AAAACATGCGTT
# no barcodes
sample_name,i7,i5,i1
sample_0,,,
# wrong column headers
wrong_col_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT

© Lexogen GmbH, 2020

About

iDemux is an all-in-one command line tool that can be used for both demultiplexing and error correction of FASTQ files. It enables demultiplexing of i1 inline barcodes of Lexogen’s QuantSeq-Pool as well as demultiplexing of i7 and/or i5 indices of any other RNA-Seq library prep. iDemux can also be used for superior error correction of RNA-Seq libr…

Resources

Contributing

Stars

8 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

idemuxCPP - inline barcode demultiplexing

GitHub releaseBuild StatusCondaConda Downloads

idemuxCPP is a command line tool designed to demultiplex paired-end fastq files from QuantSeq-Pool.

idemuxCPP can demultiplex based on i7, i5 and i1 inline barcodes. While this tool can generally be used to demultiplex on any barcodes (as long as they are correctly supplied and in the fastq header), it best performs when used in combination with Lexogen indices, as it will correct common sequencing errors in the sequenced barcodes. This will allow you to retain more reads from your sequencing experiment, while minimizing cross contamination.

idemuxCPP use is permitted under the following licence.

idemuxCPP is a direct translation of the python tool idemux (https://github.com/lexogen-tools/idemux) in order to decrease the runtime. It is 2 times faster than the python version.

General usage:

 idemuxCPP [-h] --r1 READ1 --r2 READ2 [--sample-sheet SAMPLE_SHEET] --out OUTPUT_DIR
[--i1-start I1_START] [--i5-rc] [-v]

Run idemuxCPP:

 idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out /some/output/path --i1-start pos_in_read_2

Features

  • FASTQ file demultiplexing based on i7, i5 or i1 barcodes
  • Correction of barcode sequencing errors to maximize read yield (only works with Lexogen 12 nt UDIs, that have been sequenced at least 8 nt.

Getting started

To get stated with demultiplexing you need to:

  1. Install idemuxCPP
  2. Prepare a sample sheet csv
  3. Run idemuxCPP

1. Installation

dependencies:

  • compiler supporting C++11 standard and OpenMP

  • boost C++ library version >= 1.55.0 (install the development versions of the following libraries (or install all e.g. in Ubuntu via package libboost-all-dev)

    • libboost-filesystem
    • libboost-system
    • libboost-iostreams
    • libboost-test (only required if you want to compile unit tests)
  • zlib (e.g. zlib1g-dev in Ubuntu)

  • gengetopt

Windows 10 64bit binary For windows you do not need to install any dependencies (they are included in the package). Simply download the pre-compiled windows binary from here windows binary. Extract the zip file. To execute the tool press windows+r, enter cmd, cd C:\\location_of_the_extracted_zip_file\bin and execute .\\idemuxCPP

From Source (distribution tar)

To configure, compile and install execute the following commands on your command line:

 ./configure [--help for additional configuration options]
make
make install

From Source (git) The installation from source requires additional tools and libraries:

  • gnulib (autoconf, automake, etc.)

Generate the configure file with:

 autoreconf -i

Then proceed with ./configure and make like in the previous section.

From Linux Package

Debian Ubuntu Fedora
Debian_12

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_11

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_10

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_9.0

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_24.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_23.10

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_23.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_22.10

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_22.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_20.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_18.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_16.04

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Fedora 40

idemuxcpp - 0.3.0 - 64 bit

Fedora 39

idemuxcpp - 0.3.0 - 64 bit

Fedora 38

idemuxcpp - 0.3.0 - 64 bit

Fedora 37

idemuxcpp - 0.3.0 - 64 bit

Fedora 36

idemuxcpp - 0.3.0 - 64 bit

on ubuntu you can install it for example with:

dpkg -i <idemuxcpp*.deb>

idemuxCPP is available via bioconda!

2. Preparing the sample sheet

In order to run idemuxCPP on your QuantSeq-Pool data you first need to prepare a csv file. We call this csv a sample sheet and it specifies which barcodes correspond to each sample.

This is a necessity as the software needs to know into which bins reads should be sorted during demultiplexing. A sample sheet can easily be generated by filling in an excel spreadsheet and exporting it as csv.

Example sample sheet (i7, i5 and i1 demuliplexing):

 sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
sample_2,GAAAATTTACGC,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,CCCATCCATGTA,AAACTAACTGTC

A sample sheet consists of 4 columns and always starts with the header illustrated above. 'Sample_name' values will be used as output file names, while the sequences specified in i7,i5 & i1 will be used for demultiplexing.

Therefore, only specific, unique unambiguous combinations of sample names and barcodes are allowed. This means using duplicated or ambiguous combinations will result in an error. However, idemuxCPP will do its best to tell you where the problem lies, once this happens.

In brief the rules are:

  1. Sample names need to be unique.
  2. Barcode combinations need to be unique.
  3. i7 and/or i5 indices have to be used consistently within the csv file. i7 and/or i5 indices need to be either present for all samples or none at all.
  4. In contrast to i7/i5 indices, i1 indices can be used for a subset of samples in the csv file.
  5. Absence of a barcode needs to be indicated by an empty field (no value between comas ,,).
  6. If your i5 has been sequenced as reverse complement, enter the reverse complement sequences in the sample sheet and use the --i5-rc option! If you are not sure, you can also use the --auto-detect option as alternative.

See below. for more showcases of sample/barcode combinations that are allowed or disallowed.

3. Extract non-demultiplexed read data from a sequencing run

The read input files for idemux are non-demultiplexed read files which you can get by using demultiplexing software to extract reads from a sequencing run without demultiplexing by sample.
You can use any demultiplexing software available to you, but the resulting read file(s) should contain all reads of the sequencing run you want to demultiplex with idemux. Further, the reads should contain the read-out of the i7 + i5 barcode sequences in the read ID.

The following part of this section outlines how to use Illumina's bcl2fastq software to obtain the reads.

Demultiplexing with bcl2fastq:

bcl2fastq -R /path/to/sequencing/run -o /path/to/output -l WARNING --no-lane-splitting --sample-sheet Illumina_EMPTY_SampleSheet.csv --barcode-mismatches 0 --mask-short-adapter-reads 10

This commands bcl2fastq to "demultiplex" the run at /path/to/sequencing/run to the output directory /path/to/output. The content of the file Illumina_EMPTY_SampleSheet.csv has to match Illumina's format for the respective sequencer.

The following text is an example for the content of a SampleSheet for a Illumina Nextseq run:

[Header],,,,,,,
IEMFileVersion,4,,,,,,
Date,30.05.2017,,,,,,
Workflow,GenerateFASTQ,,,,,,
Application,NextSeq FASTQ Only,,,,,,
Assay,TruSeq RNA,,,,,,
Description,,,,,,,
Chemistry,Default,,,,,,
,,,,,,,
[Reads],,,,,,,
,,,,,,,
[Settings],,,,,,,
,,,,,,,
[Data],,,,,,,
Sample_ID,Sample_Name,Sample_Plate,Sample_Well,I7_Index_ID,index,I5_Index_ID,index2,Sample_Project,Description
1,1,,,9999,AAAAAAAAAAAA,9999,AAAAAAAAAAAA,,

As you can see, no settings are specified and only one 'sample' was defined with a squence combination that is not likely to be close to any of the utilized barcode sequences. You have to adjust the length of the A* stretches to the sequenced length of the i7/i5 barcodes! This specification is necessary to command bcl2fastq to write the i7+i5 sequence information in each read in the Undetermined_S0_R1_001.fastq.gz (Undetermined_S0_R2_001.fastq.gz) file(s) The resulting reads in Undetermined_S0_R1_001.fastq.gz (Undetermined_S0_R2_001.fastq.gz) should follow this formatting style:

@NB502007:379:HM7H2BGXF:1:11101:19231:1159 1:N:0:TTAGGACGCAAA+GGGTCTGCCGAA
GCTCATCCATCTTTTTGAAAACTCTTCATACTCGTTAGATCGGAAGAG
+
AAAAAEEEAEEEEEEAEEEEEEEEEEEEEEEEEEEE/E/EEEEE/EEE
@NB502007:379:HM7H2BGXF:1:11101:17406:1159 1:N:0:AAGTAACAGCTT+AATCGTGGACGG
CACACCTCCGTTCACGACGCTCTTCCGATATAGATGTAACTGGAGGAA
+
AAAAAEEEEEAEE/EEEEEEEEEE/EEEEAEA/EEEEEEEEEEEEEEE
@NB502007:379:HM7H2BGXF:1:11101:18203:1159 1:N:0:CTGCCAACACGA+GCTGTGGTTCAT
GACATGTATACAGTCTACGGATGAACGTTTAGATCGGAAGAGCACACG
+
AAAAAEEEEEEEEEEEEEEEEEEEEEEEEEAEEEEEEEEEEEEEEEEE
@NB502007:379:HM7H2BGXF:1:11101:7322:1159 1:N:0:TACATGGCCACT+ATGTTCCAGTGA
CTTGGTCACGCTACTGTACTCCAGCCAGGGCGACAGAGCAAGACCTAT
+
AAAAAEEEEEEEEEEEE/EEEEEEEEAEEEEEAEEEEEEEEEEEAEEE
...

4. Running idemuxCPP

Once you have installed the tool you can run it by typing idemuxCPP in the terminal.

idemuxCPP accepts the following arguments:

 -h, --help Print help and exit
-V, --version Print version and exit
Required arguments:
-1, --r1=STRING Fastq.gz read file 1 (or .fastq file).
(default='')
-2, --r2=STRING Fastq.gz read file 2 (required only in paired
end mode).
(default='')
-o, --out=STRING Where to write the output files.
(default='./')
-s, --sample-sheet=STRING Input a csv file describing sample names and
barcode combinations (i7, i5 and i1
barcodes).
(default='sample-sheet.csv')
Optional arguments:
-b, --barcode-corrections=STRING
Outputs a csv file that contains the number of
corrected barcodes
-5, --i5-rc Should be set when the i5 barcode has been
sequenced as reverse complement. Make sure to
enter reverse complement sequences in the
barcode file. (default=off)
-i, --i1-start=INT Start position of the i1 index (1-based) on
read 2.
(default='11')
--i1-read=INT Read in which the i1 index should be corrected
(1 or 2).
(default='2')
-q, --queue-size=INT Queue size for reads that will be processed in
one block.
(default='4000000')
-r, --reading-threads=INT Number of threads used for reading gz files.
Either 1 or 2 (one thread per input file is
used).
(default='2')
-w, --writing-threads=INT Number of threads used for writing gz files.
Default is the number of processor cores.
-p, --processing-threads=INT Number of threads used for processing the error
correction. Default is the number of
processor cores.
-d, --demux-only Do a one on one mapping for the barcodes
specified in the sample sheet. No error
correction will be done. Barcodes that do not
match are written to the undetermined reads
file. (default=off)
-v, --verbose Verbose.
(default=off)

Example commands:

 # demultiplexes read 1 and 2 into the folder 'demux'
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux
# demultiplexing assuming the i1 barcode starts at the first base
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux --i1_start 1
# demultiplexing assuming i5 is present as reverse complement in the fastq header
# if he i5 has been sequenced as reverse complement use this option and provide
# the reverse complement sequences in the sample sheet.
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux

After a successful completed run idemuxCPP will write summary report to the output folder ('demultipexing_stats.tsv').

Technicalities

When you run idemuxCPP the following will happen:

  • It will check if your sample sheet is okay. See here for examples

  • It will check the fastq header for barcodes and expects them in the following format:

    single index (i7 or i5): @NB502007:379:HM7H2BGXF:1:11101:24585:1069 1:N:0:TCAGGTAANNTT
    dual index (i7 and i5): @NB502007:379:HM7H2BGXF:1:11101:24585:1069 1:N:0:TCAGGTAANNTT+NANGGNNCNNNN
    
  • Reads that cannot be demultiplexed will be written to undetermined_R{1/2}.fastq.gz

  • When you demultiplex based on i1 inline barcodes, the a successful recognized barcode sequence will be cut out and removed from read 2. This is a design choice and will leave you with the 10 nt UMI + the nucleotides that potentially follow the i1 barcode (or don't).

This allows you to:

  1. Use other software, such as UMI_tools to deal with the 10nt UMI if desired
  2. To demuliplex lanes where QuantSeq-Pool has been pooled with other libraries and read 2 has been sequenced longer than the actual barcode.

If you sequenced i5 as a reverse complement, make sure to fill in reverse complement barcodes into the sample sheet and to use the --i5-rc parameter.

Help

If you are demuliplexing a large number of samples (more than 500) you might encounter the following error:

  • OSError: [Errno 24] Too many open files

This error occurs because most OS have a limit on how many files can be opened and written to at the ame time. In order to temporarily increase the limit run:

 # multiply your sample number*2 (as data is paired end)
# then round to the next multiple of 1024
ulimit -n the_number_above

If you are looking for a permanent solution you can change your ulimit values this way.

In case you experience any issues with this software please open an issue describing your problem. Make sure to post the version of the tool you are running (-v, --version) and your os.

Sample sheet examples

This is allowed:

 # demultiplexing via full i7, i5, i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
# demultiplexing via full i7, i5 and sparse i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,
# demultiplexing via full i7, i5
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,
# demultiplexing via full i7, no i5 and sparse i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,,AAAACATGCGTT
sample_1,AAAATCCCAGTT,,
# demultiplexing via full i7 only
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,,
sample_1,AAAATCCCAGTT,,
# demultiplexing via full i5 and i1
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,,CCCCTAAACGTT,AAAATCCCAGTT
# demultiplexing via full i5 and sparse i1
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,,CCCCTAAACGTT,
# demultiplexing via full i5
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,
sample_1,,CCCCTAAACGTT,
# demultiplexing via full i1
sample_name,i7,i5,i1
sample_0,,,AAAACATGCGTT
sample_1,,,AAAATCCCAGTT
# mixed indexing (if not ambiguous) (full i7 and sparse i5, i1)
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,,AAAATCCCAGTT
sample_2,GAAAATTTACGC,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,,AAACTAACTGTC
# mixed indexing (if not ambiguous) (no i7, sparse i5 & i1)
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,
sample_1,,,AAAATCCCAGTT
# mixed indexing (if not ambiguous) (sparse i7, full i5 & i1)
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
sample_2,,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,CCCATCCATGTA,AAACTAACTGTC
# additional parameter columns for i1_read and i1_start index (1-based).
sample_name,i7,i5,i1,i1_read,i1_start
sample_0,AANACATGCGTT,,TTTTAG,2,1
sample_1,AANACATGCG,,AAAACATG,2,11
sample_2,AANACA,,CACCCC,1,5

This is not allowed:

 # missing i1 column (or any other)
sample_name,i7,i5,
sample_0,AAAACATGCGTT,CCCCACTGAGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT
# duplicated barcode combination
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
# duplicated sample names
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_0,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
# missing comma separator
sample_name,i7,i5,i1
sample_0,AAAACATGCGTTCCCCACTGAGTT,AAAACATGCGTT
# no barcodes
sample_name,i7,i5,i1
sample_0,,,
# wrong column headers
wrong_col_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT

© Lexogen GmbH, 2020

About

iDemux is an all-in-one command line tool that can be used for both demultiplexing and error correction of FASTQ files. It enables demultiplexing of i1 inline barcodes of Lexogen’s QuantSeq-Pool as well as demultiplexing of i7 and/or i5 indices of any other RNA-Seq library prep. iDemux can also be used for superior error correction of RNA-Seq libr…

Resources

Contributing

Stars

8 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

idemuxCPP - inline barcode demultiplexing

GitHub releaseBuild StatusCondaConda Downloads

idemuxCPP is a command line tool designed to demultiplex paired-end fastq files from QuantSeq-Pool.

idemuxCPP can demultiplex based on i7, i5 and i1 inline barcodes. While this tool can generally be used to demultiplex on any barcodes (as long as they are correctly supplied and in the fastq header), it best performs when used in combination with Lexogen indices, as it will correct common sequencing errors in the sequenced barcodes. This will allow you to retain more reads from your sequencing experiment, while minimizing cross contamination.

idemuxCPP use is permitted under the following licence.

idemuxCPP is a direct translation of the python tool idemux (https://github.com/lexogen-tools/idemux) in order to decrease the runtime. It is 2 times faster than the python version.

General usage:

 idemuxCPP [-h] --r1 READ1 --r2 READ2 [--sample-sheet SAMPLE_SHEET] --out OUTPUT_DIR
[--i1-start I1_START] [--i5-rc] [-v]

Run idemuxCPP:

 idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out /some/output/path --i1-start pos_in_read_2

Features

  • FASTQ file demultiplexing based on i7, i5 or i1 barcodes
  • Correction of barcode sequencing errors to maximize read yield (only works with Lexogen 12 nt UDIs, that have been sequenced at least 8 nt.

Getting started

To get stated with demultiplexing you need to:

  1. Install idemuxCPP
  2. Prepare a sample sheet csv
  3. Run idemuxCPP

1. Installation

dependencies:

  • compiler supporting C++11 standard and OpenMP

  • boost C++ library version >= 1.55.0 (install the development versions of the following libraries (or install all e.g. in Ubuntu via package libboost-all-dev)

    • libboost-filesystem
    • libboost-system
    • libboost-iostreams
    • libboost-test (only required if you want to compile unit tests)
  • zlib (e.g. zlib1g-dev in Ubuntu)

  • gengetopt

Windows 10 64bit binary For windows you do not need to install any dependencies (they are included in the package). Simply download the pre-compiled windows binary from here windows binary. Extract the zip file. To execute the tool press windows+r, enter cmd, cd C:\\location_of_the_extracted_zip_file\bin and execute .\\idemuxCPP

From Source (distribution tar)

To configure, compile and install execute the following commands on your command line:

 ./configure [--help for additional configuration options]
make
make install

From Source (git) The installation from source requires additional tools and libraries:

  • gnulib (autoconf, automake, etc.)

Generate the configure file with:

 autoreconf -i

Then proceed with ./configure and make like in the previous section.

From Linux Package

Debian Ubuntu Fedora
Debian_12

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_11

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_10

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_9.0

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_24.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_23.10

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_23.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_22.10

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_22.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_20.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_18.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_16.04

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Fedora 40

idemuxcpp - 0.3.0 - 64 bit

Fedora 39

idemuxcpp - 0.3.0 - 64 bit

Fedora 38

idemuxcpp - 0.3.0 - 64 bit

Fedora 37

idemuxcpp - 0.3.0 - 64 bit

Fedora 36

idemuxcpp - 0.3.0 - 64 bit

on ubuntu you can install it for example with:

dpkg -i <idemuxcpp*.deb>

idemuxCPP is available via bioconda!

2. Preparing the sample sheet

In order to run idemuxCPP on your QuantSeq-Pool data you first need to prepare a csv file. We call this csv a sample sheet and it specifies which barcodes correspond to each sample.

This is a necessity as the software needs to know into which bins reads should be sorted during demultiplexing. A sample sheet can easily be generated by filling in an excel spreadsheet and exporting it as csv.

Example sample sheet (i7, i5 and i1 demuliplexing):

 sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
sample_2,GAAAATTTACGC,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,CCCATCCATGTA,AAACTAACTGTC

A sample sheet consists of 4 columns and always starts with the header illustrated above. 'Sample_name' values will be used as output file names, while the sequences specified in i7,i5 & i1 will be used for demultiplexing.

Therefore, only specific, unique unambiguous combinations of sample names and barcodes are allowed. This means using duplicated or ambiguous combinations will result in an error. However, idemuxCPP will do its best to tell you where the problem lies, once this happens.

In brief the rules are:

  1. Sample names need to be unique.
  2. Barcode combinations need to be unique.
  3. i7 and/or i5 indices have to be used consistently within the csv file. i7 and/or i5 indices need to be either present for all samples or none at all.
  4. In contrast to i7/i5 indices, i1 indices can be used for a subset of samples in the csv file.
  5. Absence of a barcode needs to be indicated by an empty field (no value between comas ,,).
  6. If your i5 has been sequenced as reverse complement, enter the reverse complement sequences in the sample sheet and use the --i5-rc option! If you are not sure, you can also use the --auto-detect option as alternative.

See below. for more showcases of sample/barcode combinations that are allowed or disallowed.

3. Extract non-demultiplexed read data from a sequencing run

The read input files for idemux are non-demultiplexed read files which you can get by using demultiplexing software to extract reads from a sequencing run without demultiplexing by sample.
You can use any demultiplexing software available to you, but the resulting read file(s) should contain all reads of the sequencing run you want to demultiplex with idemux. Further, the reads should contain the read-out of the i7 + i5 barcode sequences in the read ID.

The following part of this section outlines how to use Illumina's bcl2fastq software to obtain the reads.

Demultiplexing with bcl2fastq:

bcl2fastq -R /path/to/sequencing/run -o /path/to/output -l WARNING --no-lane-splitting --sample-sheet Illumina_EMPTY_SampleSheet.csv --barcode-mismatches 0 --mask-short-adapter-reads 10

This commands bcl2fastq to "demultiplex" the run at /path/to/sequencing/run to the output directory /path/to/output. The content of the file Illumina_EMPTY_SampleSheet.csv has to match Illumina's format for the respective sequencer.

The following text is an example for the content of a SampleSheet for a Illumina Nextseq run:

[Header],,,,,,,
IEMFileVersion,4,,,,,,
Date,30.05.2017,,,,,,
Workflow,GenerateFASTQ,,,,,,
Application,NextSeq FASTQ Only,,,,,,
Assay,TruSeq RNA,,,,,,
Description,,,,,,,
Chemistry,Default,,,,,,
,,,,,,,
[Reads],,,,,,,
,,,,,,,
[Settings],,,,,,,
,,,,,,,
[Data],,,,,,,
Sample_ID,Sample_Name,Sample_Plate,Sample_Well,I7_Index_ID,index,I5_Index_ID,index2,Sample_Project,Description
1,1,,,9999,AAAAAAAAAAAA,9999,AAAAAAAAAAAA,,

As you can see, no settings are specified and only one 'sample' was defined with a squence combination that is not likely to be close to any of the utilized barcode sequences. You have to adjust the length of the A* stretches to the sequenced length of the i7/i5 barcodes! This specification is necessary to command bcl2fastq to write the i7+i5 sequence information in each read in the Undetermined_S0_R1_001.fastq.gz (Undetermined_S0_R2_001.fastq.gz) file(s) The resulting reads in Undetermined_S0_R1_001.fastq.gz (Undetermined_S0_R2_001.fastq.gz) should follow this formatting style:

@NB502007:379:HM7H2BGXF:1:11101:19231:1159 1:N:0:TTAGGACGCAAA+GGGTCTGCCGAA
GCTCATCCATCTTTTTGAAAACTCTTCATACTCGTTAGATCGGAAGAG
+
AAAAAEEEAEEEEEEAEEEEEEEEEEEEEEEEEEEE/E/EEEEE/EEE
@NB502007:379:HM7H2BGXF:1:11101:17406:1159 1:N:0:AAGTAACAGCTT+AATCGTGGACGG
CACACCTCCGTTCACGACGCTCTTCCGATATAGATGTAACTGGAGGAA
+
AAAAAEEEEEAEE/EEEEEEEEEE/EEEEAEA/EEEEEEEEEEEEEEE
@NB502007:379:HM7H2BGXF:1:11101:18203:1159 1:N:0:CTGCCAACACGA+GCTGTGGTTCAT
GACATGTATACAGTCTACGGATGAACGTTTAGATCGGAAGAGCACACG
+
AAAAAEEEEEEEEEEEEEEEEEEEEEEEEEAEEEEEEEEEEEEEEEEE
@NB502007:379:HM7H2BGXF:1:11101:7322:1159 1:N:0:TACATGGCCACT+ATGTTCCAGTGA
CTTGGTCACGCTACTGTACTCCAGCCAGGGCGACAGAGCAAGACCTAT
+
AAAAAEEEEEEEEEEEE/EEEEEEEEAEEEEEAEEEEEEEEEEEAEEE
...

4. Running idemuxCPP

Once you have installed the tool you can run it by typing idemuxCPP in the terminal.

idemuxCPP accepts the following arguments:

 -h, --help Print help and exit
-V, --version Print version and exit
Required arguments:
-1, --r1=STRING Fastq.gz read file 1 (or .fastq file).
(default='')
-2, --r2=STRING Fastq.gz read file 2 (required only in paired
end mode).
(default='')
-o, --out=STRING Where to write the output files.
(default='./')
-s, --sample-sheet=STRING Input a csv file describing sample names and
barcode combinations (i7, i5 and i1
barcodes).
(default='sample-sheet.csv')
Optional arguments:
-b, --barcode-corrections=STRING
Outputs a csv file that contains the number of
corrected barcodes
-5, --i5-rc Should be set when the i5 barcode has been
sequenced as reverse complement. Make sure to
enter reverse complement sequences in the
barcode file. (default=off)
-i, --i1-start=INT Start position of the i1 index (1-based) on
read 2.
(default='11')
--i1-read=INT Read in which the i1 index should be corrected
(1 or 2).
(default='2')
-q, --queue-size=INT Queue size for reads that will be processed in
one block.
(default='4000000')
-r, --reading-threads=INT Number of threads used for reading gz files.
Either 1 or 2 (one thread per input file is
used).
(default='2')
-w, --writing-threads=INT Number of threads used for writing gz files.
Default is the number of processor cores.
-p, --processing-threads=INT Number of threads used for processing the error
correction. Default is the number of
processor cores.
-d, --demux-only Do a one on one mapping for the barcodes
specified in the sample sheet. No error
correction will be done. Barcodes that do not
match are written to the undetermined reads
file. (default=off)
-v, --verbose Verbose.
(default=off)

Example commands:

 # demultiplexes read 1 and 2 into the folder 'demux'
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux
# demultiplexing assuming the i1 barcode starts at the first base
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux --i1_start 1
# demultiplexing assuming i5 is present as reverse complement in the fastq header
# if he i5 has been sequenced as reverse complement use this option and provide
# the reverse complement sequences in the sample sheet.
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux

After a successful completed run idemuxCPP will write summary report to the output folder ('demultipexing_stats.tsv').

Technicalities

When you run idemuxCPP the following will happen:

  • It will check if your sample sheet is okay. See here for examples

  • It will check the fastq header for barcodes and expects them in the following format:

    single index (i7 or i5): @NB502007:379:HM7H2BGXF:1:11101:24585:1069 1:N:0:TCAGGTAANNTT
    dual index (i7 and i5): @NB502007:379:HM7H2BGXF:1:11101:24585:1069 1:N:0:TCAGGTAANNTT+NANGGNNCNNNN
    
  • Reads that cannot be demultiplexed will be written to undetermined_R{1/2}.fastq.gz

  • When you demultiplex based on i1 inline barcodes, the a successful recognized barcode sequence will be cut out and removed from read 2. This is a design choice and will leave you with the 10 nt UMI + the nucleotides that potentially follow the i1 barcode (or don't).

This allows you to:

  1. Use other software, such as UMI_tools to deal with the 10nt UMI if desired
  2. To demuliplex lanes where QuantSeq-Pool has been pooled with other libraries and read 2 has been sequenced longer than the actual barcode.

If you sequenced i5 as a reverse complement, make sure to fill in reverse complement barcodes into the sample sheet and to use the --i5-rc parameter.

Help

If you are demuliplexing a large number of samples (more than 500) you might encounter the following error:

  • OSError: [Errno 24] Too many open files

This error occurs because most OS have a limit on how many files can be opened and written to at the ame time. In order to temporarily increase the limit run:

 # multiply your sample number*2 (as data is paired end)
# then round to the next multiple of 1024
ulimit -n the_number_above

If you are looking for a permanent solution you can change your ulimit values this way.

In case you experience any issues with this software please open an issue describing your problem. Make sure to post the version of the tool you are running (-v, --version) and your os.

Sample sheet examples

This is allowed:

 # demultiplexing via full i7, i5, i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
# demultiplexing via full i7, i5 and sparse i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,
# demultiplexing via full i7, i5
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,
# demultiplexing via full i7, no i5 and sparse i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,,AAAACATGCGTT
sample_1,AAAATCCCAGTT,,
# demultiplexing via full i7 only
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,,
sample_1,AAAATCCCAGTT,,
# demultiplexing via full i5 and i1
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,,CCCCTAAACGTT,AAAATCCCAGTT
# demultiplexing via full i5 and sparse i1
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,,CCCCTAAACGTT,
# demultiplexing via full i5
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,
sample_1,,CCCCTAAACGTT,
# demultiplexing via full i1
sample_name,i7,i5,i1
sample_0,,,AAAACATGCGTT
sample_1,,,AAAATCCCAGTT
# mixed indexing (if not ambiguous) (full i7 and sparse i5, i1)
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,,AAAATCCCAGTT
sample_2,GAAAATTTACGC,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,,AAACTAACTGTC
# mixed indexing (if not ambiguous) (no i7, sparse i5 & i1)
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,
sample_1,,,AAAATCCCAGTT
# mixed indexing (if not ambiguous) (sparse i7, full i5 & i1)
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
sample_2,,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,CCCATCCATGTA,AAACTAACTGTC
# additional parameter columns for i1_read and i1_start index (1-based).
sample_name,i7,i5,i1,i1_read,i1_start
sample_0,AANACATGCGTT,,TTTTAG,2,1
sample_1,AANACATGCG,,AAAACATG,2,11
sample_2,AANACA,,CACCCC,1,5

This is not allowed:

 # missing i1 column (or any other)
sample_name,i7,i5,
sample_0,AAAACATGCGTT,CCCCACTGAGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT
# duplicated barcode combination
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
# duplicated sample names
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_0,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
# missing comma separator
sample_name,i7,i5,i1
sample_0,AAAACATGCGTTCCCCACTGAGTT,AAAACATGCGTT
# no barcodes
sample_name,i7,i5,i1
sample_0,,,
# wrong column headers
wrong_col_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT

© Lexogen GmbH, 2020

About

iDemux is an all-in-one command line tool that can be used for both demultiplexing and error correction of FASTQ files. It enables demultiplexing of i1 inline barcodes of Lexogen’s QuantSeq-Pool as well as demultiplexing of i7 and/or i5 indices of any other RNA-Seq library prep. iDemux can also be used for superior error correction of RNA-Seq libr…

Resources

Contributing

Stars

8 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

idemuxCPP - inline barcode demultiplexing

GitHub releaseBuild StatusCondaConda Downloads

idemuxCPP is a command line tool designed to demultiplex paired-end fastq files from QuantSeq-Pool.

idemuxCPP can demultiplex based on i7, i5 and i1 inline barcodes. While this tool can generally be used to demultiplex on any barcodes (as long as they are correctly supplied and in the fastq header), it best performs when used in combination with Lexogen indices, as it will correct common sequencing errors in the sequenced barcodes. This will allow you to retain more reads from your sequencing experiment, while minimizing cross contamination.

idemuxCPP use is permitted under the following licence.

idemuxCPP is a direct translation of the python tool idemux (https://github.com/lexogen-tools/idemux) in order to decrease the runtime. It is 2 times faster than the python version.

General usage:

 idemuxCPP [-h] --r1 READ1 --r2 READ2 [--sample-sheet SAMPLE_SHEET] --out OUTPUT_DIR
[--i1-start I1_START] [--i5-rc] [-v]

Run idemuxCPP:

 idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out /some/output/path --i1-start pos_in_read_2

Features

  • FASTQ file demultiplexing based on i7, i5 or i1 barcodes
  • Correction of barcode sequencing errors to maximize read yield (only works with Lexogen 12 nt UDIs, that have been sequenced at least 8 nt.

Getting started

To get stated with demultiplexing you need to:

  1. Install idemuxCPP
  2. Prepare a sample sheet csv
  3. Run idemuxCPP

1. Installation

dependencies:

  • compiler supporting C++11 standard and OpenMP

  • boost C++ library version >= 1.55.0 (install the development versions of the following libraries (or install all e.g. in Ubuntu via package libboost-all-dev)

    • libboost-filesystem
    • libboost-system
    • libboost-iostreams
    • libboost-test (only required if you want to compile unit tests)
  • zlib (e.g. zlib1g-dev in Ubuntu)

  • gengetopt

Windows 10 64bit binary For windows you do not need to install any dependencies (they are included in the package). Simply download the pre-compiled windows binary from here windows binary. Extract the zip file. To execute the tool press windows+r, enter cmd, cd C:\\location_of_the_extracted_zip_file\bin and execute .\\idemuxCPP

From Source (distribution tar)

To configure, compile and install execute the following commands on your command line:

 ./configure [--help for additional configuration options]
make
make install

From Source (git) The installation from source requires additional tools and libraries:

  • gnulib (autoconf, automake, etc.)

Generate the configure file with:

 autoreconf -i

Then proceed with ./configure and make like in the previous section.

From Linux Package

Debian Ubuntu Fedora
Debian_12

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_11

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_10

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_9.0

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_24.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_23.10

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_23.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_22.10

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_22.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_20.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_18.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_16.04

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Fedora 40

idemuxcpp - 0.3.0 - 64 bit

Fedora 39

idemuxcpp - 0.3.0 - 64 bit

Fedora 38

idemuxcpp - 0.3.0 - 64 bit

Fedora 37

idemuxcpp - 0.3.0 - 64 bit

Fedora 36

idemuxcpp - 0.3.0 - 64 bit

on ubuntu you can install it for example with:

dpkg -i <idemuxcpp*.deb>

idemuxCPP is available via bioconda!

2. Preparing the sample sheet

In order to run idemuxCPP on your QuantSeq-Pool data you first need to prepare a csv file. We call this csv a sample sheet and it specifies which barcodes correspond to each sample.

This is a necessity as the software needs to know into which bins reads should be sorted during demultiplexing. A sample sheet can easily be generated by filling in an excel spreadsheet and exporting it as csv.

Example sample sheet (i7, i5 and i1 demuliplexing):

 sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
sample_2,GAAAATTTACGC,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,CCCATCCATGTA,AAACTAACTGTC

A sample sheet consists of 4 columns and always starts with the header illustrated above. 'Sample_name' values will be used as output file names, while the sequences specified in i7,i5 & i1 will be used for demultiplexing.

Therefore, only specific, unique unambiguous combinations of sample names and barcodes are allowed. This means using duplicated or ambiguous combinations will result in an error. However, idemuxCPP will do its best to tell you where the problem lies, once this happens.

In brief the rules are:

  1. Sample names need to be unique.
  2. Barcode combinations need to be unique.
  3. i7 and/or i5 indices have to be used consistently within the csv file. i7 and/or i5 indices need to be either present for all samples or none at all.
  4. In contrast to i7/i5 indices, i1 indices can be used for a subset of samples in the csv file.
  5. Absence of a barcode needs to be indicated by an empty field (no value between comas ,,).
  6. If your i5 has been sequenced as reverse complement, enter the reverse complement sequences in the sample sheet and use the --i5-rc option! If you are not sure, you can also use the --auto-detect option as alternative.

See below. for more showcases of sample/barcode combinations that are allowed or disallowed.

3. Extract non-demultiplexed read data from a sequencing run

The read input files for idemux are non-demultiplexed read files which you can get by using demultiplexing software to extract reads from a sequencing run without demultiplexing by sample.
You can use any demultiplexing software available to you, but the resulting read file(s) should contain all reads of the sequencing run you want to demultiplex with idemux. Further, the reads should contain the read-out of the i7 + i5 barcode sequences in the read ID.

The following part of this section outlines how to use Illumina's bcl2fastq software to obtain the reads.

Demultiplexing with bcl2fastq:

bcl2fastq -R /path/to/sequencing/run -o /path/to/output -l WARNING --no-lane-splitting --sample-sheet Illumina_EMPTY_SampleSheet.csv --barcode-mismatches 0 --mask-short-adapter-reads 10

This commands bcl2fastq to "demultiplex" the run at /path/to/sequencing/run to the output directory /path/to/output. The content of the file Illumina_EMPTY_SampleSheet.csv has to match Illumina's format for the respective sequencer.

The following text is an example for the content of a SampleSheet for a Illumina Nextseq run:

[Header],,,,,,,
IEMFileVersion,4,,,,,,
Date,30.05.2017,,,,,,
Workflow,GenerateFASTQ,,,,,,
Application,NextSeq FASTQ Only,,,,,,
Assay,TruSeq RNA,,,,,,
Description,,,,,,,
Chemistry,Default,,,,,,
,,,,,,,
[Reads],,,,,,,
,,,,,,,
[Settings],,,,,,,
,,,,,,,
[Data],,,,,,,
Sample_ID,Sample_Name,Sample_Plate,Sample_Well,I7_Index_ID,index,I5_Index_ID,index2,Sample_Project,Description
1,1,,,9999,AAAAAAAAAAAA,9999,AAAAAAAAAAAA,,

As you can see, no settings are specified and only one 'sample' was defined with a squence combination that is not likely to be close to any of the utilized barcode sequences. You have to adjust the length of the A* stretches to the sequenced length of the i7/i5 barcodes! This specification is necessary to command bcl2fastq to write the i7+i5 sequence information in each read in the Undetermined_S0_R1_001.fastq.gz (Undetermined_S0_R2_001.fastq.gz) file(s) The resulting reads in Undetermined_S0_R1_001.fastq.gz (Undetermined_S0_R2_001.fastq.gz) should follow this formatting style:

@NB502007:379:HM7H2BGXF:1:11101:19231:1159 1:N:0:TTAGGACGCAAA+GGGTCTGCCGAA
GCTCATCCATCTTTTTGAAAACTCTTCATACTCGTTAGATCGGAAGAG
+
AAAAAEEEAEEEEEEAEEEEEEEEEEEEEEEEEEEE/E/EEEEE/EEE
@NB502007:379:HM7H2BGXF:1:11101:17406:1159 1:N:0:AAGTAACAGCTT+AATCGTGGACGG
CACACCTCCGTTCACGACGCTCTTCCGATATAGATGTAACTGGAGGAA
+
AAAAAEEEEEAEE/EEEEEEEEEE/EEEEAEA/EEEEEEEEEEEEEEE
@NB502007:379:HM7H2BGXF:1:11101:18203:1159 1:N:0:CTGCCAACACGA+GCTGTGGTTCAT
GACATGTATACAGTCTACGGATGAACGTTTAGATCGGAAGAGCACACG
+
AAAAAEEEEEEEEEEEEEEEEEEEEEEEEEAEEEEEEEEEEEEEEEEE
@NB502007:379:HM7H2BGXF:1:11101:7322:1159 1:N:0:TACATGGCCACT+ATGTTCCAGTGA
CTTGGTCACGCTACTGTACTCCAGCCAGGGCGACAGAGCAAGACCTAT
+
AAAAAEEEEEEEEEEEE/EEEEEEEEAEEEEEAEEEEEEEEEEEAEEE
...

4. Running idemuxCPP

Once you have installed the tool you can run it by typing idemuxCPP in the terminal.

idemuxCPP accepts the following arguments:

 -h, --help Print help and exit
-V, --version Print version and exit
Required arguments:
-1, --r1=STRING Fastq.gz read file 1 (or .fastq file).
(default='')
-2, --r2=STRING Fastq.gz read file 2 (required only in paired
end mode).
(default='')
-o, --out=STRING Where to write the output files.
(default='./')
-s, --sample-sheet=STRING Input a csv file describing sample names and
barcode combinations (i7, i5 and i1
barcodes).
(default='sample-sheet.csv')
Optional arguments:
-b, --barcode-corrections=STRING
Outputs a csv file that contains the number of
corrected barcodes
-5, --i5-rc Should be set when the i5 barcode has been
sequenced as reverse complement. Make sure to
enter reverse complement sequences in the
barcode file. (default=off)
-i, --i1-start=INT Start position of the i1 index (1-based) on
read 2.
(default='11')
--i1-read=INT Read in which the i1 index should be corrected
(1 or 2).
(default='2')
-q, --queue-size=INT Queue size for reads that will be processed in
one block.
(default='4000000')
-r, --reading-threads=INT Number of threads used for reading gz files.
Either 1 or 2 (one thread per input file is
used).
(default='2')
-w, --writing-threads=INT Number of threads used for writing gz files.
Default is the number of processor cores.
-p, --processing-threads=INT Number of threads used for processing the error
correction. Default is the number of
processor cores.
-d, --demux-only Do a one on one mapping for the barcodes
specified in the sample sheet. No error
correction will be done. Barcodes that do not
match are written to the undetermined reads
file. (default=off)
-v, --verbose Verbose.
(default=off)

Example commands:

 # demultiplexes read 1 and 2 into the folder 'demux'
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux
# demultiplexing assuming the i1 barcode starts at the first base
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux --i1_start 1
# demultiplexing assuming i5 is present as reverse complement in the fastq header
# if he i5 has been sequenced as reverse complement use this option and provide
# the reverse complement sequences in the sample sheet.
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux

After a successful completed run idemuxCPP will write summary report to the output folder ('demultipexing_stats.tsv').

Technicalities

When you run idemuxCPP the following will happen:

  • It will check if your sample sheet is okay. See here for examples

  • It will check the fastq header for barcodes and expects them in the following format:

    single index (i7 or i5): @NB502007:379:HM7H2BGXF:1:11101:24585:1069 1:N:0:TCAGGTAANNTT
    dual index (i7 and i5): @NB502007:379:HM7H2BGXF:1:11101:24585:1069 1:N:0:TCAGGTAANNTT+NANGGNNCNNNN
    
  • Reads that cannot be demultiplexed will be written to undetermined_R{1/2}.fastq.gz

  • When you demultiplex based on i1 inline barcodes, the a successful recognized barcode sequence will be cut out and removed from read 2. This is a design choice and will leave you with the 10 nt UMI + the nucleotides that potentially follow the i1 barcode (or don't).

This allows you to:

  1. Use other software, such as UMI_tools to deal with the 10nt UMI if desired
  2. To demuliplex lanes where QuantSeq-Pool has been pooled with other libraries and read 2 has been sequenced longer than the actual barcode.

If you sequenced i5 as a reverse complement, make sure to fill in reverse complement barcodes into the sample sheet and to use the --i5-rc parameter.

Help

If you are demuliplexing a large number of samples (more than 500) you might encounter the following error:

  • OSError: [Errno 24] Too many open files

This error occurs because most OS have a limit on how many files can be opened and written to at the ame time. In order to temporarily increase the limit run:

 # multiply your sample number*2 (as data is paired end)
# then round to the next multiple of 1024
ulimit -n the_number_above

If you are looking for a permanent solution you can change your ulimit values this way.

In case you experience any issues with this software please open an issue describing your problem. Make sure to post the version of the tool you are running (-v, --version) and your os.

Sample sheet examples

This is allowed:

 # demultiplexing via full i7, i5, i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
# demultiplexing via full i7, i5 and sparse i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,
# demultiplexing via full i7, i5
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,
# demultiplexing via full i7, no i5 and sparse i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,,AAAACATGCGTT
sample_1,AAAATCCCAGTT,,
# demultiplexing via full i7 only
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,,
sample_1,AAAATCCCAGTT,,
# demultiplexing via full i5 and i1
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,,CCCCTAAACGTT,AAAATCCCAGTT
# demultiplexing via full i5 and sparse i1
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,,CCCCTAAACGTT,
# demultiplexing via full i5
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,
sample_1,,CCCCTAAACGTT,
# demultiplexing via full i1
sample_name,i7,i5,i1
sample_0,,,AAAACATGCGTT
sample_1,,,AAAATCCCAGTT
# mixed indexing (if not ambiguous) (full i7 and sparse i5, i1)
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,,AAAATCCCAGTT
sample_2,GAAAATTTACGC,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,,AAACTAACTGTC
# mixed indexing (if not ambiguous) (no i7, sparse i5 & i1)
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,
sample_1,,,AAAATCCCAGTT
# mixed indexing (if not ambiguous) (sparse i7, full i5 & i1)
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
sample_2,,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,CCCATCCATGTA,AAACTAACTGTC
# additional parameter columns for i1_read and i1_start index (1-based).
sample_name,i7,i5,i1,i1_read,i1_start
sample_0,AANACATGCGTT,,TTTTAG,2,1
sample_1,AANACATGCG,,AAAACATG,2,11
sample_2,AANACA,,CACCCC,1,5

This is not allowed:

 # missing i1 column (or any other)
sample_name,i7,i5,
sample_0,AAAACATGCGTT,CCCCACTGAGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT
# duplicated barcode combination
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
# duplicated sample names
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_0,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
# missing comma separator
sample_name,i7,i5,i1
sample_0,AAAACATGCGTTCCCCACTGAGTT,AAAACATGCGTT
# no barcodes
sample_name,i7,i5,i1
sample_0,,,
# wrong column headers
wrong_col_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT

© Lexogen GmbH, 2020

About

iDemux is an all-in-one command line tool that can be used for both demultiplexing and error correction of FASTQ files. It enables demultiplexing of i1 inline barcodes of Lexogen’s QuantSeq-Pool as well as demultiplexing of i7 and/or i5 indices of any other RNA-Seq library prep. iDemux can also be used for superior error correction of RNA-Seq libr…

Resources

Contributing

Stars

8 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

idemuxCPP - inline barcode demultiplexing

GitHub releaseBuild StatusCondaConda Downloads

idemuxCPP is a command line tool designed to demultiplex paired-end fastq files from QuantSeq-Pool.

idemuxCPP can demultiplex based on i7, i5 and i1 inline barcodes. While this tool can generally be used to demultiplex on any barcodes (as long as they are correctly supplied and in the fastq header), it best performs when used in combination with Lexogen indices, as it will correct common sequencing errors in the sequenced barcodes. This will allow you to retain more reads from your sequencing experiment, while minimizing cross contamination.

idemuxCPP use is permitted under the following licence.

idemuxCPP is a direct translation of the python tool idemux (https://github.com/lexogen-tools/idemux) in order to decrease the runtime. It is 2 times faster than the python version.

General usage:

 idemuxCPP [-h] --r1 READ1 --r2 READ2 [--sample-sheet SAMPLE_SHEET] --out OUTPUT_DIR
[--i1-start I1_START] [--i5-rc] [-v]

Run idemuxCPP:

 idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out /some/output/path --i1-start pos_in_read_2

Features

  • FASTQ file demultiplexing based on i7, i5 or i1 barcodes
  • Correction of barcode sequencing errors to maximize read yield (only works with Lexogen 12 nt UDIs, that have been sequenced at least 8 nt.

Getting started

To get stated with demultiplexing you need to:

  1. Install idemuxCPP
  2. Prepare a sample sheet csv
  3. Run idemuxCPP

1. Installation

dependencies:

  • compiler supporting C++11 standard and OpenMP

  • boost C++ library version >= 1.55.0 (install the development versions of the following libraries (or install all e.g. in Ubuntu via package libboost-all-dev)

    • libboost-filesystem
    • libboost-system
    • libboost-iostreams
    • libboost-test (only required if you want to compile unit tests)
  • zlib (e.g. zlib1g-dev in Ubuntu)

  • gengetopt

Windows 10 64bit binary For windows you do not need to install any dependencies (they are included in the package). Simply download the pre-compiled windows binary from here windows binary. Extract the zip file. To execute the tool press windows+r, enter cmd, cd C:\\location_of_the_extracted_zip_file\bin and execute .\\idemuxCPP

From Source (distribution tar)

To configure, compile and install execute the following commands on your command line:

 ./configure [--help for additional configuration options]
make
make install

From Source (git) The installation from source requires additional tools and libraries:

  • gnulib (autoconf, automake, etc.)

Generate the configure file with:

 autoreconf -i

Then proceed with ./configure and make like in the previous section.

From Linux Package

Debian Ubuntu Fedora
Debian_12

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_11

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_10

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Debian_9.0

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_24.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_23.10

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_23.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_22.10

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_22.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_20.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_18.04

idemuxcpp - 0.3.0 - 64 bit

xUbuntu_16.04

idemuxcpp - 0.3.0 - 32 bit

idemuxcpp - 0.3.0 - 64 bit

Fedora 40

idemuxcpp - 0.3.0 - 64 bit

Fedora 39

idemuxcpp - 0.3.0 - 64 bit

Fedora 38

idemuxcpp - 0.3.0 - 64 bit

Fedora 37

idemuxcpp - 0.3.0 - 64 bit

Fedora 36

idemuxcpp - 0.3.0 - 64 bit

on ubuntu you can install it for example with:

dpkg -i <idemuxcpp*.deb>

idemuxCPP is available via bioconda!

2. Preparing the sample sheet

In order to run idemuxCPP on your QuantSeq-Pool data you first need to prepare a csv file. We call this csv a sample sheet and it specifies which barcodes correspond to each sample.

This is a necessity as the software needs to know into which bins reads should be sorted during demultiplexing. A sample sheet can easily be generated by filling in an excel spreadsheet and exporting it as csv.

Example sample sheet (i7, i5 and i1 demuliplexing):

 sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
sample_2,GAAAATTTACGC,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,CCCATCCATGTA,AAACTAACTGTC

A sample sheet consists of 4 columns and always starts with the header illustrated above. 'Sample_name' values will be used as output file names, while the sequences specified in i7,i5 & i1 will be used for demultiplexing.

Therefore, only specific, unique unambiguous combinations of sample names and barcodes are allowed. This means using duplicated or ambiguous combinations will result in an error. However, idemuxCPP will do its best to tell you where the problem lies, once this happens.

In brief the rules are:

  1. Sample names need to be unique.
  2. Barcode combinations need to be unique.
  3. i7 and/or i5 indices have to be used consistently within the csv file. i7 and/or i5 indices need to be either present for all samples or none at all.
  4. In contrast to i7/i5 indices, i1 indices can be used for a subset of samples in the csv file.
  5. Absence of a barcode needs to be indicated by an empty field (no value between comas ,,).
  6. If your i5 has been sequenced as reverse complement, enter the reverse complement sequences in the sample sheet and use the --i5-rc option! If you are not sure, you can also use the --auto-detect option as alternative.

See below. for more showcases of sample/barcode combinations that are allowed or disallowed.

3. Extract non-demultiplexed read data from a sequencing run

The read input files for idemux are non-demultiplexed read files which you can get by using demultiplexing software to extract reads from a sequencing run without demultiplexing by sample.
You can use any demultiplexing software available to you, but the resulting read file(s) should contain all reads of the sequencing run you want to demultiplex with idemux. Further, the reads should contain the read-out of the i7 + i5 barcode sequences in the read ID.

The following part of this section outlines how to use Illumina's bcl2fastq software to obtain the reads.

Demultiplexing with bcl2fastq:

bcl2fastq -R /path/to/sequencing/run -o /path/to/output -l WARNING --no-lane-splitting --sample-sheet Illumina_EMPTY_SampleSheet.csv --barcode-mismatches 0 --mask-short-adapter-reads 10

This commands bcl2fastq to "demultiplex" the run at /path/to/sequencing/run to the output directory /path/to/output. The content of the file Illumina_EMPTY_SampleSheet.csv has to match Illumina's format for the respective sequencer.

The following text is an example for the content of a SampleSheet for a Illumina Nextseq run:

[Header],,,,,,,
IEMFileVersion,4,,,,,,
Date,30.05.2017,,,,,,
Workflow,GenerateFASTQ,,,,,,
Application,NextSeq FASTQ Only,,,,,,
Assay,TruSeq RNA,,,,,,
Description,,,,,,,
Chemistry,Default,,,,,,
,,,,,,,
[Reads],,,,,,,
,,,,,,,
[Settings],,,,,,,
,,,,,,,
[Data],,,,,,,
Sample_ID,Sample_Name,Sample_Plate,Sample_Well,I7_Index_ID,index,I5_Index_ID,index2,Sample_Project,Description
1,1,,,9999,AAAAAAAAAAAA,9999,AAAAAAAAAAAA,,

As you can see, no settings are specified and only one 'sample' was defined with a squence combination that is not likely to be close to any of the utilized barcode sequences. You have to adjust the length of the A* stretches to the sequenced length of the i7/i5 barcodes! This specification is necessary to command bcl2fastq to write the i7+i5 sequence information in each read in the Undetermined_S0_R1_001.fastq.gz (Undetermined_S0_R2_001.fastq.gz) file(s) The resulting reads in Undetermined_S0_R1_001.fastq.gz (Undetermined_S0_R2_001.fastq.gz) should follow this formatting style:

@NB502007:379:HM7H2BGXF:1:11101:19231:1159 1:N:0:TTAGGACGCAAA+GGGTCTGCCGAA
GCTCATCCATCTTTTTGAAAACTCTTCATACTCGTTAGATCGGAAGAG
+
AAAAAEEEAEEEEEEAEEEEEEEEEEEEEEEEEEEE/E/EEEEE/EEE
@NB502007:379:HM7H2BGXF:1:11101:17406:1159 1:N:0:AAGTAACAGCTT+AATCGTGGACGG
CACACCTCCGTTCACGACGCTCTTCCGATATAGATGTAACTGGAGGAA
+
AAAAAEEEEEAEE/EEEEEEEEEE/EEEEAEA/EEEEEEEEEEEEEEE
@NB502007:379:HM7H2BGXF:1:11101:18203:1159 1:N:0:CTGCCAACACGA+GCTGTGGTTCAT
GACATGTATACAGTCTACGGATGAACGTTTAGATCGGAAGAGCACACG
+
AAAAAEEEEEEEEEEEEEEEEEEEEEEEEEAEEEEEEEEEEEEEEEEE
@NB502007:379:HM7H2BGXF:1:11101:7322:1159 1:N:0:TACATGGCCACT+ATGTTCCAGTGA
CTTGGTCACGCTACTGTACTCCAGCCAGGGCGACAGAGCAAGACCTAT
+
AAAAAEEEEEEEEEEEE/EEEEEEEEAEEEEEAEEEEEEEEEEEAEEE
...

4. Running idemuxCPP

Once you have installed the tool you can run it by typing idemuxCPP in the terminal.

idemuxCPP accepts the following arguments:

 -h, --help Print help and exit
-V, --version Print version and exit
Required arguments:
-1, --r1=STRING Fastq.gz read file 1 (or .fastq file).
(default='')
-2, --r2=STRING Fastq.gz read file 2 (required only in paired
end mode).
(default='')
-o, --out=STRING Where to write the output files.
(default='./')
-s, --sample-sheet=STRING Input a csv file describing sample names and
barcode combinations (i7, i5 and i1
barcodes).
(default='sample-sheet.csv')
Optional arguments:
-b, --barcode-corrections=STRING
Outputs a csv file that contains the number of
corrected barcodes
-5, --i5-rc Should be set when the i5 barcode has been
sequenced as reverse complement. Make sure to
enter reverse complement sequences in the
barcode file. (default=off)
-i, --i1-start=INT Start position of the i1 index (1-based) on
read 2.
(default='11')
--i1-read=INT Read in which the i1 index should be corrected
(1 or 2).
(default='2')
-q, --queue-size=INT Queue size for reads that will be processed in
one block.
(default='4000000')
-r, --reading-threads=INT Number of threads used for reading gz files.
Either 1 or 2 (one thread per input file is
used).
(default='2')
-w, --writing-threads=INT Number of threads used for writing gz files.
Default is the number of processor cores.
-p, --processing-threads=INT Number of threads used for processing the error
correction. Default is the number of
processor cores.
-d, --demux-only Do a one on one mapping for the barcodes
specified in the sample sheet. No error
correction will be done. Barcodes that do not
match are written to the undetermined reads
file. (default=off)
-v, --verbose Verbose.
(default=off)

Example commands:

 # demultiplexes read 1 and 2 into the folder 'demux'
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux
# demultiplexing assuming the i1 barcode starts at the first base
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux --i1_start 1
# demultiplexing assuming i5 is present as reverse complement in the fastq header
# if he i5 has been sequenced as reverse complement use this option and provide
# the reverse complement sequences in the sample sheet.
idemuxCPP --r1 read_1.fastq.gz --r2 read_2.fastq.gz --sample-sheet samples.csv --out demux

After a successful completed run idemuxCPP will write summary report to the output folder ('demultipexing_stats.tsv').

Technicalities

When you run idemuxCPP the following will happen:

  • It will check if your sample sheet is okay. See here for examples

  • It will check the fastq header for barcodes and expects them in the following format:

    single index (i7 or i5): @NB502007:379:HM7H2BGXF:1:11101:24585:1069 1:N:0:TCAGGTAANNTT
    dual index (i7 and i5): @NB502007:379:HM7H2BGXF:1:11101:24585:1069 1:N:0:TCAGGTAANNTT+NANGGNNCNNNN
    
  • Reads that cannot be demultiplexed will be written to undetermined_R{1/2}.fastq.gz

  • When you demultiplex based on i1 inline barcodes, the a successful recognized barcode sequence will be cut out and removed from read 2. This is a design choice and will leave you with the 10 nt UMI + the nucleotides that potentially follow the i1 barcode (or don't).

This allows you to:

  1. Use other software, such as UMI_tools to deal with the 10nt UMI if desired
  2. To demuliplex lanes where QuantSeq-Pool has been pooled with other libraries and read 2 has been sequenced longer than the actual barcode.

If you sequenced i5 as a reverse complement, make sure to fill in reverse complement barcodes into the sample sheet and to use the --i5-rc parameter.

Help

If you are demuliplexing a large number of samples (more than 500) you might encounter the following error:

  • OSError: [Errno 24] Too many open files

This error occurs because most OS have a limit on how many files can be opened and written to at the ame time. In order to temporarily increase the limit run:

 # multiply your sample number*2 (as data is paired end)
# then round to the next multiple of 1024
ulimit -n the_number_above

If you are looking for a permanent solution you can change your ulimit values this way.

In case you experience any issues with this software please open an issue describing your problem. Make sure to post the version of the tool you are running (-v, --version) and your os.

Sample sheet examples

This is allowed:

 # demultiplexing via full i7, i5, i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
# demultiplexing via full i7, i5 and sparse i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,
# demultiplexing via full i7, i5
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,
# demultiplexing via full i7, no i5 and sparse i1
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,,AAAACATGCGTT
sample_1,AAAATCCCAGTT,,
# demultiplexing via full i7 only
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,,
sample_1,AAAATCCCAGTT,,
# demultiplexing via full i5 and i1
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,,CCCCTAAACGTT,AAAATCCCAGTT
# demultiplexing via full i5 and sparse i1
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,,CCCCTAAACGTT,
# demultiplexing via full i5
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,
sample_1,,CCCCTAAACGTT,
# demultiplexing via full i1
sample_name,i7,i5,i1
sample_0,,,AAAACATGCGTT
sample_1,,,AAAATCCCAGTT
# mixed indexing (if not ambiguous) (full i7 and sparse i5, i1)
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,,AAAATCCCAGTT
sample_2,GAAAATTTACGC,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,,AAACTAACTGTC
# mixed indexing (if not ambiguous) (no i7, sparse i5 & i1)
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,
sample_1,,,AAAATCCCAGTT
# mixed indexing (if not ambiguous) (sparse i7, full i5 & i1)
sample_name,i7,i5,i1
sample_0,,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
sample_2,,GCCCCTTTCAGA,GAAAATTTACGC
sample_3,AAACTAACTGTC,CCCATCCATGTA,AAACTAACTGTC
# additional parameter columns for i1_read and i1_start index (1-based).
sample_name,i7,i5,i1,i1_read,i1_start
sample_0,AANACATGCGTT,,TTTTAG,2,1
sample_1,AANACATGCG,,AAAACATG,2,11
sample_2,AANACA,,CACCCC,1,5

This is not allowed:

 # missing i1 column (or any other)
sample_name,i7,i5,
sample_0,AAAACATGCGTT,CCCCACTGAGTT
sample_1,AAAATCCCAGTT,CCCCTAAACGTT
# duplicated barcode combination
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_1,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
# duplicated sample names
sample_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT
sample_0,AAAATCCCAGTT,CCCCTAAACGTT,AAAATCCCAGTT
# missing comma separator
sample_name,i7,i5,i1
sample_0,AAAACATGCGTTCCCCACTGAGTT,AAAACATGCGTT
# no barcodes
sample_name,i7,i5,i1
sample_0,,,
# wrong column headers
wrong_col_name,i7,i5,i1
sample_0,AAAACATGCGTT,CCCCACTGAGTT,AAAACATGCGTT

© Lexogen GmbH, 2020

About

iDemux is an all-in-one command line tool that can be used for both demultiplexing and error correction of FASTQ files. It enables demultiplexing of i1 inline barcodes of Lexogen’s QuantSeq-Pool as well as demultiplexing of i7 and/or i5 indices of any other RNA-Seq library prep. iDemux can also be used for superior error correction of RNA-Seq libr…

Resources

Contributing

Stars

8 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages