Hi Moya,
Apologies for the delayed response; I do have a way for annotating to a higher taxonomy level, but I had to hunt down where the script was (I hadn't used it in a bit, and it's not included in the SAMSA2 Github repo because... well, I didn't include it.). However, I'm attaching it here, and also going to see about adding it.
I'll clean this up a bit before uploading, but here's the usage statement:
USAGE STATEMENT
-Q Enables quiet mode
-F Input file, necessary
-R Reference index file, necessary
-T Final taxonomy level desired: Kingdom, Phylum, Class, Order, Family, Genus
-O Output file (default is input_file.shifted)
-V Verbose mode, shows exceptions
-E Exclusion, will exclude all exceptions if present
So you run this as such:
$ python taxonomy_shifter_v4.py -F input_summary_file_stage_5.tsv -R Bacteria_Genus_flattened.tsv -T Phylum
This will shift everything at a lower level than Phylum, in this case, to be at the Phylum level, and then should consolidate identical rows and sum their percentages and read totals.
I've not tried eggNOG before, but if you link to where I can download it, I can look into converting it into a compatible format.
Best,
Sam