mia icon indicating copy to clipboard operation
mia copied to clipboard

perSampleDominantFeatures works only with taxonomyRanks

Open antagomir opened this issue 1 year ago • 2 comments

The perSampleDominantFeatures and addPerSampleDominantFeatures

This works:

library(mia)
data(GlobalPatterns, package="mia")
tse <- GlobalPatterns
rowData(tse)$group <- as.character(sample.int(5, nrow(tse), replace = TRUE))
perSampleDominantFeatures(tse, rank="Class")

This gives error:

perSampleDominantFeatures(tse, rank="group")

Error: 'rank' must be a value from 'taxonomyRanks()'

We recently implemented the mergeFeatures functions so that they also allow other fields than ranks. Could we enable it here as well?

antagomir avatar Aug 09 '23 20:08 antagomir