DADA2 error (code 1), 'colnames' on an object with less than two dimensions

Hi,

Recently we had a problem in running the dada2 pipeline on our new sequence data within the qiime2-201712 environment.

The command blocks used:

qiime dada2 denoise-paired
–i-demultiplexed-seqs demux.qza
–o-table table
–o-representative-sequences rep-seqs
–p-trim-left-f 20
–p-trim-left-r 21
–p-trunc-len-f 280
–p-trunc-len-r 190
–p-n-threads 16
–verbose

We ran the command blocks on another demux.qza file that has been denoised by the dada2 successfully but encountered the same error again, which says:

R version 3.4.1 (2017-06-30)
Loading required package: Rcpp
DADA2 R package version: 1.4.0

  1. Filtering Error in colnames<-(*tmp*, value = c(“AqFl1-100_S25_L001_R1_001.fastq.gz”, :
    attempt to set ‘colnames’ on an object with less than two dimensions
    Execution halted
    Traceback (most recent call last):
    File “/home/nutrition_group/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/q2_dada2/_denoise.py”, line 179, in denoise_paired
    run_commands([cmd])
    File “/home/nutrition_group/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/q2_dada2/_denoise.py”, line 35, in run_commands
    subprocess.run(cmd, check=True)
    File “/home/nutrition_group/miniconda3/envs/qiime2-2017.12/lib/python3.5/subprocess.py”, line 398, in run
    output=stdout, stderr=stderr)
    subprocess.CalledProcessError: Command ‘[‘run_dada_paired.R’, ‘/tmp/tmpl0chlnrm/forward’, ‘/tmp/tmpl0chlnrm/reverse’, ‘/tmp/tmpl0chlnrm/output.tsv.biom’, ‘/tmp/tmpl0chlnrm/filt_f’, ‘/tmp/tmpl0chlnrm/filt_r’, ‘280’, ‘190’, ‘20’, ‘21’, ‘2.0’, ‘2’, ‘consensus’, ‘1.0’, ‘16’, ‘1000000’]’ returned non-zero exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/nutrition_group/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/q2cli/commands.py”, line 224, in call
results = action(**arguments)
File “”, line 2, in denoise_paired
File “/home/nutrition_group/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/qiime2/sdk/action.py”, line 228, in bound_callable
output_types, provenance)
File “/home/nutrition_group/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/qiime2/sdk/action.py”, line 363, in callable_executor
output_views = self._callable(**view_args)
File “/home/nutrition_group/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/q2_dada2/_denoise.py”, line 194, in denoise_paired
" and stderr to learn more." % e.returncode)
Exception: An error was encountered while running DADA2 in R (return code 1), please inspect stdout and stderr to learn more.

We tried to figure out the problem and found that this error may be caused by an older version of the ShortRead package, which however has been updated in our R studio.

I'm confused by this. Shouldn't the 2017.12 release have DADA2 R package version 1.6.0?
Have there some by hand modifications to the R packages in your Q2 environment?

Also, one thing I would check -- are these 2x300 sequences? Or might they be shorter (e.g. 2x250)? If they are shorter, you need to reduce trunc-len-f to less than the length of the sequences or you lose everything in filtering.

Hi @benjjneb,

We didn't make any changes to the QIIME2 installation packages. The data are 2*300 sequences generated on the Miseq platform.

In order to do the trouble shooting, I just re-ran the DADA2 pipeline in R using a different command block, which worked without problem. The same R commands translate to the QIIME2 commands:

qiime dada2 denoise-paired
--i-demultiplexed-seqs demux.qza
--o-table table
--o-representative-sequences rep-seqs
--p-trim-left-f 17
--p-trim-left-r 21
--p-trunc-len-f 290
--p-trunc-len-r 220
--p-n-threads 16
--verbose

I cleaned the conda environment, re-installed the qiime2-2017.12 and ran the above command block but encountered the same error, which said:

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_paired.R /tmp/tmppzx_9b6v/forward /tmp/tmppzx_9b6v/reverse /tmp/tmppzx_9b6v/output.tsv.biom /tmp/tmppzx_9b6v/filt_f /tmp/tmppzx_9b6v/filt_r 290 220 17 21 2.0 2 consensus 1.0 16 1000000

R version 3.4.1 (2017-06-30)
Loading required package: Rcpp
DADA2 R package version: 1.4.0

  1. Filtering Error in colnames<-(*tmp*, value = c("v3cpdm_S56_L001_R1_001.fastq.gz", :
    attempt to set 'colnames' on an object with less than two dimensions
    Execution halted
    Traceback (most recent call last):
    File "/home/nutrition_group/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/q2_dada2/_denoise.py", line 179, in denoise_paired
    run_commands([cmd])
    File "/home/nutrition_group/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/q2_dada2/_denoise.py", line 35, in run_commands
    subprocess.run(cmd, check=True)
    File "/home/nutrition_group/miniconda3/envs/qiime2-2017.12/lib/python3.5/subprocess.py", line 398, in run
    output=stdout, stderr=stderr)
    subprocess.CalledProcessError: Command '['run_dada_paired.R', '/tmp/tmppzx_9b6v/forward', '/tmp/tmppzx_9b6v/reverse', '/tmp/tmppzx_9b6v/output.tsv.biom', '/tmp/tmppzx_9b6v/filt_f', '/tmp/tmppzx_9b6v/filt_r', '290', '220', '17', '21', '2.0', '2', 'consensus', '1.0', '16', '1000000']' returned non-zero exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/nutrition_group/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/q2cli/commands.py", line 224, in call
results = action(**arguments)
File "", line 2, in denoise_paired
File "/home/nutrition_group/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/qiime2/sdk/action.py", line 228, in bound_callable
output_types, provenance)
File "/home/nutrition_group/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/qiime2/sdk/action.py", line 363, in callable_executor
output_views = self._callable(**view_args)
File "/home/nutrition_group/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/q2_dada2/_denoise.py", line 194, in denoise_paired
" and stderr to learn more." % e.returncode)
Exception: An error was encountered while running DADA2 in R (return code 1), please inspect stdout and stderr to learn more.

Hi @yanxianl,

I think something is messing up the conda-environment. DADA2 should be 1.6.0 like @benjjneb mentioned.

What does:

R -e ".libPaths()" 

produce (inside your q2 environment)?

Could you also run:

conda list

Hi,

The command R -e ".libPaths()" returned:

R version 3.4.1 (2017-06-30) -- "Single Candle"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

.libPaths()
[1] "/home/nutrition_group/R/x86_64-pc-linux-gnu-library/3.4"
[2] "/home/nutrition_group/miniconda3/envs/qiime2-2017.12/lib/R/library"

The conda list returned the following info:

packages in environment at /home/nutrition_group/miniconda3/envs/qiime2-2017.12:

asn1crypto 0.22.0 py35_0 conda-forge
backports 1.0 py35_1 conda-forge
backports.functools_lru_cache 1.4 py35_1 conda-forge
bioconductor-biobase 2.38.0 r3.4.1_0 bioconda
bioconductor-biocgenerics 0.24.0 r3.4.1_0 bioconda
bioconductor-biocparallel 1.12.0 r3.4.1_0 bioconda
bioconductor-biostrings 2.46.0 r3.4.1_0 bioconda
bioconductor-dada2 1.6.0 r3.4.1_0 bioconda
bioconductor-delayedarray 0.4.1 r3.4.1_0 bioconda
bioconductor-genomeinfodb 1.14.0 r3.4.1_0 bioconda
bioconductor-genomeinfodbdata 1.0.0 r3.4.1_1 bioconda
bioconductor-genomicalignments 1.14.0 r3.4.1_0 bioconda
bioconductor-genomicranges 1.30.0 r3.4.1_0 bioconda
bioconductor-iranges 2.12.0 r3.4.1_0 bioconda
bioconductor-rsamtools 1.30.0 r3.4.1_0 bioconda
bioconductor-s4vectors 0.16.0 r3.4.1_0 bioconda
bioconductor-shortread 1.36.0 r3.4.1_0 bioconda
bioconductor-summarizedexperiment 1.8.0 r3.4.1_0 bioconda
bioconductor-xvector 0.18.0 r3.4.1_0 bioconda
bioconductor-zlibbioc 1.24.0 r3.4.1_0 bioconda
biom-format 2.1.6 py35_8 qiime2
blas 1.1 openblas conda-forge
blast 2.6.0 boost1.64_2 bioconda
bleach 2.0.0 py_1 conda-forge
bokeh 0.12.13 py35_0 conda-forge
boost 1.64.0 py35_4 conda-forge
boost-cpp 1.64.0 1 conda-forge
bzip2 1.0.6 1 conda-forge
ca-certificates 2017.11.5 0 conda-forge
cachecontrol 0.12.3 py35_0
cairo 1.14.6 4 conda-forge
certifi 2017.11.5 py35_0 conda-forge
cffi 1.11.2 py35_0 conda-forge
chardet 3.0.4 py35_0 conda-forge
click 6.7 py_1 conda-forge
cryptography 2.1.4 py35_0 conda-forge
curl 7.54.1 0 conda-forge
cutadapt 1.15 py35_0 bioconda
cycler 0.10.0 py35_0 conda-forge
cython 0.27.3 py35_0 conda-forge
dbus 1.10.22 0 conda-forge
deblur 1.0.3 py35h87d23f6_0 biocore
decorator 4.1.2 py35_0 conda-forge
emperor 1.0.0beta13 py35_1 conda-forge
entrypoints 0.2.3 py35_1 conda-forge
expat 2.2.5 0 conda-forge
fastcluster 1.1.24 py35_0 conda-forge
fasttree 2.1.10 0 bioconda
fontconfig 2.12.1 6 conda-forge
freetype 2.7 1 conda-forge
future 0.16.0 py35_0 conda-forge
gettext 0.19.7 1 conda-forge
glib 2.51.4 0 conda-forge
gmp 6.1.2 0 conda-forge
gneiss 0.4.2 py35hda95eb5_6 biocore
graphite2 1.3.10 0 conda-forge
gsl 2.1 2 conda-forge
gst-plugins-base 1.8.0 0 conda-forge
gstreamer 1.8.0 2 conda-forge
h5py 2.7.0 np112py35_0 conda-forge
harfbuzz 1.4.3 0 conda-forge
hdf5 1.8.17 11 conda-forge
html5lib 1.0.1 py_0 conda-forge
icu 58.2 0 conda-forge
idna 2.6 py35_1 conda-forge
ijson 2.3 py35_0 qiime2
intel-openmp 2018.0.0 hc7b2577_8
ipykernel 4.7.0 py35_0 conda-forge
ipython 6.2.1 py35_1 conda-forge
ipython_genutils 0.2.0 py35_0 conda-forge
ipywidgets 7.1.0 py35_0 conda-forge
jedi 0.10.2 py35_0 conda-forge
jinja2 2.10 py35_0 conda-forge
jpeg 9b 2 conda-forge
jsonschema 2.6.0 py35_1 conda-forge
jupyter_client 5.2.1 py35_0 conda-forge
jupyter_core 4.4.0 py_0 conda-forge
krb5 1.14.2 0 conda-forge
libffi 3.2.1 3 conda-forge
libgcc 7.2.0 h69d50b8_2
libgcc-ng 7.2.0 h7cc24e2_2
libgfortran 3.0.0 1
libgfortran-ng 7.2.0 h9f7466a_2
libiconv 1.15 0 conda-forge
libpng 1.6.28 1 conda-forge
libsodium 1.0.15 1 conda-forge
libssh2 1.8.0 1 conda-forge
libstdcxx-ng 7.2.0 h7a57d05_2
libtiff 4.0.7 0 conda-forge
libxcb 1.12 1 conda-forge
libxml2 2.9.5 0 conda-forge
lockfile 0.12.2 py35_0 conda-forge
mafft 7.310 0 bioconda
markupsafe 1.0 py35_0 conda-forge
matplotlib 2.1.1 py35_0 conda-forge
mistune 0.8.3 py_0 conda-forge
mkl 2018.0.1 h19d6760_4
msgpack-python 0.4.8 py35_0 conda-forge
natsort 5.0.2 py35_0 conda-forge
nbconvert 5.3.1 py_1 conda-forge
nbformat 4.4.0 py35_0 conda-forge
ncurses 5.9 10 conda-forge
nose 1.3.7 py35_2 conda-forge
notebook 5.2.2 py35_1 conda-forge
numpy 1.12.1 py35_blas_openblas_200 [blas_openblas] conda-forge
openblas 0.2.19 2 conda-forge
openssl 1.0.2n 0 conda-forge
pandas 0.22.0 py35_0 conda-forge
pandoc 2.0.0.1 0 conda-forge
pandocfilters 1.4.1 py35_0 conda-forge
pango 1.40.4 0 conda-forge
patsy 0.5.0 py35_0 conda-forge
pcre 8.39 0 conda-forge
pexpect 4.3.1 py35_0 conda-forge
pickleshare 0.7.4 py35_0 conda-forge
pigz 2.3.4 0 conda-forge
pip 9.0.1 py35_1 conda-forge
pixman 0.34.0 1 conda-forge
prompt_toolkit 1.0.15 py35_0 conda-forge
psutil 5.4.0 py35_0 conda-forge
ptyprocess 0.5.2 py35_0 conda-forge
pycparser 2.18 py35_0 conda-forge
pygments 2.2.0 py35_0 conda-forge
pyopenssl 17.4.0 py35_0 conda-forge
pyparsing 2.2.0 py35_0 conda-forge
pyqt 5.6.0 py35_4 conda-forge
pysocks 1.6.7 py35_0 conda-forge
python 3.5.4 0 conda-forge
python-dateutil 2.6.1 py35_0 conda-forge
pytz 2017.3 py_2 conda-forge
pyyaml 3.12 py35_1 conda-forge
pyzmq 16.0.2 py35_3 conda-forge
q2-alignment 2017.12.0 py35_0 qiime2/label/r2017.12
q2-composition 2017.12.0 py35_0 qiime2/label/r2017.12
q2-cutadapt 2017.12.0 py35_0 qiime2/label/r2017.12
q2-dada2 2017.12.1 py35_0 qiime2/label/r2017.12
q2-deblur 2017.12.0 py35_0 qiime2/label/r2017.12
q2-demux 2017.12.0 py35_0 qiime2/label/r2017.12
q2-diversity 2017.12.0 py35_0 qiime2/label/r2017.12
q2-emperor 2017.12.0 py35_0 qiime2/label/r2017.12
q2-feature-classifier 2017.12.0 py35_0 qiime2/label/r2017.12
q2-feature-table 2017.12.0 py35_0 qiime2/label/r2017.12
q2-gneiss 2017.12.0 py35_0 qiime2/label/r2017.12
q2-longitudinal 2017.12.0 py35_0 qiime2/label/r2017.12
q2-metadata 2017.12.0 py35_0 qiime2/label/r2017.12
q2-phylogeny 2017.12.0 py35_0 qiime2/label/r2017.12
q2-quality-control 2017.12.0 py35_0 qiime2/label/r2017.12
q2-quality-filter 2017.12.0 py35_0 qiime2/label/r2017.12
q2-sample-classifier 2017.12.0 py35_0 qiime2/label/r2017.12
q2-taxa 2017.12.0 py35_0 qiime2/label/r2017.12
q2-types 2017.12.0 py35_0 qiime2/label/r2017.12
q2-vsearch 2017.12.0 py35_0 qiime2/label/r2017.12
q2cli 2017.12.0 py35_0 qiime2/label/r2017.12
q2templates 2017.12.0 py35_0 qiime2/label/r2017.12
qiime2 2017.12.1 py35_0 qiime2/label/r2017.12
qt 5.6.2 3 conda-forge
r-base 3.4.1 0 conda-forge
r-bh 1.65.0_1 r3.4.1_0 conda-forge
r-bitops 1.0_6 r3.4.1_0 conda-forge
r-colorspace 1.3_2 r3.4.1_0 conda-forge
r-data.table 1.10.4 r3.4.1_0 conda-forge
r-dichromat 2.0_0 r3.4.1_0 conda-forge
r-digest 0.6.12 r3.4.1_0 conda-forge
r-futile.logger 1.4.3 r3.4.1_0 conda-forge
r-futile.options 1.0.0 r3.4.1_0 conda-forge
r-ggplot2 2.2.1 r3.4.1_0 conda-forge
r-gtable 0.2.0 r3.4.1_0 conda-forge
r-hwriter 1.3.2 r3.4.1_0 conda-forge
r-labeling 0.3 r3.4.1_0 conda-forge
r-lambda.r 1.1.9 r3.4.1_0 conda-forge
r-lattice 0.20_34 r3.4.1_0 conda-forge
r-latticeextra 0.6_28 r3.4.1_0 conda-forge
r-lazyeval 0.2.0 r3.4.1_0 conda-forge
r-magrittr 1.5 r3.4.1_0 conda-forge
r-mass 7.3_45 r3.4.1_0 conda-forge
r-matrix 1.2_7.1 r3.4.1_0 conda-forge
r-matrixstats 0.52.2 r3.4.1_0 conda-forge
r-munsell 0.4.3 r3.4.1_0 conda-forge
r-plyr 1.8.4 r3.4.1_0 conda-forge
r-rcolorbrewer 1.1_2 r3.4.1_0 conda-forge
r-rcpp 0.12.13 r3.4.1_0 conda-forge
r-rcppparallel 4.3.20 r3.4.1_0 conda-forge
r-rcurl 1.95_4.8 r3.4.1_0 conda-forge
r-reshape2 1.4.2 r3.4.1_0 conda-forge
r-rlang 0.1.2 r3.4.1_0 conda-forge
r-scales 0.4.1 r3.4.1_0 conda-forge
r-snow 0.4_2 r3.4.1_0 conda-forge
r-stringi 1.1.2 r3.4.1_0 conda-forge
r-stringr 1.2.0 r3.4.1_0 conda-forge
r-tibble 1.3.3 r3.4.1_0 conda-forge
readline 6.2 0 conda-forge
requests 2.18.4 py35_1 conda-forge
scikit-bio 0.5.1 py35_0 qiime2
scikit-learn 0.19.1 py35_blas_openblas_200 [blas_openblas] conda-forge
scipy 0.19.1 py35_blas_openblas_202 [blas_openblas] conda-forge
seaborn 0.8.1 py35_0 conda-forge
setuptools 38.4.0 py35_0 conda-forge
simplegeneric 0.8.1 py35_0 conda-forge
sip 4.18 py35_1 conda-forge
six 1.11.0 py35_1 conda-forge
sortmerna 2.0 1 bioconda
sqlite 3.13.0 1 conda-forge
statsmodels 0.8.0 py35_0 conda-forge
terminado 0.8.1 py35_0 conda-forge
testpath 0.3.1 py35_0 conda-forge
tk 8.5.19 2 conda-forge
tornado 4.5.3 py35_0 conda-forge
traitlets 4.3.2 py35_0 conda-forge
tzlocal 1.3 py35_0 qiime2
unifrac 0.9.2 py35hae32d81_1 biocore
urllib3 1.22 py35_0 conda-forge
vsearch 2.6.0 0 bioconda
wcwidth 0.1.7 py35_0 conda-forge
webencodings 0.5 py35_0 conda-forge
wget 1.18 0
wheel 0.30.0 py35_2 conda-forge
widgetsnbextension 3.1.0 py35_0 conda-forge
xopen 0.3.2 py35_0 bioconda
xorg-libxau 1.0.8 3 conda-forge
xorg-libxdmcp 1.1.2 3 conda-forge
xz 5.2.3 0 conda-forge
yaml 0.1.6 0 conda-forge
zeromq 4.2.1 1 conda-forge
zlib 1.2.8 3 conda-forge

Good news! This is easy to fix, you just need an .Rprofile file. It’s described in a couple different forum posts, but here’s an example.

It’ll change the load-order of your R libraries and cause your environment to load the right DADA2.

Let me know how that goes!

1 Like

Hi all,

I ran the following command suggested in the thread @ebolyen mentioned and the problem was fixed!

echo ".libPaths(.libPaths()[2])" > $HOME/.Rprofile

Many thanks!! @ebolyen @benjjneb

2 Likes

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