Filter features conditionally not working as intended

Hi @Alxdu,

I think are is maybe a miscommunication here, but when I go in and check the code, the function is behaving as expected.

I think first is clarifying the expected behavior.

The abundance criteria must be met in at least proportion number of samples. (So, of there are n samples with abundance, a and prevalence, p, the function retains features where \frac{1}{n}\sum_i^n(a_{i} > a) ≥ p. (If you want a specific condition for prevalence, you can set a=0.) This is exactly how it's reported in the docs, if you specifically look at prevalence.

From the function description in the docs:

Filter features based on the relative abundance in a certain portion of samples (i.e., features must have a relative abundance of at least abundance in at least prevalence number of samples). Any samples with a frequency of zero after feature filtering will also be removed.

So, both criteria must be met, but they must be met under those specific conditions. (If you want a joint filtering where both conditions must be met, filter-features may be a better function for you.

In your specific case, the visualization you're using hampers determining performance. My experience has been that stacked barcharts work best when you have features that have a relative abundance of at least 1% in the samples you're visualizing and really only allow you to visualize 12 groups. In this particular case, the ability to make the diagnosis is hampered by the large number of repeating colors, the lack of a legend, possibly collapsed data (I'm guessing genus or family) and not having the interactive ability to mouse over and see which colors correlate across samples. Add to this that it's again, really hard to see low abundance feautures (my visualization threshhold is usually 1%) picking things out is difficult.

If you want to verify the function is working correctly, I would recommend either changing your visualization approach or increasing your abundance threshold.

Best,
Justine