DADA2: error caught segfault

I am getting error after upgrade into qiime2-2017.12 while running DADA2

(qiime2-2017.12) nedonoiMac:Exp5 ruby$ qiime dada2 denoise-paired --i-demultiplexed-seqs paired-end-demux-Exp5.qza --p-trim-left-f 0 --p-trim-left-r 0 --p-trunc-len-f 300 --p-trunc-len-r 277 --p-n-threads 4 --o-representative-sequences rep-seqs-exp5.qza --o-table table-exp5.qza --verbose
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 /var/folders/2w/vhr0994d7fj3zdr08mt2py200000gp/T/tmp3ctdykgv/forward /var/folders/2w/vhr0994d7fj3zdr08mt2py200000gp/T/tmp3ctdykgv/reverse /var/folders/2w/vhr0994d7fj3zdr08mt2py200000gp/T/tmp3ctdykgv/output.tsv.biom /var/folders/2w/vhr0994d7fj3zdr08mt2py200000gp/T/tmp3ctdykgv/filt_f /var/folders/2w/vhr0994d7fj3zdr08mt2py200000gp/T/tmp3ctdykgv/filt_r 300 277 0 0 2.0 2 consensus 1.0 4 1000000

 衷動準備中です -  θ­¦ε‘Šγƒ‘γƒƒγ‚»γƒΌγ‚Έ: 
1: Setting LC_COLLATE failed, using "C" 
2: Setting LC_TIME failed, using "C" 
3: Setting LC_MESSAGES failed, using "C" 
4: Setting LC_MONETARY failed, using "C" 
R version 3.4.1 (2017-06-30) 
 θ¦ζ±‚γ•γ‚ŒγŸγƒ‘γƒƒγ‚±γƒΌγ‚Έ Rcpp をロード中です 
DADA2 R package version: 1.6.0 
1) Filtering ......................................................................
2) Learning Error Rates
2a) Forward Reads
Initializing error rates to maximum possible estimate.
Sample 1 - 52540 reads in 28609 unique sequences.

 *** caught segfault ***
address 0x8, cause 'memory not mapped'

Traceback:
 1: .Call("_dada2_dada_uniques", PACKAGE = "dada2", seqs, abundances,     err, quals, score, gap, use_kmers, kdist_cutoff, band_size,     omegaA, max_clust, min_fold, min_hamming, min_abund, use_quals,     final_consensus, vectorized_alignment, homo_gap, multithread,     verbose, SSE)
 2: dada_uniques(names(derep[[i]]$uniques), unname(derep[[i]]$uniques),     err, qi, opts[["SCORE_MATRIX"]], opts[["GAP_PENALTY"]], opts[["USE_KMERS"]],     opts[["KDIST_CUTOFF"]], opts[["BAND_SIZE"]], opts[["OMEGA_A"]],     if (initializeErr) {        1    } else {        opts[["MAX_CLUST"]]    }, opts[["MIN_FOLD"]], opts[["MIN_HAMMING"]], opts[["MIN_ABUNDANCE"]],     TRUE, FALSE, opts[["VECTORIZED_ALIGNMENT"]], opts[["HOMOPOLYMER_GAP_PENALTY"]],     multithread, (verbose >= 2), opts[["SSE"]])
 3: dada(drpsF, err = NULL, selfConsist = TRUE, multithread = multithread,     VECTORIZED_ALIGNMENT = FALSE, SSE = 2)
An irrecoverable exception occurred. R is aborting now ...
Traceback (most recent call last):
  File "/Users/ruby/miniconda2/envs/qiime2-2017.12/lib/python3.5/site-packages/q2_dada2/_denoise.py", line 179, in denoise_paired
    run_commands([cmd])
  File "/Users/ruby/miniconda2/envs/qiime2-2017.12/lib/python3.5/site-packages/q2_dada2/_denoise.py", line 35, in run_commands
    subprocess.run(cmd, check=True)
  File "/Users/ruby/miniconda2/envs/qiime2-2017.12/lib/python3.5/subprocess.py", line 398, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['run_dada_paired.R', '/var/folders/2w/vhr0994d7fj3zdr08mt2py200000gp/T/tmp3ctdykgv/forward', '/var/folders/2w/vhr0994d7fj3zdr08mt2py200000gp/T/tmp3ctdykgv/reverse', '/var/folders/2w/vhr0994d7fj3zdr08mt2py200000gp/T/tmp3ctdykgv/output.tsv.biom', '/var/folders/2w/vhr0994d7fj3zdr08mt2py200000gp/T/tmp3ctdykgv/filt_f', '/var/folders/2w/vhr0994d7fj3zdr08mt2py200000gp/T/tmp3ctdykgv/filt_r', '300', '277', '0', '0', '2.0', '2', 'consensus', '1.0', '4', '1000000']' returned non-zero exit status -11

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/ruby/miniconda2/envs/qiime2-2017.12/lib/python3.5/site-packages/q2cli/commands.py", line 224, in __call__
    results = action(**arguments)
  File "<decorator-gen-354>", line 2, in denoise_paired
  File "/Users/ruby/miniconda2/envs/qiime2-2017.12/lib/python3.5/site-packages/qiime2/sdk/action.py", line 228, in bound_callable
    output_types, provenance)
  File "/Users/ruby/miniconda2/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 "/Users/ruby/miniconda2/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 -11), please inspect stdout and stderr to learn more.

