Picrust2 - fragment-insertion error

Hello all,

I love that Qiime2 is working in plugins from outside developers. While working on the new plugin to run Picrust2, I came across this error while trying to insert the reference sequences, sequences, and phylogeny into the pipeline.

Command ‘[‘run-sepp.sh’, ‘/tmp/qiime2-archive-pdq9qqez/5d9b382b-c735-4659-a7b7-1ce12127a7cc/data/dna-sequences.fasta’, ‘q2-fragment-insertion’, ‘-x’, ‘1’, ‘-A’, ‘1000’, ‘-P’, ‘5000’, ‘-a’, ‘/tmp/qiime2-archive-q5zptwhb/6e317993-c994-454b-becd-4606de3e1caf/data/aligned-dna-sequences.fasta’, ‘-t’, ‘/tmp/qiime2-archive-0wdktzq4/f3bc220d-dae4-4dc0-8c4c-dfc3f03c25b1/data/tree.nwk’]’ returned non-zero exit status 1

If anyone has time to help work through this error message with me, it would be greatly appreciated.

Hi @ereinhar,
Let’s see what @gmdouglas thinks. In the mean time, please post the following:

  1. the full error message (including the contents of any log files that are mentioned in the error report
  2. the QIIME 2 command that you are trying to use
1 Like

Hi @ereinhar,

I’m the developer of this plugin - I’m not sure what the problem is currently, but I’ll likely be able to help if you post the details requested above.

Best,

Gavin

2 Likes

Hello @Nicholas_Bokulich and @gmdouglas. Thank you for helping out for the expedience, the help is incredibly appreicated.

The full command and verbose output:

(qiime2-2018.8) [ereinhar@node1045 scratch]$ qiime fragment-insertion sepp --i-representative-sequences rep-seqs.qza \
>                               --p-threads 1 --i-reference-alignment aligned-rep-seqs.qza \
>                               --i-reference-phylogeny rooted-tree.qza \
>                               --output-dir tutorial_placed_out --verbose
Removing /tmp/tmp.iwpI1rP40p/sepp-tmp-WQiWO
Traceback (most recent call last):
  File "/users/ereinhar/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/q2cli/commands.py", line 274, in __call__
    results = action(**arguments)
  File "<decorator-gen-286>", line 2, in sepp
  File "/users/ereinhar/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/qiime2/sdk/action.py", line 231, in bound_callable
    output_types, provenance)
  File "/users/ereinhar/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/qiime2/sdk/action.py", line 362, in _callable_executor_
    output_views = self._callable(**view_args)
  File "/users/ereinhar/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/q2_fragment_insertion/_insertion.py", line 179, in sepp
    reference_alignment, reference_phylogeny, debug)
  File "/users/ereinhar/miniconda3/envs/qiime2-2018.8/lib/python3.5/site-packages/q2_fragment_insertion/_insertion.py", line 137, in _run
    subprocess.run(cmd, check=True, cwd=cwd)
  File "/users/ereinhar/miniconda3/envs/qiime2-2018.8/lib/python3.5/subprocess.py", line 398, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['run-sepp.sh', '/tmp/qiime2-archive-kzwg9l2x/5d9b382b-c735-4659-a7b7-1ce12127a7cc/data/dna-sequences.fasta', 'q2-fragment-insertion', '-x', '1', '-A', '1000', '-P', '5000', '-a', '/tmp/qiime2-archive-fz990c7i/6e317993-c994-454b-becd-4606de3e1caf/data/aligned-dna-sequences.fasta', '-t', '/tmp/qiime2-archive-47pqihxn/f3bc220d-dae4-4dc0-8c4c-dfc3f03c25b1/data/tree.nwk']' returned non-zero exit status 1

Plugin error from fragment-insertion:

  Command '['run-sepp.sh', '/tmp/qiime2-archive-kzwg9l2x/5d9b382b-c735-4659-a7b7-1ce12127a7cc/data/dna-sequences.fasta', 'q2-fragment-insertion', '-x', '1', '-A', '1000', '-P', '5000', '-a', '/tmp/qiime2-archive-fz990c7i/6e317993-c994-454b-becd-4606de3e1caf/data/aligned-dna-sequences.fasta', '-t', '/tmp/qiime2-archive-47pqihxn/f3bc220d-dae4-4dc0-8c4c-dfc3f03c25b1/data/tree.nwk']' returned non-zero exit status 1
