How to join sequences from different libraries sequenced in miseq

Hi, I am really new in Qiime2

I have the sequences of 5 libraries in which I use the same 7 primers 515F and 806R for microbiome, but use different Linker primer for each library, my question is how should I generate my map? and how can I join all the sequences of these libraries to analyze them together?

Hi @Ariadna,
Welcome to the :qiime2: community!

Your protocol is a little bit confusing to me.

Are these 5 samples? Or 5 libraries containing many samples in each? What sequencing platform are you using? Illumina or something else?

515F/806R are the primer — do you mean a different linker for each? (these are usually 2 bp long so not very informative). I assume what you really mean here is a different barcode/index. Could you please clarify?

Check out some of the sample metadata files in the tutorials, e.g., here. You will want to structure your file in the same way. Though you do not need the same columns. See here for info on formatting and using sample metadata.

You will probably want to import as a manifest format, assuming that your sequences are already demultiplexed. You can then proceed, e.g., following this tutorial (start after the demultiplexing step, e.g., here).

I hope that helps!

1 Like

Hi thank you very much for your time :slight_smile:

These libraries contain many samples in each one, for the sequencing use Illumina, what I wanted to say by linker primer was the index, each library has a different barcode index.

Try to make the map as indicated in the tutorials, validate it in Kemmeii and everything seemed to go well. But when I tried to demultiplex my sequences on qiime2, the program indicated that a barcode was twice on my map. This is of course true since I have 5 libraries with around 5 to 7 samples each with the same primers 515F and 806R, but the index is different for each of the libraries.

my sequences are as shown in the image:

first I joined all my forward sequences with the cat command and in the same way the reverse, as I did not have a file with the barcodes, I extracted them after importing the data, but since I wanted to demultiplex the sequences, I had the following error (only the part marked in red):

therefore I think the problem is my map, but I'm not sure
here is my map:

Hi @Ariadna,
Got it — I understand your setup now. Thank you for the sample metadata (map) file, that clarifies.

This should be easy to process, but you must merge downstream. Let’s walk through what you have done so far:

Since you re-used the same barcodes in each of your 5 libraries, you cannot merge them before importing. So do not concatenate your libraries together. In all of the steps I describe below, you will process each library separately until we get to the merging stage.


Where are the barcodes? Are they in-line with the reads? Or, e.g., in the header lines. Do you have a barcode on one end only or on each end? This is all important because it impacts the format that you want to import as. You have two options:

  1. barcodes are in the sequences, only on one end (forward or reverse): import and demultiplex each library separately using q2-cutadapt.
  2. It looks like you already have some code for extracting barcodes, so you could just slice off the barcodes outside of QIIME 2 as you have done, but do it for each library separately. Then import and process as EMP paired-end format, as you began to do.


At this point you can demultiplex as you did previously. As long as you keep your libraries separate, everything should be okay. Note that you will need to make a separate sample metadata (map) file for each library for the purposes of demultiplexing, because the redundant barcodes are breaking things! But keep the merged metadata file for downstream analysis.

Then denoise/OTU cluster each library separately.


At this point you will have a separate feature table and representative sequences artifact for each library. You can use merge and merge-seqs to merge these together before continuing with your analysis.

So you were on the right track, but you need to keep everything separate until after denoising since you re-use the same barcodes multiple times.

I hope that helps!

1 Like

Thank you very much was really helpful. :blush::slightly_smiling_face::hugs:


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