# Get\_counts\_from\_humann\_logs.py crashes with ValueError when MetaPhlAn 3.0.13 emits \[WARNING\] lines into HUMAnN log (biobakery\_workflows 3.1)

**URL:** <https://forum.biobakery.org/t/get-counts-from-humann-logs-py-crashes-with-valueerror-when-metaphlan-3-0-13-emits-warning-lines-into-humann-log-biobakery-workflows-3-1/8796>\
**Category:** bioBakery workflows\
**Created:** [February 25, 2026, 5:13am UTC](https://forum.biobakery.org/t/get-counts-from-humann-logs-py-crashes-with-valueerror-when-metaphlan-3-0-13-emits-warning-lines-into-humann-log-biobakery-workflows-3-1/8796 "2026-02-25T05:13:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brycealong](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/brycealong/32/3575_2.png) [@Brycealong](https://forum.biobakery.org/u/Brycealong)\
**Post date:** [February 25, 2026, 5:13am UTC](https://forum.biobakery.org/t/get-counts-from-humann-logs-py-crashes-with-valueerror-when-metaphlan-3-0-13-emits-warning-lines-into-humann-log-biobakery-workflows-3-1/8796/1 "2026-02-25T05:13:04Z")

</div>

# `get_counts_from_humann_logs.py` crashes with `ValueError` when MetaPhlAn 3.0.13 emits `[WARNING]` lines into HUMAnN log

## Environment

| Package | Version |
| --- | --- |
| biobakery\_workflows | 3.1 |
| metaphlan | 3.0.13 (27 Jul 2021) |
| humann | 3.9 |
| kneaddata | 0.12.4 |
| Python | 3.10 |
| OS | Linux x86\_64 (TSCC HPC, Rocky Linux 9) |

* * *

## What happens

The `wmgx` workflow fails at the `humann_count_alignments_species` task with:

```auto
anadama2.util.ShellException: Command `get_counts_from_humann_logs.py \
  --input .../humann/main \
  --output .../humann/counts/humann_read_and_species_count_table.tsv` failed.

Traceback (most recent call last):
  File "get_counts_from_humann_logs.py", line 79, in <module>
    main()
  File "get_counts_from_humann_logs.py", line 59, in main
    data[1]=int(line.split()[7][2:])
ValueError: invalid literal for int() with base 10: '[WARNING]'

```

* * *

## Root cause

MetaPhlAn 3.0.13 emits these lines to stderr during its run, which get captured into the HUMAnN log file:

```auto
[WARNING] Failed to launch x86-64-v3 version, staying with default
[WARNING] Failed to launch x86-64-v3 version, staying with default
[WARNING] Failed to launch x86-64-v3 version, staying with default
[WARNING] Failed to launch x86-64-v3 version, staying with default
WARNING: The metagenome profile contains clades that represent multiple species
merged into a single representant. An additional column listing the merged
species is added to the MetaPhlAn output.

```

`get_counts_from_humann_logs.py` parses the HUMAnN log using a hardcoded positional index (`line.split()[7]`). When it hits a `[WARNING]` line, `line.split()[7]` returns `'[WARNING]'` instead of an integer, causing the crash.

* * *

## Impact

Everything else completes successfully — kneaddata, metaphlan taxonomic profiling, humann functional profiling, all join/regroup/renorm tables are all generated. Only `humann_read_and_species_count_table.tsv` is missing because of this crash.

* * *

## Questions

1. Is this a known issue? Should `get_counts_from_humann_logs.py` be updated to skip lines containing `[WARNING]` before doing positional field parsing?
2. Is there a safe workaround — e.g., manually patching line 59 to filter `[WARNING]` lines — while waiting for a fix?

The log and the job script are attached.

[anadama4.log.txt](https://forum.biobakery.org/uploads/short-url/dnu35vcX0VyBysUJnuEeOP5JTMM.txt) (29.9 KB)  
[biobakery\_workflows\_demo.sb.txt](https://forum.biobakery.org/uploads/short-url/30HanuYQVtWuT3GbojWERdKkuXj.txt) (1.3 KB)

Thanks for any help.