Plugin error from dada2:

  An error was encountered while running DADA2 in R (return code -11), please inspect stdout and stderr to learn more.

See above for debug info.

Before updating to release 2017.12 I have no problem denoise my data with DADA2. My data is paired end data from fastq file imported into qiime2 artifact.
I already reinstall my qiime2 and R, but doesn't solve the problem.

Thank you

I got the same error since after updating to QIIME 2.

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 /var/folders/8x/rqqs6m296k7g3trbdz559cnm0000gp/T/tmps_9gt_fk/forward /var/folders/8x/rqqs6m296k7g3trbdz559cnm0000gp/T/tmps_9gt_fk/reverse /var/folders/8x/rqqs6m296k7g3trbdz559cnm0000gp/T/tmps_9gt_fk/output.tsv.biom /var/folders/8x/rqqs6m296k7g3trbdz559cnm0000gp/T/tmps_9gt_fk/filt_f /var/folders/8x/rqqs6m296k7g3trbdz559cnm0000gp/T/tmps_9gt_fk/filt_r 270 120 0 0 2.0 2 consensus 1.0 1 1000000

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

  1. Filtering ....................................................
  2. Learning Error Rates
    2a) Forward Reads
    Initializing error rates to maximum possible estimate.
    Sample 1 - 165126 reads in 46441 unique sequences.

*** caught segfault ***
address 0x8, cause 'memory not mapped'

Traceback:
1: .Call("_dada2_dada_uniques", PACKAGE = "dada2", seqs, abundances, err, quals, score, gap, use_kmers, kdist_cutoff, band_size, omegaA, max_clust, min_fold, min_hamming, min_abund, use_quals, final_consensus, vectorized_alignment, homo_gap, multithread, verbose, SSE)
2: dada_uniques(names(derep[[i]]$uniques), unname(derep[[i]]$uniques), err, qi, opts[["SCORE_MATRIX"]], opts[["GAP_PENALTY"]], opts[["USE_KMERS"]], opts[["KDIST_CUTOFF"]], opts[["BAND_SIZE"]], opts[["OMEGA_A"]], if (initializeErr) { 1 } else { opts[["MAX_CLUST"]] }, opts[["MIN_FOLD"]], opts[["MIN_HAMMING"]], opts[["MIN_ABUNDANCE"]], TRUE, FALSE, opts[["VECTORIZED_ALIGNMENT"]], opts[["HOMOPOLYMER_GAP_PENALTY"]], multithread, (verbose >= 2), opts[["SSE"]])
3: dada(drpsF, err = NULL, selfConsist = TRUE, multithread = multithread, VECTORIZED_ALIGNMENT = FALSE, SSE = 2)
An irrecoverable exception occurred. R is aborting now ...
Traceback (most recent call last):
File "/Users/sm939/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/q2_dada2/_denoise.py", line 179, in denoise_paired
run_commands([cmd])
File "/Users/sm939/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 "/Users/sm939/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', '/var/folders/8x/rqqs6m296k7g3trbdz559cnm0000gp/T/tmps_9gt_fk/forward', '/var/folders/8x/rqqs6m296k7g3trbdz559cnm0000gp/T/tmps_9gt_fk/reverse', '/var/folders/8x/rqqs6m296k7g3trbdz559cnm0000gp/T/tmps_9gt_fk/output.tsv.biom', '/var/folders/8x/rqqs6m296k7g3trbdz559cnm0000gp/T/tmps_9gt_fk/filt_f', '/var/folders/8x/rqqs6m296k7g3trbdz559cnm0000gp/T/tmps_9gt_fk/filt_r', '270', '120', '0', '0', '2.0', '2', 'consensus', '1.0', '1', '1000000']' returned non-zero exit status -11

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/sm939/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 "/Users/sm939/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/qiime2/sdk/action.py", line 228, in bound_callable
output_types, provenance)
File "/Users/sm939/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 "/Users/sm939/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 -11), please inspect stdout and stderr to learn more.

Thanks @Setiawan & @slh277 - pinging @benjjneb for some help on this one. Thanks for your patience!

Hey @Setiawan and @slh277,

What version of OS X are you running?

Also, just to see, does activating your environment and then running this command:

CDPATH= R -e 'source("https://bioconductor.org/biocLite.R"); biocLite("dada2")'

fix the issue?

We still don't really know what's going on and we're trying to narrow it down. Thanks for your patience!

1 Like

Hi @ebolyen,
I try running the command in qiime2 environment but I still have the same issue.

