The bioBakery help forum

Workflow conda install: bowtie 2 issue ("/bowtie2-align-s: error while loading shared libraries: libtbb.so.2)

I have created a conda install of the workflow using the following commands:

conda create -n env_name -c bioconda python=3.7
conda activate env_name
conda install -c biobakery biobakery_workflows
pip install leveldb

I try to run the wmgx workflow on demo data using the follow (each flag seems to be required for my install of the workflow to attempt a run):

biobakery_workflows wmgx --input fastq/ --output demo_out/ --bypass-strain-profiling --local-jobs 6 --threads 2 --qc-options="--trimmomatic=/data/Microbiome/RefData/Metagenomics/biobakery_workflows_databases/Trimmomatic-0.39/"  --functional-profiling-options="--nucleotide-database /data/Microbiome/RefData/Metagenomics/biobakery_workflows_databases/humann/humann_database/chocophlan/ --protein-database /data/Microbiome/RefData/Metagenomics/biobakery_workflows_databases/humann/uni_db/uniref"

I get the following error:

Task 7 failed
 Name: kneaddata____LD96R2_subsample
 Original error:
 Error executing action 0. Original Exception:
 Traceback (most recent call last):
   File "/home/emilyw/.conda/envs/shotgun_134/lib/python3.7/site-packages/anadama2/runners.py", line 201, in _run_task_locally
     action_func(task)
   File "/home/emilyw/.conda/envs/shotgun_134/lib/python3.7/site-packages/anadama2/helpers.py", line 89, in actually_sh
     ret = _sh(s, **kwargs)
   File "/home/emilyw/.conda/envs/shotgun_134/lib/python3.7/site-packages/anadama2/util/__init__.py", line 320, in sh
     raise ShellException(proc.returncode, msg.format(cmd, ret[0], ret[1]))
 anadama2.util.ShellException: [Errno 1] Command `kneaddata --input /home/emilyw/biobakery_demo/fastq/LD96R2_subsample.fastq.gz --output /home/emilyw/biobakery_demo/demo_out/kneaddata/main --threads 2 --output-prefix LD96R2_subsample   --reference-db /software/biobakery/biobakery_workflows_databases/kneaddata_db_human_genome --trimmomatic=/data/Microbiome/RefData/Metagenomics/biobakery_workflows_databases/Trimmomatic-0.39/ --serial --run-trf  && mv /home/emilyw/biobakery_demo/demo_out/kneaddata/main/LD96R2_subsample.repeats.removed.fastq /home/emilyw/biobakery_demo/demo_out/kneaddata/main/LD96R2_subsample.fastq' failed.
 Out: b'Decompressing gzipped file ...\n\nInitial number of reads ( /home/emilyw/biobakery_demo/demo_out/kneaddata/main/decompressed_2jyhcrre_LD96R2_subsample.fastq ): 108134.0\nRunning Trimmomatic ... \nTotal reads after trimming ( /home/emilyw/biobakery_demo/demo_out/kneaddata/main/LD96R2_subsample.trimmed.fastq ): 108119.0\nDecontaminating ...\nRunning bowtie2 ... \nError executing: /home/emilyw/.conda/envs/shotgun_134/bin/bowtie2 --threads 2 --very-sensitive --phred33 -x /software/biobakery/biobakery_workflows_databases/kneaddata_db_human_genome/Homo_sapiens_demo -U /home/emilyw/biobakery_demo/demo_out/kneaddata/main/LD96R2_subsample.trimmed.fastq --un /home/emilyw/biobakery_demo/demo_out/kneaddata/main/LD96R2_subsample_Homo_sapiens_demo_bowtie2_clean.fastq --al /home/emilyw/biobakery_demo/demo_out/kneaddata/main/LD96R2_subsample_Homo_sapiens_demo_bowtie2_contam.fastq -S /dev/null\n\nError message returned from bowtie2 :\n/home/emilyw/.conda/envs/shotgun_134/bin/bowtie2-align-s: error while loading shared libraries: libtbb.so.2: cannot open shared object file: No such file or directory\n(ERR): Description of arguments failed!\nExiting now ...\n\nSubprocess reported error. Please see log file for more details.\n'
 Err: b''

When I run bowtie2 -h, I get:

/home/emilyw/.conda/envs/shotgun_134/bin/bowtie2-align-s: error while loading shared libraries: libtbb.so.2: cannot open shared object file: No such file or directory
(ERR): Description of arguments failed!
Exiting now ...

Based on this post I found online, I had a server administrator sudo install the TBB library, but this did not solve the issue. I then tried to uninstall the bowtie2 that came with the workflow/kneaddata (conda remove bowtie2), but I would have to delete all the workflow software for conda to successfully remove bowtie2.

I decided to try to manually delete bowtie2 from my conda directories by deleting the executable from ./conda/pkgs/bowtie2* then reinstall bowtie2 with conda, but this also did not solve the problem.

I’m not sure else how I can troubleshoot this problem. It seems to be an issue with the conda install of bowtie2 as part of the workflow. Note that two weeks ago, I didn’t have this problem, but since trying to recreate the conda env. using the steps above, this problem has arisen. Was there by chance a new update in that time?

update: I was able to get around this by just running the following in a new env:
conda install -c biobakery biobakery_workflows
conda install tbb=2020.2

I’m using humann version 3.0.0.alpha.3 and biobakery_workflows version 3.0.0-alpha.7. I get an error now where the biobakery_workflow tries to create the esc.csv files at the end using humann_regroup_table uniref90_level4ec instead of uniref90_rxn, so I’ll keep investigating that at least the workflow runs now!

I had a similar issue while installing panphlan 3.1 with conda:

~/miniconda3/envs/bowtie2/bin/bowtie2-align-s: symbol lookup error:
~/miniconda3/envs/bowtie2/bin/bowtie2-align-s: undefined symbol: _ZN3tbb10interface78internal15task_arena_base19internal_initializeEv
(ERR): Description of arguments failed!
Exiting now ...

Downgrading tbb as described above worked for me as well. Commenting in case anyone comes across this post while looking for panphlan support.