Demux after trimming

Hello,

I have “EMP paired-end sequence” type data. I first trimmed the forward and reverse sequences in Galaxy using trimmomatic (and removed sequences short sequences). I then imported these (the resulting forward and reverse reads that still have pairs) to qiime2 and now want to demultplex using a mapping file. However, I get the following error when I run the demux command:

qiime demux emp-paired --i-seqs sponge_paired.qza --m-barcodes-file Mapping_FWsponge_Feb2018.txt --m-barcodes-column BarcodeSequence --o-per-sample-sequences sponge_demux.qza

Plugin error from demux:

Argument to parameter ‘seqs’ is not a subtype of EMPPairedEndSequences.

Debug info has been saved to /var/folders/q8/x4fmb0c9157dl37y2d3rxvt80000gn/T/qiime2-q2cli-err-o4imuaw2.log

Is there an issue with trimming in Galaxy first? If more information is needed I am happy to provide it. Thank you for any help.

Hi @clfiore - I don’t think the trimming before importing is an issue. It looks like sponge_paired.qza isn’t data of type EMPPairedEndSequences. Can you run the following and post the results here?

qiime tools peek sponge_paired.qza

That will let us know what type the data actually is, and then we can figure out where to go from there. Thanks! :t_rex:

Ok thank you for the quick response. Here is the result of that command:

UUID: 2e7fa7ad-0f74-44e3-91d2-e8146429b3ff
Type: SampleData[PairedEndSequencesWithQuality]
Data format: SingleLanePerSamplePairedEndFastqDirFmt

So must be something other than “emp-paired” should have been used (?). I have gone through the tutorial for qiime2 and now working through it with my data and having a hard time looking up the options for each command. Is there something I am missing for looking up options (and sometimes I go in circles following links for file format options) - in qiime 1 there was a page for each script with information on the what is input, output, flags, etc., is there something like that for commands in qiime2?

Thank you!

Cool, so it looks like you have already demultiplexed data, which is why the demux emp-single method was complaining. You can skip demultiplexing and proceed on to quality control or otu picking. If you are following along with the Moving Pictures tutorial, you can pick up here (don’t forget to also run demux summarize, that way you know where to trim and truncate).

Wow! We have quite a few of them…

https://docs.qiime2.org/2018.2/tutorials/

https://docs.qiime2.org/2018.2/plugins/available/

Hope that helps! :t_rex:

1 Like

Hi Matthew,

That is a first - not sure how I didn’t realize I already demultiplexed them in galaxy. However… I kept going with the “downstream” analysis but realized when I looked at the summary of table.qzv that it looked like I only had one sequence, so something was not right. I am not sure what happened, so I tried to start from the beginning just using qiime2- but I am getting the same error (using raw fastq sequences):

These are paired reads, I imported them ok (raw forward and raw reverse fastq files):
qiime tools import \

–type ‘SampleData[PairedEndSequencesWithQuality]’
–input-path manifest.csv
–output-path paired.qza
–source-format PairedEndFastqManifestPhred33

Then tried to demultiplex and get the error message:
qiime demux emp-paired \

–i-seqs paired.qza
–m-barcodes-file Mapping_FW_Feb2018_v2.txt
–m-barcodes-column BarcodeSequence
–o-per-sample-sequences demux.qza
Plugin error from demux:

Argument to parameter ‘seqs’ is not a subtype of EMPPairedEndSequences.

Debug info has been saved to /var/folders/q8/x4fmb0c9157dl37y2d3rxvt80000gn/T/qiime2-q2cli-err-fs02z7sg.log

I looked up the document on demux: https://docs.qiime2.org/2017.4/plugins/available/demux/emp_paired/
But it looks like the only option is “emp-paired” which these should be.

Hopefully I am missing something obvious (most likely) - any suggestions are greatly appreciated. Thank you for your time.

1 Like

Hi @clfiore!