Just posting to say I am having the same error in linux (albeit I actually have no idea which version, as its a remote machine I'm ssh-ing into).

EDIT: Ubuntu 16.04.3 LTS is what the server is running

qiime dada2 denoise-paired \
> --i-demultiplexed-seqs Demux.qza \
> --p-trunc-len-f 260 \
> --p-trunc-len-r 170 \
> --p-trim-left-f 0 \
> --p-trim-left-r 0 \
> --p-n-threads 0 \
> --o-table Table.qza \
> --o-representative-sequences RepSeqs.qza \
> --verbose
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/tmp7w2un0h7/forward /tmp/tmp7w2un0h7/reverse /tmp/tmp7w2un0h7/output.tsv.biom /tmp/tmp7w2un0h7/filt_f /tmp/tmp7w2un0h7/filt_r 260 170 0 0 2.0 2 consensus 1.0 0 1000000

R version 3.4.1 (2017-06-30)
Loading required package: Rcpp
DADA2 R package version: 1.6.0
1) Filtering .
2) Learning Error Rates
2a) Forward Reads
Initializing error rates to maximum possible estimate.
Sample 1 - 98918 reads in 45091 unique sequences.

 *** caught segfault ***
address 0x8, cause 'memory not mapped'

Traceback:
 1: .Call("_dada2_dada_uniques", PACKAGE = "dada2", seqs, abundances,     err, quals, score, gap, use_kmers, kdist_cutoff, band_size,     omegaA, max_clust, min_fold, min_hamming, min_abund, use_quals,     final_consensus, vectorized_alignment, homo_gap, multithread,     verbose, SSE)
 2: dada_uniques(names(derep[[i]]$uniques), unname(derep[[i]]$uniques),     err, qi, opts[["SCORE_MATRIX"]], opts[["GAP_PENALTY"]], opts[["USE_KMERS"]],     opts[["KDIST_CUTOFF"]], opts[["BAND_SIZE"]], opts[["OMEGA_A"]],     if (initializeErr) {        1    } else {        opts[["MAX_CLUST"]]    }, opts[["MIN_FOLD"]], opts[["MIN_HAMMING"]], opts[["MIN_ABUNDANCE"]],     TRUE, FALSE, opts[["VECTORIZED_ALIGNMENT"]], opts[["HOMOPOLYMER_GAP_PENALTY"]],     multithread, (verbose >= 2), opts[["SSE"]])
 3: dada(drpsF, err = NULL, selfConsist = TRUE, multithread = multithread,     VECTORIZED_ALIGNMENT = FALSE, SSE = 2)
An irrecoverable exception occurred. R is aborting now ...
Traceback (most recent call last):
  File "/home/ubuntu/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/q2_dada2/_denoise.py", line 179, in denoise_paired
    run_commands([cmd])
  File "/home/ubuntu/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/ubuntu/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/tmp7w2un0h7/forward', '/tmp/tmp7w2un0h7/reverse', '/tmp/tmp7w2un0h7/output.tsv.biom', '/tmp/tmp7w2un0h7/filt_f', '/tmp/tmp7w2un0h7/filt_r', '260', '170', '0', '0', '2.0', '2', 'consensus', '1.0', '0', '1000000']' returned non-zero exit status -11

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/q2cli/commands.py", line 224, in __call__
    results = action(**arguments)
  File "<decorator-gen-354>", line 2, in denoise_paired
  File "/home/ubuntu/miniconda3/envs/qiime2-2017.12/lib/python3.5/site-packages/qiime2/sdk/action.py", line 228, in bound_callable
    output_types, provenance)
  File "/home/ubuntu/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/ubuntu/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 -11), please inspect stdout and stderr to learn more.

Plugin error from dada2:

  An error was encountered while running DADA2 in R (return code -11), please inspect stdout and stderr to learn more.

See above for debug info.

Weirdly it is not happening when I run:

qiime dada2 denoise-paired \
	--i-demultiplexed-seqs Demux.qza \
	--p-trunc-len-f 230 \
	--p-trunc-len-r 150 \
	--p-trim-left-f 0 \
	--p-trim-left-r 0 \
	--p-n-threads 0 \
	--o-table Table.qza \
	--o-representative-sequences RepSeqs.qza \
	--verbose

Even stranger its not happening in my linux virtual box VM.

EDIT: trunc lengths of 250 and 160 also work?!

Hi all,

I've got the same error yesterday when I was trying to run dada2 on a HPC cluster. I've added a .Rprofile file to the home directory and then ran this command. It seems like this works fine for me. It has been an hour and the job is still running. So my question is do I have to run this command (reinstall dada2) every time when I want to use it? Thanks.

We think we found the bug, and indeed it only arises when the trimmed/truncated sequences are >259 nts. (which is why I missed it in testing, my test data was all 250nts or less)

The fix has already been checked in: BUG: change SSE mode to avoid segfault (#82) Β· qiime2/q2-dada2@0a5cdbb Β· GitHub

So the 2018.1 release should have this fixed. But the Q2 team might have some guidance on a patched version of 2017.12, I'm not sure. An immediate workaround would be to keep all truncation lengths 255nts or less.

3 Likes

We have just released a patched update to q2-dada2 that appears to fix this :crossed_fingers: . Please follow the instructions here to get your hands on the patch, and please let us know how it goes! Thanks so much for all the support while we were debugging this! :t_rex:

3 Likes

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