I want to remove rare reads based on percentage. But I want, within each group, to remove from that group based on percentage. Not based on the total. So if OTU0002 is 5% in group A, but 0.0005% in group B, I want to just get rid of the reads from group B and leave A alone.
I think filter.shared might be the command I’m looking for, but I feel like I’m not understanding parts of it. And it seems like remove.rare and split.abund aren’t what I’m looking for either. How can I do this?
I’m not sure mothur has this functionality at all, to be honest. If you’re doing this with a shared file it wouldn’t be too hard to just load it in R and make a quick pass through the rows, setting any value below a threshold to 0.
I’m curious as to why you want to do this though? If you’re only removing rare reads from individual groups, it’s not like you’ll be making data visualisation any easier (compared to say, removing the X rarest reads from your dataset in order to make a heatmap easier to read).
filter.shared does not have the ability to go group by group. For now I think you’d be best to do this via R. We’ll add it to our list of things to do…