1 Like

Hi @ereinhar,

Thanks for posting these details. What do aligned-rep-seqs.qza and rooted-tree.qza correspond to in your command? If you want to place ASVs for use with PICRUSt2 then you should place them into the PICRUSt2 reference files (reference.fna.qza and reference.tre.qza) in the q2-picrust2 tutorial: https://github.com/picrust/picrust2/wiki/q2-picrust2-Tutorial

Gavin

Hi @gmdouglas, I'm having the same issue when trying to run my rep-seqs.qza with the references files (qiime v2018.11)

qiime fragment-insertion sepp \
 --i-representative-sequences rep_seqs.qza \
 --p-threads 10 \
 --i-reference-alignment reference.fna.qza \
 --i-reference-phylogeny reference.tre.qza \
 --output-dir fragment_insertion

And getting this error:

Plugin error from fragment-insertion:

Command ‘[‘run-sepp.sh’, ‘/home/ubuntu/linaqiimefiles/HealthyD/qiime2-archive-x43sce73/baad438c-4bca-4720-92b4-d43bb1ce65b6/data/dna-sequences.fasta’, ‘q2-fragment-insertion’, ‘-x’, ‘1’, ‘-A’, ‘1000’, ‘-P’, ‘5000’]’ returned non-zero exit status 1

Attached is the debug info log file.

Thanks!new 1.txt (1.5 KB)

Hi there,

It’s hard to troubleshoot this issue without a more informative error. However, I think the two major things to check are:

  1. That your “rep_seqs.qza” file is a FASTA file. Feel free to send this to me if you want help troubleshooting.

  2. fragment-insertion is installed correctly and the two reference files were downloaded correctly. You could confirm you get the same output in the tutorial I wrote here: https://github.com/picrust/picrust2/wiki/q2-picrust2-Tutorial

Hello and thank you for this great plugin!
I ran into the same error:

(qiime2-2018.11) ➜ q2-picrust2_PSC qiime fragment-insertion sepp --i-representative-sequences rep-seqs-merged.qza
–p-threads 1 --i-reference-alignment reference.fna.qza
–i-reference-phylogeny reference.tre.qza
–output-dir Picrust_Results --verbose
Removing /var/folders/k6/6hcwnkcn099frbhql59cjg900000gn/T/sepp-tmp-XXXXX.v5cuYeYV
Traceback (most recent call last):
File “/Users/lenalapidot/miniconda2/envs/qiime2-2018.11/lib/python3.5/site-packages/q2cli/commands.py”, line 274, in call
results = action(**arguments)
File “”, line 2, in sepp
File “/Users/lenalapidot/miniconda2/envs/qiime2-2018.11/lib/python3.5/site-packages/qiime2/sdk/action.py”, line 231, in bound_callable
output_types, provenance)
File “/Users/lenalapidot/miniconda2/envs/qiime2-2018.11/lib/python3.5/site-packages/qiime2/sdk/action.py”, line 362, in callable_executor
output_views = self._callable(**view_args)
File “/Users/lenalapidot/miniconda2/envs/qiime2-2018.11/lib/python3.5/site-packages/q2_fragment_insertion/_insertion.py”, line 179, in sepp
reference_alignment, reference_phylogeny, debug)
File “/Users/lenalapidot/miniconda2/envs/qiime2-2018.11/lib/python3.5/site-packages/q2_fragment_insertion/_insertion.py”, line 137, in _run
subprocess.run(cmd, check=True, cwd=cwd)
File “/Users/lenalapidot/miniconda2/envs/qiime2-2018.11/lib/python3.5/subprocess.py”, line 398, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ‘[‘run-sepp.sh’, ‘/var/folders/k6/6hcwnkcn099frbhql59cjg900000gn/T/qiime2-archive-f7x4q8_q/653c2d02-8488-47fa-b74b-85664abdad14/data/dna-sequences.fasta’, ‘q2-fragment-insertion’, ‘-x’, ‘1’, ‘-A’, ‘1000’, ‘-P’, ‘5000’, ‘-a’, ‘/var/folders/k6/6hcwnkcn099frbhql59cjg900000gn/T/qiime2-archive-mvzzt5yb/87909524-fa4f-4b28-abd6-c7c89a3c7da7/data/aligned-dna-sequences.fasta’, ‘-t’, ‘/var/folders/k6/6hcwnkcn099frbhql59cjg900000gn/T/qiime2-archive-tfsejey7/f4e69728-a745-4069-b432-3f14951089fd/data/tree.nwk’]’ returned non-zero exit status 1

