Demultiplexing with 4 Fastq files R1 , R2, I1, I2and how toconstruct mapping file with dual barcodes



I have 4 fastq files (Read1, Read2, Index1, Index2). I am new to QIIME and I would like to know how to import data and construct the mapping file with dual barcode and proceed to demultiplexing in QIIME2.

Thank you for the help in advance.

(Matthew Ryan Dillon) #2

Hi @ramasravani - unfortunately we don’t have built-in support for demultiplexing dual-index reads. You will need to demux outside of QIIME 2, then import the demuxed reads.



Thank you for your response. With certain posts on the forum, [Importing and Demultiplex process for 4 Fastq Files: R1, R2, Index1 and Index2]) I understood it is possible with the previous version QIIME1. But I am stuck at the construction of mapping file step with dual barcodes.Could you please let me know how to construct the mapping file with both barcode sequences.
Also, may I know the best pipeline to demux these files other than qiime.

Thanking you,

(Matthew Ryan Dillon) #4

We aren’t able to provide support for QIIME 1 here, you could try the QIIME 1 forum, but that isn’t officially staffed anymore. I think there might be a few posts floating around here on the forum with some hints.



I have demultiplexed the files with dual reads outside qiime. I would like to know how to import them to qiime for performing next steps like OTU picking.
There are few fasta files generated for each sample along with trim.contigs.quality file.

Thanking you for the help,

(Mehrbod Estaki) #6

Hi @ramasravani,

Qiime2 doesn’t currently have a way of importing fasta + qual files since this is a bit of an older method, often seen with 454. If you can re-demultiplex your data without separating the quality scores then your life would be very simple in qiime2. For example, if you had 1 forward and 1 reverse fastq file for each sample then you can simply import those using the manifest import method.
Another option is to convert these file to fastq. I’m not sure what method you used to demultiplex originally but in qiime1 you can convert fasta +qual to fastq using the script.
Hope this help.

1 Like

Hi Mehrbod,

Thank you for your response. I have used mothur for demultiplexing since I had dual index reads. Now I would like to import the fasta files generated for samples to qiime2 for further processing. The files generated are of the form Undetermined_S0_L001_R1_001.trim.contigs.samplename.fasta.

Thanking you,

(Mehrbod Estaki) #8

Hi @ramasravani,
Thanks for clarifying, the recommendation however still remains the same :slight_smile:
Like I said, you’ll need to convert your fasta + qual files to .fastq outside of qiime2 in order to import them. That is something I don’t have a lot of experience with personally but it looks as though you can do this in mothur easily with make.fastq or with whatever else tool you prefer.


Hi @Mehrbod_Estaki,

Thank you. But, In my case, I have single trim.contigs.qual file and fasta files are only present for each sample. I donot have qual file for each sample. So, what would be the approach only with fasta files per sample. How to import only the fasta files in qiime2 for downstream analysis.

I see there is a post for the similar situation as the one I have, How to import cleaned multi-sample reads?. Will this approach help.

Thanking you,

(Mehrbod Estaki) #10

Hi @ramasravani,
If you wanted to import only the fasta files without the quality scores you would not be able to use denoising methods such as DADA and deblur and you would have to use OTU picking methods which are not ideal. With that caveat, you can import fasta files as per the importing tutorial here.
I am not experienced with mothur so I recommend asking for help on the mothur forum about this since this seems to be a question specific to that pipeline and not yet in Qiime2. My guess is you might have to take a step back and demultiplex again since your original files were actually in the right fastq format so there must be a way to demultiplex them without separating the qual scores. Alternatively, I had a similar situation and I outline in this post how I used qiime1 to demultiplex my samples before qiime2 importing.


Hi @Mehrbod_Estaki,

Thank you for the suggestion. I have followed your post. From your post, I understood that barcodes.fastq.gz was constructed and then the data is imported to qiime2 with EMP-paired end protocol. But may I know how you demultiplexed the data in qiime1 after extracting the barcodes.
Did you demultiplex after importing the data in qiime2. If so, could you please let me know how the sample-metadata.tsv is constructed with dual barcodes and how the barcode columns are specified in the below command.

qiime demux emp-paired
–m-barcodes-file sample-metadata.tsv
–m-barcodes-column BarcodeSequence
–i-seqs emp-paired-end-sequences.qza
–o-per-sample-sequences demux.qza

Thanking you,

(Mehrbod Estaki) #12

Hi @ramasravani,

I didn’t dumtiplex in qiime1 actually. Once you have the forward, reverse, and barcodes files it is easier to just import them into Qiime2 and do the rest of the analysis, including demultiplexing, there.

Have a look through the Atacama-soils tutorial which shows the whole process of starting with the multiplexed F, R, and barcode reads. The example sample-metadata file they are using has a column named “BarcodeSequence” which is being referred to in the --m-barcodes-column option. So you’ll need to make your own metadata file (see here for more detail info on that) and include a column where you list your Forward and Reverse indexes as they appear in your barcodes.fastq.
Depending on your data and how your facility hands you the data you might have to play around with the orientation of these to make sure they are in the same order. see qiime demux emp-paired --help for some extra options in the event your sequences are not in the expected order.
Also, see this little explanation to make sure your reads match the expected criteria.
FYI, the importing can be one of the most confusing part of qiime2 because there are hundreds if not thousands of different ways you can have your data and that that is facility/user-specific. But once you’re in Qiime2 everything becomes much much easier. So, don’t give up and good luck!


Hi @Mehrbod_Estaki,

Thanks a lot for the detailed information. I will try with this method of importing.

Thanking you,

1 Like
(system) closed #14

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