"Mismatching dimensions along axis 0: {0, 1}" in DADA2 Plugin

Hi ! Friends in the QIIME2 forum! I am very sorry to disturb you, but I encountered a problem with dada2 that I have no clues to solve.

The process is displayed following:

  1. USE FASTP TO PERFORM QUALITY CONTROL ON FIVE PAIRED-END SAMPLE
    There were totally five paired-end samples used fastp to perform quality control and generated trimmed fastq files
  2. IMPORT TRIMMED FASTQ FILES TO QIIME2
    I imported the trimmed fastq files into QIIME2 through the following code:
qiime tools import \
--type 'SampleData[PairedEndSequencesWithQuality]' \
--input-path manifeat_paired.tsv \
--output-path paired_debug.qza \
--input-format PairedEndFastqManifestPhred33V2
  1. CUTADAPT WAS USED TO CUT PRIMERS
    To remove the primers, I preformed cutadapt plugin through the following code:
qiime cutadapt trim-paired \
--i-demultiplexed-sequences paired_debug.qza \
--p-front-f CCTACGGGAGGCAGCAG \
--p-front-r CCGTCAATTCMTTTRAGT \
--o-trimmed-sequences trim_debug_paired_end.qza
  1. DADA2 ERROR
    The dada2 codes and error is presenting here:
qiime dada2 denoise-paired \
--i-demultiplexed-seqs trim_debug_paired_end.qza \
--p-trunc-len-f 0 \
--p-trunc-len-r 0 \
--p-n-threads 20 \
--o-table table_debug.qza \
--o-representative-sequences rep-seqs_debug.qza \
--o-denoising-stats denoising-stats_debug.qza
Plugin error from dada2:

  Mismatching dimensions along axis 0: {0, 1}

Debug info has been saved to /tmp/qiime2-q2cli-err-kqv_zy8d.log

The /tmp/qiime2-q2cli-err-kqv_zy8d.log file is attached here:

Running external command line application(s). This may print messages to stdout and/or stderr.
The command(s) being run are below. These commands cannot be manually re-run as they will depend on temporary files that no longer exist.

Command: run_dada.R --input_directory /tmp/tmpyop0vjwm/forward --input_directory_reverse /tmp/tmpyop0vjwm/reverse --output_path /tmp/tmpyop0vjwm/output.tsv.biom --output_track /tmp/tmpyop0vjwm/track.tsv --filtered_directory /tmp/tmpyop0vjwm/filt_f --filtered_directory_reverse /tmp/tmpyop0vjwm/filt_r --truncation_length 0 --truncation_length_reverse 0 --trim_left 0 --trim_left_reverse 0 --max_expected_errors 2.0 --max_expected_errors_reverse 2.0 --truncation_quality_score 2 --min_overlap 12 --pooling_method independent --chimera_method consensus --min_parental_fold 1.0 --allow_one_off False --num_threads 20 --learn_min_reads 1000000

R version 4.3.3 (2024-02-29)
Loading required package: Rcpp
DADA2: 1.30.0 / Rcpp: 1.0.12 / RcppParallel: 5.1.6
2) Filtering .....
3) Learning Error Rates
11800 total bases in 43 reads from 5 samples will be used for learning the error rates.
11013 total bases in 43 reads from 5 samples will be used for learning the error rates.
3) Denoise samples .....
.....
5) Remove chimeras (method = consensus)
6) Report read numbers through the pipeline
7) Write output
Traceback (most recent call last):
  File "/home/zcw/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2cli/commands.py", line 520, in __call__
    results = self._execute_action(
  File "/home/zcw/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2cli/commands.py", line 581, in _execute_action
    results = action(**arguments)
  File "<decorator-gen-49>", line 2, in denoise_paired
  File "/home/zcw/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/qiime2/sdk/action.py", line 342, in bound_callable
    outputs = self._callable_executor_(
  File "/home/zcw/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/qiime2/sdk/action.py", line 576, in _callable_executor_
    output_views = self._callable(**view_args)
  File "/home/zcw/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2_dada2/_denoise.py", line 367, in denoise_paired
    return _denoise_helper(biom_fp, track_fp, hashed_feature_ids,
  File "/home/zcw/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/q2_dada2/_denoise.py", line 178, in _denoise_helper
    table = table.concat(table_to_add)
  File "/home/zcw/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/biom/table.py", line 3609, in concat
    concat_mat = stack([t.matrix_data for t in padded_tables])
  File "/home/zcw/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/scipy/sparse/_construct.py", line 733, in hstack
    return _block([blocks], format, dtype, return_spmatrix=True)
  File "/home/zcw/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/scipy/sparse/_construct.py", line 908, in _block
    blocks = [[_stack_along_minor_axis(blocks[b, :], 1)] for b in range(M)]
  File "/home/zcw/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/scipy/sparse/_construct.py", line 908, in <listcomp>
    blocks = [[_stack_along_minor_axis(blocks[b, :], 1)] for b in range(M)]
  File "/home/zcw/miniconda3/envs/qiime2-amplicon-2024.5/lib/python3.9/site-packages/scipy/sparse/_construct.py", line 648, in _stack_along_minor_axis
    raise ValueError(f'Mismatching dimensions along axis {other_axis}: '
ValueError: Mismatching dimensions along axis 0: {0, 1}

Then I checked .qzv file of paired_debug.qza by following code:

qiime demux summarize \
--i-data paired_debug.qza \
--o-visualization demux_debug_seqs.qzv

The demux_debug_seqs.qzv looks normally so that I can't tell where is the wrong. The demux_debug_seqs.qzv is attached to here.
demux_debug_seqs.qzv (319.7 KB)

Thank you very much for reading my post, and I truly appreciate any guidance you can provide.

1 Like

Hello @zcw15774723795, can you please DM me your paired_debug.qza and your trim_debug_paired_end.qza so I can attempt to reproduce this error. I think I understand what is happening and where it is happening but not why.

Thank you very much for reading my post here!
Sure! These are the files I used for my process.
paired_debug.qza (32.9 KB)
trim_debug_paired_end.qza (37.5 KB)
Thank you again for you kindness!

2 Likes

Thank you. I have identified the issue, and I believe I know how to resolve it; unfortunately, I believe it will require a code change. I'm not sure if there is a workaround possible on your end.

You may be able to get away with using an older version of QIIME 2. I believe this bug was introduced in the last release.

EDIT: Bug was introduced in QIIME 2 2024.2 should be resolved in QIIME 2 2024.10, currently using any version of QIIME 2 prior to 2024.2 should avoid this issue

4 Likes

Thank you very much for you reply and solution!

I apologize for the late response as I had gone to bed. I will try using an older version of QIIME 2 to avoid this issue. :qiime2:

Thank you again for your patient and kindness! :grinning:

2 Likes

Hi! was this issue ever resolved? I am having the same issue on qiime2 2024.2.

Dada2 has ran successfully for me multiple (5+) times on various different samples sets, but failed on this set. Ideally, I could run all my samples using the same version of qiime2 (qiime 2024.2) instead of having to use a different version for just these samples, or having to redo all of them on the a different version.

Command that failed:
qiime dada2 denoise-paired
--i-demultiplexed-seqs ../demux/demux_sr38_pre_labMove.qza
--p-trunc-len-f 250
--p-trunc-len-r 250
--o-table sr38_pre_move_table_dada2.qza
--o-representative-sequences sr38_pre_move_rep_seqs_dada2.qza
--o-denoising-stats sr38_pre_move_denoising_stats_dada2.qza

Error:
Plugin error from dada2:
Mismatching dimensions along axis 0: {0, 1}
Debug info has been saved to /scratch/alpine/lindsval@colostate.edu/.tmp/qiime2-q2cli-err-osfjqy2z.log

Command that most recently successfully ran (in fact this was in the same script as the command above):
qiime dada2 denoise-paired
--i-demultiplexed-seqs ../demux/demux_sr39_pre_labMove.qza
--p-trunc-len-f 250
--p-trunc-len-r 250
--o-table sr39_pre_move_table_dada2.qza
--o-representative-sequences sr39_pre_move_rep_seqs_dada2.qza
--o-denoising-stats sr39_pre_move_denoising_stats_dada2.qza

Thanks! let me know if i can provide more details.

1 Like

Hello @valseitz. This is the result of a bug that was introduced in QIIME 2 2024.2 and should be fixed in QIIME 2 2024.10. Currently using any version of QIIME 2 prior to 2024.2 should avoid this issue.

I originally indicated it was introduced in 2024.5. I was wrong my apologies

1 Like

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