An R script to regroup genes to ontologies while maintaining compositionality
Same default output of the humann2 untility script regroup_table.py while addresses the many-to-one mapping problem. The only difference is that each gene abundance from your gene table is divided by the number of times it maps to an ontology. This ensures that your output table is truely compositional (componenets sum to 1).
"Each component should never give more than itself..." ~ Thom Quinn
$ Rscript regroup_table_compositional.R --input <joined_gene_table.tsv> --map <path/to/utility_mapping_file.txt.gz> --out <ontology_table.tsv>