-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confusion about filter_taxa and filter_obs #332
Comments
Thanks for the example code! If you use |
Thanks for your reply. Aggregating to taxons first and then filtering makes sense. My only reservation is that eventually I want to show relative abundance, but it doesn't make sense to compute relative abundance after aggregating to taxons. Right? |
You could calculate the relative abundances before aggregating to the taxon level and it will work. You can use |
Hello,
Thank you for developing MetaCoder. I am enjoying the package so far. I am trying to filter my dataset before plotting heat trees, but instead of throwing counts away for low-abundant taxa, I'd like to reassign those counts to the lowest available supertaxa.
Here is my dataset:
So, classes 1 and 2 (C1, C2) belong to phylum 1 (P1); classes 3 and 4 (C3, C4) belong to phylum 2; and class 5 (C5) belongs to phylum 3 (P3). I only want to display classes 1 and 4 (and their supertaxa) in my heat tree. But instead of throwing out counts for the other classes (C2, C3, C5), I want their counts to be assigned to the lowest available supertaxon. This is my desired output:
I want the counts for C2 to be assigned to P1, the counts for C3 to be assigned to P2, and the counts for C5 to be assigned to K. (I feel like this is the best way to simplify my heat tree without throwing away information, but please let me know if I'm thinking about that incorrectly.)
I've tried different things unsuccessfully:
I think the FAQs describe a very similar situation to mine, but I wasn't able to use those examples to do what I wanted.
Thanks in advance for your help.
Created on 2022-02-10 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: