# Barcode Errors Impair Demultiplexing with Cutadapt?

**URL:** https://forum.qiime2.org/t/barcode-errors-impair-demultiplexing-with-cutadapt/20336
**Category:** User Support
**Tags:** demux, cutadapt
**Created:** [July 29, 2021, 4:41pm UTC](https://forum.qiime2.org/t/barcode-errors-impair-demultiplexing-with-cutadapt/20336 "2021-07-29T16:41:14Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Stephan\_Bitterwolf](https://forum.qiime2.org/user_avatar/forum.qiime2.org/stephan_bitterwolf/32/8804_2.png) [@Stephan\_Bitterwolf](https://forum.qiime2.org/u/Stephan_Bitterwolf)
#### Post date: [July 29, 2021, 4:41pm UTC](https://forum.qiime2.org/t/barcode-errors-impair-demultiplexing-with-cutadapt/20336/1 "2021-07-29T16:41:14Z")

</div>

I hope this question can help others working with paired-end sequences that have forward.fastq.gz, reverse.fastq.gz, and a metadata table containing a column with barcodes. My main problem is that the cutadapt demultiplexing identifies very sequences per sample. I believe this is due to a barcode issue.

My methods:  
To **import the data** into qiime2 I followed this [qiime2 tutorial](https://docs.qiime2.org/2021.4/tutorials/importing/#multiplexed-paired-end-fastq-with-barcodes-in-sequence).

```
qiime tools import \
  --type MultiplexedPairedEndBarcodeInSequence \
  --input-path sequences \
  --output-path multiplexed-seqs.qza

```

To **demultiplex the data** I used the cutadapt command:

```
qiime cutadapt demux-paired \
--i-seqs multiplexed-seqs.qza \
--m-forward-barcodes-file metadata.tsv \
--m-forward-barcodes-column barcode-sequence \
--p-error-rate 0.1 \
--output-dir demultiplexed_data

```

To **summarize the data** I followed the basic code:

```
qiime demux summarize \
--i-data demultiplexed_data/per_sample_sequences.qza \
--o-visualization demultiplexed_data.qzv

```

**The problem** I encountered was that almost no reads were found for some samples.

 ![image](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/2X/b/b1b2bab8972416e5ba4c050e9e06f61b3f388370.png)

I **used a simple grep search** of the unzipped forward reads (`gunzip forward.fastq.gz`) and found that there were _a lot_ of errors in the barcodes themselves. For example, all barcodes started with "TAAGGCGA" followed by 8 unique nucleotides. I used the grep command `grep -o TAAGGCGA........ forward.fastq | sort | uniq` and identified 163 unique variations of the barcodes. **None** of these extracted barcodes exactly **matched the barcodes I supplied** in my metadata.tsv file.

I **increased the number of sequences identified** for each sample by allowing _more errors_ in the barcode matching with the following command:

```
qiime cutadapt demux-paired \
--i-seqs multiplexed-seqs.qza \
--m-forward-barcodes-file metadata.tsv \
--m-forward-barcodes-column barcode-sequence \
**--p-error-rate 0.2** \
--output-dir demultiplexed_data_error.2

```

This identified more sequences. However, I am left feeling unsure about the demultiplexing process.

 ![image](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/2X/7/79aed2368ca4533022e68b0c96207ff763ca7c4d.png)

**Questions** :  
Am I right in assuming that my main issue stems from the barcodes?  
Is it normal to not have a perfect match for the barcodes?  
Or is this user error?

I am using qiime2-2021.4, on a windows 10 computer using the windows subsystem for Linux. I have used this computer to analyze microbiome data previously so I don't think it is my hardware.

Thank you for your time and support.

---

<div class="post-metadata">

### Author: ![lizgehret](https://forum.qiime2.org/user_avatar/forum.qiime2.org/lizgehret/32/17128_2.png) [@lizgehret](https://forum.qiime2.org/u/lizgehret)
#### Post date: [August 2, 2021, 7:24pm UTC](https://forum.qiime2.org/t/barcode-errors-impair-demultiplexing-with-cutadapt/20336/2 "2021-08-02T19:24:35Z")

</div>

Hi @Stephan_Bitterwolf, thanks for reaching out!

Based on the test you ran by increasing the error rate, my assumption here would be that the main issue is caused by your barcodes - but I will tag a couple of folks on this to see what additional insight we can provide here. Thanks for your patience!

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [August 3, 2021, 2:33pm UTC](https://forum.qiime2.org/t/barcode-errors-impair-demultiplexing-with-cutadapt/20336/5 "2021-08-03T14:33:02Z")

</div>



---

<div class="post-metadata">

### Author: ![lizgehret](https://forum.qiime2.org/user_avatar/forum.qiime2.org/lizgehret/32/17128_2.png) [@lizgehret](https://forum.qiime2.org/u/lizgehret)
#### Post date: [August 4, 2021, 12:17am UTC](https://forum.qiime2.org/t/barcode-errors-impair-demultiplexing-with-cutadapt/20336/6 "2021-08-04T00:17:27Z")

</div>

Hi @Stephan_Bitterwolf,

Thanks again for your patience! Here are some thoughts on this:

It's hard to tell exactly what the issue is here without knowing the full set up of your experiments or looking at the raw reads/barcodes, but the most likely culprits are:

- The presence of other non-biological nts before your barcodes (which you have already said you noticed). You can add those to the barcode columns so they match exactly.
- Your barcodes may be in some other orientation - try checking whether the complement, or reverse complement of the barcodes match anything in the reads.
- The reads may be in mixed orientation, which _might_ be workable with the ` --p-mixed-orientation` parameter.

Overall though, we wouldn't recommend messing with increasing the error-rate; that starts to enter some shaky territory. q2-demux does support error correction but it is designed for 12nt Golay, not 8 nt Hamming. For 8nt correction you'll have to work with something outside of QIIME 2. QIIME 1 [split\_libraries.py](http://qiime.org/scripts/split_libraries.html) should be able to handle that, which may be a good next step for you to look into.

Hope this helps!

Cheers,  
Liz

---

<div class="post-metadata">

### Author: ![lizgehret](https://forum.qiime2.org/user_avatar/forum.qiime2.org/lizgehret/32/17128_2.png) [@lizgehret](https://forum.qiime2.org/u/lizgehret)
#### Post date: [August 4, 2021, 12:17am UTC](https://forum.qiime2.org/t/barcode-errors-impair-demultiplexing-with-cutadapt/20336/7 "2021-08-04T00:17:31Z")

</div>



---

<div class="post-metadata">

### Author: ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)
#### Post date: [September 4, 2021, 6:17am UTC](https://forum.qiime2.org/t/barcode-errors-impair-demultiplexing-with-cutadapt/20336/8 "2021-09-04T06:17:40Z")

</div>

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