Hi all,
I am trying to run a python script from Earth Microbiome Project (EMP), summarize_otu_distributions.py, to produce otu distribution data from a biom table exported from Qiime2 (2021.2) feature table artifact (dada2 pipeline with --p-no-hashed-feature-ids option). I got the follow error messages:
Traceback (most recent call last):
File "summarize_otu_distributions.py", line 61, in <module>
make_otu_summary(path_table, path_otu_summary)
File "summarize_otu_distributions.py", line 21, in make_otu_summary
otu_tax = {i: '; '.join(md['taxonomy']) for v, i, md in table.iter(axis='observation')}
File "summarize_otu_distributions.py", line 21, in <dictcomp>
otu_tax = {i: '; '.join(md['taxonomy']) for v, i, md in table.iter(axis='observation')}
TypeError: 'NoneType' object is not subscriptable
I tried one EMP project biom table and it worked fine. I also compared my biom table and EMP biom table with biom head
and they appear to have same data structure:
My biom table -
# Constructed from biom file
#OTU ID Amb_M_cam_g287-1 Amb_M_cam_g287-2 Amb_M_cam_g287-3 Amb_M_obe_g166-2 Dol_T_alb_k324-2
TACGGAGGGTGCAAGCGTTAATCGGAATTACTGGGCGTAAAGAGTACGTAGGTGGCTTATTAAGTCAGATGTGAAATCCCTGAGCTCAACTTAGGAACTGCATTTGAAACTGATAATGCTAGAGTTTCGTAGAGGGGGGTAGAATTCCAGGTGTAGCGGTGAAATGCGTAGAGATCTGGAGGAATACCAGTGGCGAAGGCGGCCCCCTGGACGAAAACTGACACTCAGGTACGAAAGCATGGGGAGCAAACAGG 0.0 0.0 0.0 0.0 0.0
TACGAAGGGGGCGAGCGTTGCTCGGAATGACTGGGCGTAAAGGGCGTGTAGGCGGTTTAATGCTGTCAGATGTGAAATTTTTGGGCTTAACCTGAAACGTGCATTTGAAACGGTTAGACTAGAGTTCGAGAGAGGATAGCGGAATTCCCAGTGTAGAGGTGAAATTCGTAGATATTGGGAAGAACACCGGTTGCGAAGGCGGCTATCTGGCTCGACACTGACGCTGAGGCGCGAAAGCGTGGGGAGCAAACAGG 0.0 0.0 0.0 0.0 0.0
TACGAAGGGGGCAAGCGTTGCTCGGAATGACTGGGCGTAAAGGGCGTGCAGGCGGTTTATAGCTGTTGGGTGTGAAATTTTGGGGCTTAACCCTGAAACTGCATTCAAGACGTATAGACTAGAGTATGTGAGAGGATAGTGGAATTCCCAGTGTAGAGGTGAAATTCGTAGATATTGGGAAGAACACCGGTTGCGAAGGCGGCTATCTGGTGCATTACTGACGCTGAGGCGCGAAAGCGTGGGGAGCAAACAGG 0.0 0.0 0.0 0.0 0.0
TACGAAGGGGGCAAGCGTTGCTCGGAATAACTGGGCGTAAAGGGCGCGTAGGCGGTTAATAGCAGTCAGATGTGAAATCTTCGGGCTTAACCTGAAGCCTGCATTTGATACGTATTAGCTAGAGTATGAGAGAGGATTGTGGAATTCCCAGTGTAGAGGTGAAATTCGTAGATATTGGGAAGAACACCAGTTGCGAAGGCGACAATCTGGCTCATTACTGACGCTGAGGCGCGAAAGCGTGGGGAGCAAACAGG 0.0 0.0 0.0 0.0 0.0
TACGAAGGGGGCAAGCGTTGCTCGGAATAACTGGGCGTAAAGGGCGCGTAGGCGGTTAATAGCAGTCAGATGTGAAATCTTTGGGCTTAACCTGAAGTCTGCATTTGATACGTATTAGCTAGAGTGTGAGAGAGGATTGTGGAATTCCCAGTGTAGAGGTGAAATTCGTAGATATTGGGAAGAACACCAGTTGCGAAGGCGACAATCTGGCTCATTACTGACGCTGAGGCGCGAAAGCGTGGGGAGCAAACAGG 0.0 0.0 0.0 0.0 0.0
EMP biom table -
# Constructed from biom file
#OTU ID 1883.2008.269.Crump.Artic.LTREB.main.lane2.NoIndex 1453.45796SDZ4.G4.Pnem.stom 1039.L.Vermelha.SA 1773.Thraupis.gauco3.lgi 1453.45300SDZ4.D7.Pnem.stom
TACGGAGGGTGCAAGCGTTAATCGGAATTACTGGGCGTAAAGCGCACGTAGGCGGCTGTTTAAGCTAGCTGTGAAAGCCCCGGGCTTAAC 0.0 0.0 0.0 0.0 0.0
TACGGAGTGTGCAAGCGTTACTCGGAATCACTGGGCATAAAGAGCACGTAGGCGGGTCACCAAGTCAGCCGTGAAAGCCCCCGGCCCAAC 0.0 0.0 0.0 0.0 0.0
TACGAGAGGTCCAAACGTTATTCGGAATTACTGGGCTTAAAGAGTTCGTAGGCGGCTAAGTAAGTGGGATGTGAAAGCCCTCGGCTCAAC 0.0 0.0 0.0 0.0 0.0
TACGTAGGTGGCAAGCGTTATCCGGAATTACTGGGTGTAAAGGGTGTGTAGGCGGGGCAGCAAGTCTGATGTGAAAATTAGAGGCTCAAC 0.0 0.0 0.0 0.0 0.0
TACGGAAGGTCCGGGCGTTATCCGGATTTATTGGGTTTAAAGGGAGCGTAGGCGGGCTGTCAAGTCAGCGGTAAAATCGTGCGGCTCAAC 0.0 0.0 0.0 0.0 0.0
I'd very appreciate any help and advice!
Best, Ding