# Cannot demultiplex fastq files with barcodes in the header

**URL:** <https://forum.mothur.org/t/cannot-demultiplex-fastq-files-with-barcodes-in-the-header/20748>\
**Category:** Commands in mothur\
**Created:** [November 3, 2020, 4:17pm UTC](https://forum.mothur.org/t/cannot-demultiplex-fastq-files-with-barcodes-in-the-header/20748 "2020-11-03T16:17:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sci\_evol](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Sci\_evol](https://forum.mothur.org/u/Sci_evol)\
**Post date:** [November 3, 2020, 4:17pm UTC](https://forum.mothur.org/t/cannot-demultiplex-fastq-files-with-barcodes-in-the-header/20748/1 "2020-11-03T16:17:46Z")

</div>

Dear mothur team,

I am trying to demultiplex the seq files of a MiSeq run, which have forward.fastq, reverse.fastq and one index.fastq.

**example lines from the forward.fastq:**  
@MISEQ:192:000000000-A88BF:1:1101:14475:1417 1:N:0:CCCTCTTTTTTC  
TCCTTCTTCTCCTCTCTTTCTCCTTCTTTCTTTTTTTTCCCTTTCTCTTCTTCTTTTTTTTCCTTCCTTTTTTCCCTTTTTCTTCTCCCCCTTTCCCTTTCCTTTTCTCCTTTTTTTCTTTCTTTCCTTTTCTTTCTTCTTCCTTCCTTTTTTCTCTTTTCCCTTCTTCTCTCTCCCTCCTTCCTCCTCTTTCTCCTTCCTCTTCCTTTCCTTCCCCTTCCTCTTCTTCTCTCCCTCTTTTTTCTCCCCCC

**example lines from the reverse.fastq:**  
@MISEQ:192:000000000-A88BF:1:1101:16318:1652 1:N:0:CACGCCATAATG  
TCCTTCTTCTCCTCTCTTTCTCCTTCTTTCTTTTTTTTCCCTTTCTCTTCTTCTTTTTTTTCCTTCTTTTTTTCCCTTTTTCTTCTCCCCCTTTTCCCTTCTTTTCGTCCTTGTTTCCTTTCTTTCGCTCTATTTCTTCTTCCTTCCTTTTTTCTCTTTTCCCTTCTTCGCTCTCCCGCCGCACTCCACTTTCTCCTGCCTCTTCCTCCCCTTCCCCTTCCTCTTCTTCTCTCCCTTTTTTTTCTCCCCCC

**example lines from the index.fastq:**  
@MISEQ:192:000000000-A88BF:1:1101:14475:1417 1:N:0:CCCTCTTTTTTC  
CCCTCTTTTTTC  
+  
AAAAAAAAAAAA  
@MISEQ:192:000000000-A88BF:1:1101:15818:1635 1:N:0:CTCCCCTCCTCT  
CTCCCCTCCTCT

However, I couldn’t figure out how I should demultiplex this kind of data. Would you please help me with this?

Thank you very much for your help.

---

<div class="post-metadata">

**Author:** ![pschloss](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/pschloss/32/4_2.png) [@pschloss](https://forum.mothur.org/u/pschloss)\
**Post date:** [November 3, 2020, 5:46pm UTC](https://forum.mothur.org/t/cannot-demultiplex-fastq-files-with-barcodes-in-the-header/20748/2 "2020-11-03T17:46:47Z")

</div>

Hi there -

In [`make.contigs`](https://mothur.org/wiki/make.contigs/#findex--rindex) you will use `ffastq`, `rfastq`, and `findex` (or `rindex`). You’ll also need to provide an oligos file to tell `make.contigs` which index goes with each sample. Take a look at the wiki page, see if you can figure it out. If not, come on back and let us know how far you got so we can help with the next steps.

Thanks,  
Pat

---

<div class="post-metadata">

**Author:** ![Sci\_evol](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Sci\_evol](https://forum.mothur.org/u/Sci_evol)\
**Post date:** [November 11, 2020, 9:11pm UTC](https://forum.mothur.org/t/cannot-demultiplex-fastq-files-with-barcodes-in-the-header/20748/3 "2020-11-11T21:11:20Z")

</div>

Dear Pat,

Thank you very much for your reply. I am trying since then. However I am having an error with the **following command** :

make.contigs(ffastq=fwd.1.fq, rfastq=rev.2.fq,findex=index.mid.fq, rindex=index.mid.fq, oligos=oligos.txt, bdiffs=2, pdiffs=2,processors=12)

**My oligos file looks like:**  
forward ACACGTCTGAACTCCAGTCAC f\_pr  
reverse GTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT r\_pr  
barcode TATCGTTGACCA TATCGTTGACCA Sample1  
barcode CCAGTGTATGCA CCAGTGTATGCA Sample2  
barcode TGAGTCACTGGT TGAGTCACTGGT Sample3  
barcode ACACCTGGTGAT ACACCTGGTGAT Sample4

**A part from the error message:**

[WARNING]: R\_PR is not recognized as a valid type. Choices are forward, reverse, and barcode. Ignoring BARCODE.  
[WARNING]: TATCGTTGACCA is not recognized as a valid type. Choices are forward, reverse, and barcode. Ignoring TATCGTTGACCA.  
[WARNING]: Sample1 is not recognized as a valid type. Choices are forward, reverse, and barcode. Ignoring BARCODE.

Any idea?  
Many thanks.

---

<div class="post-metadata">

**Author:** ![westcott](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/westcott/32/18_2.png) [@westcott](https://forum.mothur.org/u/westcott)\
**Post date:** [November 16, 2020, 1:15pm UTC](https://forum.mothur.org/t/cannot-demultiplex-fastq-files-with-barcodes-in-the-header/20748/4 "2020-11-16T13:15:02Z")

</div>

Mothur does not allow reverse primers to have names. [https://mothur.org/wiki/oligos\_file/](https://mothur.org/wiki/oligos_file/) Your reverse primer has a name of r\_pr, which is causing the read of the oligos file to fail. Try this instead:

**My oligos file looks like:**  
primer ACACGTCTGAACTCCAGTCAC GTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT desiredPrimerName  
barcode TATCGTTGACCA TATCGTTGACCA Sample1  
barcode CCAGTGTATGCA CCAGTGTATGCA Sample2  
barcode TGAGTCACTGGT TGAGTCACTGGT Sample3  
barcode ACACCTGGTGAT ACACCTGGTGAT Sample4

Also, I noticed the forward and reverse index files have the same name. The forward index file should contain the forward barcodes, and the reverse index file should contain the reverse barcodes.

make.contigs(ffastq=fwd.1.fq, rfastq=rev.2.fq,findex= **index.mid.fq** , rindex= **index.mid.fq** , oligos=oligos.txt, bdiffs=2, pdiffs=2,processors=12)

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/system/32/2_2.png) [@system](https://forum.mothur.org/u/system)\
**Post date:** [November 26, 2020, 1:15pm UTC](https://forum.mothur.org/t/cannot-demultiplex-fastq-files-with-barcodes-in-the-header/20748/5 "2020-11-26T13:15:08Z")

</div>

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