That sounds to me like you have imported paired end reads, that are already demultiplexed - nice!


Addressing the error you reported:

This is the exact same situation as above, copying my response here:

If your reads are already demultiplexed, you don’t need to worry about demultiplexing them, make sense?

I suspect you imported one pair of reads as EMPPairedEndSequences, instead of SampleData[PairedEndSequencesWithQuality]. Looks like you figured that out already, and have imported instead using the manifest strategy.

So, like I mentioned above, your next steps are:

Hope that helps, keep us posted! :t_rex:

Hi Again,
Sorry for the confusion, these are not demultiplexed. Is it assumed they are demultiplexed if you use SampleData[PairedEndSequencesWithQuality] to import?

I started over using EMPPairedEndSequences to import (before when I tried this with trimmed reads from galaxy it didn’t work which is why I didn’t try it again until now). Then demultiplexed - because these are raw reads, they should not be demultiplexed already. It worked (hooray for that part). Now, however, the summary from demux shows only 5 samples when I have 61 samples.
Do you know why it would not show all 61 samples? Did they not all import? I know that the quality of these reads is not great but, they should all make it through the first couple of steps right?

This is what I have done so far:
#Import:
qiime tools import

–type EMPPairedEndSequences
–input-path /Users/FW_fullrun1_Feb2018
–output-path paired.qza

#demux
qiime demux emp-paired \

–i-seqs paired.qza
–m-barcodes-file Mapping_FW_Feb2018_v2.txt
–m-barcodes-column BarcodeSequence
–o-per-sample-sequences demux.qza
Saved SampleData[PairedEndSequencesWithQuality] to: demux.qza

#summary
qiime demux summarize \

–i-data demux.qza
–o-visualization demux.qzv
Saved Visualization to: demux.qzv

#When I view demux.qzv I see only 5 out of 61 samples

Thank you so much for your patience

Hi @clfiore!

:sweat_smile:

Yes, this type is for per-sample (demultiplexed) paired end sequences (with quality scores).


Can you re-run your demux step from above, but this time with the --verbose flag? Then, copy-and-paste those results here.

It sounds like the demux emp-paired isn’t finding most of your barcodes in your reads. Do your barcodes need to be expressed as their reverse-complement? :t_rex:

Ok thank you for working with me on this. That would make sense that the barcodes should be expressed as rc - can I do this with the the extract_barcodes.py in qiime1?

I ran the --verbose flag, but it actually didn’t show anything else (am I missing something here)?
qiime demux emp-paired
–verbose
–i-seqs paired.qza
–m-barcodes-file Mapping_FW_Feb2018_v2.txt
–m-barcodes-column BarcodeSequence
–o-per-sample-sequences demux.qza
Saved SampleData[PairedEndSequencesWithQuality] to: demux.qza

qiime demux summarize --verbose
–i-data demux.qza
–o-visualization demux.qzv
Saved Visualization to: demux.qzv

No problem!

You could, but we also support that in QIIME 2, check out the docs for demux emp-paired!

Ah bummer, I assumed we were reporting something here, but I guess not.

I would double-check that your barcodes in your metadata match the barcodes listed in your multiplexed reads. One way to do that is to generate a list of barcode reads by running something like this:

 zcat < barcodes.fastq.gz | awk 'NR==2||(NR-2)%4==0{print $1}' | sort | uniq 

This command will generate a list of unique barcodes found in barcodes.fastq.gz (note, there might be “barcodes” listed in this file that don’t match any of your known barcodes - this is because the barcode sequences haven’t been quality controlled at all. TLDR; don’t be surprised if the number of barcodes pulled out of your barcodes read is greater than the actual number of barcodes used).

Keep us posted! :t_rex:

1 Like

That was it - the barcodes needed to be reverse complemented for it to get all of the sequences. I used the code you gave me above to compare the barcodes, and I ran demux with --p-rev-comp-barcodes and it looks good! Thank you for the guidance!!

1 Like

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