Plugin error from fragment-insertion:

Command ‘[‘run-sepp.sh’, ‘/var/folders/k6/6hcwnkcn099frbhql59cjg900000gn/T/qiime2-archive-f7x4q8_q/653c2d02-8488-47fa-b74b-85664abdad14/data/dna-sequences.fasta’, ‘q2-fragment-insertion’, ‘-x’, ‘1’, ‘-A’, ‘1000’, ‘-P’, ‘5000’, ‘-a’, ‘/var/folders/k6/6hcwnkcn099frbhql59cjg900000gn/T/qiime2-archive-mvzzt5yb/87909524-fa4f-4b28-abd6-c7c89a3c7da7/data/aligned-dna-sequences.fasta’, ‘-t’, ‘/var/folders/k6/6hcwnkcn099frbhql59cjg900000gn/T/qiime2-archive-tfsejey7/f4e69728-a745-4069-b432-3f14951089fd/data/tree.nwk’]’ returned non-zero exit status 1

See above for debug info.

Where is my mistake?
Thank you,
Lena

Hi there,

Sorry I should have posted the solution here, but for the above reported issue it turned out that multiple fields in the FASTA file header lines was causing problems with q2-fragment-insertion.

When I ran this command on the exported ASV FASTA:
awk ‘{ print $1 }’ dna-sequences.fasta > dna-sequences-renamed.fasta

The command worked after re-importing the file. If that doesn’t work then feel free to send me the files privately!

Best,

Gavin

Thank’s for the quick response.
I tried to run the command on the tutorial data and also got the same error…
I tried to delete q2-fragment-insertion and picrust2 plugin and re-install and re-run, but still it doesn’t seem to work.
I’ll be happy to send the files privately…

Also, should I run this command on the fasta files? Not rep-seqs.qza?

Yes that grep command would only work on the exported FASTA. Feel free to send me the files privately if you’re still having problems.

Best,

Gavin

So… in this example:

qiime fragment-insertion sepp --i-representative-sequences mammal_seqs.qza \
                              --p-threads 1 --i-reference-alignment reference.fna.qza \
                              --i-reference-phylogeny reference.tre.qza \
                              --output-dir tutorial_placed_out

I should input the fasta files in the --i-representative sequences?
I’m a little confused…

No sorry I was referring to the grep command only (i.e. a non-qiime2 command). In contrast, qiime2 command can only be used with qiime2 artifact files so you need to specify the qza file. Just so you know the qza just means that it is a zipped folder, which in the case of representative sequences contains the FASTA and a file keeping track of the provenance.

Best,

Gavin

Got it.
So, how can I send you my files privately?

Thanks,
Lena

You can send a direct message through the forum. Click on @gmdouglas's (or any user's) profile image and you will see something like this:

Click on the "message" button to send your data in a private message.

1 Like

Thanks for sending me your rep seqs QZA file. I was able to place these sequences into the PICRUSt2 reference phylogeny so I’m not sure what the problem was. I will send you this output file privately.

Note that your FASTA is a strange format: the ids and the sequences themselves are identical, e.g.:

>ACGTGA
ACGTGA
>GTGGA
GTGGA

However, since all of the sequences are unique they are valid ids for the purposes of this tool.

Best,

Gavin

Ok, thank you so much for the help!

I ran the command for the custom-tree-pipeline and it worked!
Again, thank you for the help.

I have some more questions:

  1. What does this mean that the ids and the sequences themselves are identical?
  2. I wanted to do more detailed analyses then the ordination plots. Can I do non-phylogenetic alpha and beta analyses in this case?

Good!

  1. Usually sequence ids are something like “>seq1”; in this case the sequences themselves are the sequences themselves. This shouldn’t cause any problems with PICRUSt2, but it’s just a little unusual so I thought I’d mention it in case it wasn’t the intended result.

  2. Yes you can run non-phylogenetic alpha and beta diversity analyses on the output feature table.

Best,

Gavin