The bioBakery help forum

Merge_metaphlan_tables.py UnboundLocalError

There is an error when running merge_metaphlan_tables.py *.rel_ab_w_read_stats.clade_profiles.txt -o merged.rel_ab_w_read_stats.clade_profiles.txt. Same error whether I use -o or >. Output files are in rel_ab_w_read_stats format. I recently installed metaphlan via conda biobakery

Traceback (most recent call last):
  File "/home/amirza/.conda/envs/biobakery3/bin/merge_metaphlan_tables.py", line 10, in <module>
    sys.exit(main())
  File "/home/amirza/.conda/envs/biobakery3/lib/python3.7/site-packages/metaphlan/utils/merge_metaphlan_tables.py", line 81, in main
    merge(args.aistms, fout)
  File "/home/amirza/.conda/envs/biobakery3/lib/python3.7/site-packages/metaphlan/utils/merge_metaphlan_tables.py", line 46, in merge
    names = names,
UnboundLocalError: local variable 'names' referenced before assignment

Can you replace your merge_metaphlan_tables.py from the one present in the repository?
Another user reported the same problem here, I posted a solution a couple of weeks ago.