Biobakery_Workflows wmgx: TypeError

I’m getting the following error from the wmgx workflow when I ran it on our metagenomes… can anyone advise where the issue might be?

(mphlan) [scotta@biocomp-2-1 Jess_Chicken]$ biobakery_workflows wmgx --input MPhlan_Input --output MPhlan_Output --pair-identifier _R1_001. --threads 32
Traceback (most recent call last):
File “/home/AAFC-AAC/scotta/miniconda3/envs/mphlan/bin/wmgx.py”, line 183, in
workflow.go()
File “/home/AAFC-AAC/scotta/miniconda3/envs/mphlan/lib/python3.7/site-packages/anadama2/workflow.py”, line 775, in go
task_idxs = nx.algorithms.dag.topological_sort(self.dag, reverse=True)
TypeError: topological_sort() got an unexpected keyword argument ‘reverse’

Hello, Thank you for including the detailed error message. The error is from a dependency of the workflows (AnADAMA2 which requires networkx). If you roll back your install of the python package networkx to < v2.0 it should resolve the issue. We will also work on our end to update AnADAMA2 to work with the latest version of networkx.

Thank you,
Lauren

Hi Lauren, thanks for that info. Rolled it back and it seems to be working but now I am getting the following errors after running the following command, any suggestions? It looks like it’s having issues with Trimmomatic…

biobakery_workflows --input MPhlan_Input --output MPhlan_Output --threads 32 --pair-identifier R1 --qc-options="–trimmomatic /home/AAFC-AAC/scotta/miniconda3/envs/mphlan/bin/trimmomatic"

Task 105 failed
Name: kneaddata____31482_S8_L001_R1_001
Original error:
Error executing action 0. Original Exception:
Traceback (most recent call last):
File “/home/AAFC-AAC/scotta/miniconda3/envs/mphlan/lib/python3.7/site-packages/anadama2/runners.py”, line 201, in _run_task_locally
action_func(task)
File “/home/AAFC-AAC/scotta/miniconda3/envs/mphlan/lib/python3.7/site-packages/anadama2/helpers.py”, line 89, in actually_sh
ret = _sh(s, **kwargs)
File “/home/AAFC-AAC/scotta/miniconda3/envs/mphlan/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 /isilon/london-rdc/users/scotta/Jess_Chicken/MPhlan_Input/31482_S8_L001_R1_001.fastq.gz --output /isilon/london-rdc/users/scotta/Jess_Chicken/MPhlan_Output/kneaddata/main --threads 32 --output-prefix 31482_S8_L001_R1_001 --reference-db /home/AAFC-AAC/scotta/biobakery_workflows_databases/kneaddata_db_human_genome --trimmomatic /home/AAFC-AAC/scotta/miniconda3/envs/mphlan/bin/trimmomatic --serial --run-trf && mv /isilon/london-rdc/users/scotta/Jess_Chicken/MPhlan_Output/kneaddata/main/31482_S8_L001_R1_001.repeats.removed.fastq /isilon/london-rdc/users/scotta/Jess_Chicken/MPhlan_Output/kneaddata/main/31482_S8_L001_R1_001.fastq’ failed.
Out: b’’
Err: b’ERROR: Unable to list files in trimmomatic directory: /home/AAFC-AAC/scotta/miniconda3/envs/mphlan/bin/trimmomatic\n’

Task 163 failed
Name: metaphlan____31482_S8_L001_R1_001
Original error:
Task failed because parent task 105' failed Task 501 failed Name: strainphlan_sample2markers____31482_S8_L001_R1_001 Original error: Task failed because parent task 163’ failed
Task 220 failed
Name: humann____31482_S8_L001_R1_001
Original error:
Task failed because parent task 105' failed Task 275 failed Name: humann_regroup_UniRef2EC____31482_S8_L001_R1_001 Original error: Task failed because parent task 220’ failed
Task 386 failed
Name: humann_renorm_ecs_relab____31482_S8_L001_R1_001
Original error:
Task failed because parent task 275' failed Task 332 failed Name: humann_renorm_genes_relab____31482_S8_L001_R1_001 Original error: Task failed because parent task 220’ failed

Hi, I am glad to hear that fixed the original error. Thank you for the detailed follow up. I think if you provide the folder containing the “trimmomatic.jar” file as the option it should resolve the issue. Alternatively you could add the folder with the “trimmomatic.jar” file to your $PATH and remove the “–trimmomatic” option from your run command. Either should hopefully resolve the error you are seeing.

Thank you,
Lauren

Hi Lauren,

That did the trick! Everything ran perfectly, and I got a complete analysis. I went to work on another dataset, following the same procedure and command and I got the following error, so if you could help it would be appreciated!

(mphlan) [scotta@biocomp-0-3 TCAG_Macrolide_2020]$ biobakery_workflows wmgx --input Raw_Reads --output Macrolide_Output --threads 32 --pair-identifier _R1
Traceback (most recent call last):
File “/home/AAFC-AAC/scotta/miniconda3/envs/mphlan/bin/wmgx.py”, line 30, in
from anadama2 import Workflow
File “/home/AAFC-AAC/scotta/miniconda3/envs/mphlan/lib/python3.7/site-packages/anadama2/init.py”, line 83, in
from .workflow import Workflow
File “/home/AAFC-AAC/scotta/miniconda3/envs/mphlan/lib/python3.7/site-packages/anadama2/workflow.py”, line 17, in
import networkx as nx
File “/home/AAFC-AAC/scotta/miniconda3/envs/mphlan/lib/python3.7/site-packages/networkx/init.py”, line 61, in
import networkx.generators
File “/home/AAFC-AAC/scotta/miniconda3/envs/mphlan/lib/python3.7/site-packages/networkx/generators/init.py”, line 16, in
from networkx.generators.intersection import *
File “/home/AAFC-AAC/scotta/miniconda3/envs/mphlan/lib/python3.7/site-packages/networkx/generators/intersection.py”, line 5, in
from networkx.algorithms import bipartite
File “/home/AAFC-AAC/scotta/miniconda3/envs/mphlan/lib/python3.7/site-packages/networkx/algorithms/init.py”, line 79, in
import networkx.algorithms.tree
File “/home/AAFC-AAC/scotta/miniconda3/envs/mphlan/lib/python3.7/site-packages/networkx/algorithms/tree/init.py”, line 6, in
from .decomposition import *
File “/home/AAFC-AAC/scotta/miniconda3/envs/mphlan/lib/python3.7/site-packages/networkx/algorithms/tree/decomposition.py”, line 5, in
from networkx.algorithms import moral, complete_to_chordal_graph, chordal_graph_cliques
ImportError: cannot import name ‘complete_to_chordal_graph’ from ‘networkx.algorithms’ (/home/AAFC-AAC/scotta/miniconda3/envs/mphlan/lib/python3.7/site-packages/networkx/algorithms/init.py)

I am glad to hear it worked! It looks like the new error is an issue with your networkx install. Try uninstalling and reinstalling networkx to resolve the issue.

Thanks!
Lauren

Hello,
I have the same problem, with a biobakery_workflows conda environment installation. I tried to install a previous version of networkx (1.11) but there is an incompatibilty with the python installed (3.9). Do you have a solution to be able to run the pipeline?
Thank you for the help

1 Like