Demuxing golay barcodes?

Hi @thermokarst ,

I am getting the same error as @yipinto, but I’m pretty sure my barcodes are golay encoded. I am using the paired end EMP primers as described in Walters et. al: Improved Bacterial 16S rRNA Gene (V4 and V4-5) and Fungal Internal Transcribed Spacer Marker Gene Primers for Microbial Community Surveys, specifically the V4-V5 515f/926r primers . My understanding was that these are golay encoded. Here quoting from the table S1 description: "All Golay barcoded 515f/806r, 515f/926r, and ITS PCR primer and sequencing constructs. "

From the methods section “Modifications to PCR and sequencing primers”, they state: “We first modified the 515f/806r PCR primer construct by bar coding the forward primer, rather than the reverse primer, with 960 unique, 12-base Golay bar codes…” Is it possible that qiime is thrown off because the barcodes are on the forward instead of reverse primers? If so I would find that surprising though, because these primers are recommended by EMP (

Thanks for your help troubleshooting this new feature!


Hi @rrohwer - can you please provide the complete command you ran, the complete error observed, and the version of QIIME 2 you are using? If you want to share any data, too, that could be useful (just send a download link in a DM to me). Thanks! :t_rex:

Hi @rrohwer,
I solved the problem by reverse complement the barcodes in the fastq and in the mapping file by using the flags --p-rev-comp-barcodes and --p-rev-comp-mapping-barcodes.
hope it might help…

1 Like

Sorry, I thought since I replied to a post of the same problem the original would stay visible! Here are the commands (qiime 2019.4):

# demux fails with golay correction, says barcode format incorrect
$ qiime demux emp-paired --i-seqs data.qza --m-barcodes-file barcodes.txt --m-barcodes-column BarcodeSequence --o-per-sample-sequences data_golay.qza --p-golay-error-correction --o-error-correction-details data_golay_errors
Plugin error from demux:

  No sequences were mapped to samples. Check that your barcodes are in the correct orientation (see the rev_comp_barcodes and/or rev_comp_mapping_barcodes options).

Debug info has been saved to /var/folders/mc/k9h2668x21vd_3ppxrkb5z7h0000gn/T/qiime2-q2cli-err-kb3japle.log

# demux works without golay correction, no change to barcode format:
$ qiime demux emp-paired --i-seqs data.qza --m-barcodes-file barcodes.txt --m-barcodes-column BarcodeSequence --o-per-sample-sequences data_nogolay.qza --p-no-golay-error-correction --o-error-correction-details data_nogolay_errors
Saved SampleData[PairedEndSequencesWithQuality] to: data_nogolay.qza
Saved ErrorCorrectionDetails to: data_nogolay_errors.qza


No worries, I split the topic off just to make sure we kept the convos straight (also, I like to be extra sure, sometimes there are subtle differences, better to be confident!).

Any chance you need to reverse complement your barcodes and/or barcodes sequences? Check the --help text for param names and usage. My guess is you need to RC both.

The suggestion to add --p-rev-comp-barcodes --p-rev-comp-mapping-barcodes to the command worked!

$ qiime demux emp-paired --i-seqs data.qza --m-barcodes-file barcodes.txt --m-barcodes-column BarcodeSequence --o-per-sample-sequences data_golay.qza --p-golay-error-correction --o-error-correction-details data_golay_errors --p-rev-comp-barcodes --p-rev-comp-mapping-barcodes
Saved SampleData[PairedEndSequencesWithQuality] to: p1_golay.qza
Saved ErrorCorrectionDetails to: p1_golay_errors.qza

But now a follow-up question:

Why didn’t I need to use the reverse compliments to demultiplex before, when I wasn’t using golay error correction?


Woohoo! :champagne:

Because for non-Golay barcodes, the orientation doesn’t matter, so long as the mapping barcodes are in the same orientation as the barcode sequences. The computer literally does a line-by-line check for equality: is AAAC equal to AAAG? No, then this sequence isn’t from Sample 1. With Golay error correction, the orientation matters 100% — the barcode sequences and the mapping sequence both need to be in the 5′ -> 3′ orientation in order for 1) the error correction to work at all, and 2) to match the mapping barcode to the corrected barcode sequence.

Hope that helps! :qiime2: :t_rex:


This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.