The docs at GitHub - biobakery/humann: HUMAnN 3.0 is the next generation of HUMAnN 1.0 (HMP Unified Metabolic Analysis Network). state that:
g__Bacteroides|s__Bacteroides_thetaiotaomicron 12.16326
g__Bacteroides|s__Bacteroides_cellulosilyticus 12.02768
g__Bacteroides|s__Bacteroides_caccae 11.43394
g__Dialister|s__Dialister_invisus 10.52286
g__Bacteroides|s__Bacteroides_stercoris 10.42227
is an example of a valid taxonomic profile.
If one includes a blank line at the end of the profile (or a similar slight difference from the prescribed format, then the error generated by humann3 is:
ERROR: The MetaPhlAn taxonomic profile provided was not generated with the expected database version. Please update your version of MetaPhlAn to at least v3.0.
The code is:
def get_abundance(line):
"""
Read in the abundance value from the taxonomy file
"""
try:
data=line.split("\t")
if data[-1].replace(".","").replace("e-","").isdigit():
read_percent=float(data[-1])
else:
read_percent=float(data[-2])
except ValueError:
message="The MetaPhlAn taxonomic profile provided was not generated with the expected database version. Please update your version of MetaPhlAn to at least v3.0."
logger.error(message)
sys.exit("\n\nERROR: "+message)
It would help to include a more clear error message (e.g., acknowledging that the profile might not originate from metaphlan).
It would also help to be more flexible with the formatting (e.g., skipping blank lines during the file parsing).