You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some applications we like to calculate prevalences per group, and possibly then pick features that are sufficiently prevalent in at least one group. Currently this can be done e.g. with:
library(mia)
data(peerj13075)
tse <- peerj13075
# Split the tse data object by milk stage
tses <- splitOn(tse, group = "Geographical_location")
# Calculate prevalences per group (features x groups table)
prev <- sapply(tses, function (tse) getPrevalence(tse, assay.type="counts"))
mia could possibly simplify this and provide a wrapper like just:
I tend to think that this is easy enough currently. Moreover, with my limited knowledge I think that this is not that commonly done.
However, as you said, we should have examples on this. Instead of manpage, OMA could be also suitable as this affects more widely than just this function. Here we tell about splitOn() (I also noticed typo): https://microbiome.github.io/OMA/docs/devel/pages/wrangling.html#sec-splitting The text says that we can use it for this purpose, but it would benefit to add clear example on how to do that.
Adding getPrevalenceByGroup() might be something to discuss in the future. However, adding new functions that do similar things is not optimal. It might be confusing.
If we decide to implement this, this issue might be relevant: microbiome/miaTime#30. We discussed about the general split-apply-combine function there. However, I still think that improving examples is easier and more sustainable way.
In some applications we like to calculate prevalences per group, and possibly then pick features that are sufficiently prevalent in at least one group. Currently this can be done e.g. with:
mia could possibly simplify this and provide a wrapper like just:
But perhaps it is simple enough already without? At least we could add an example of this on the manpage of getPrevalence?
The text was updated successfully, but these errors were encountered: