microbiome / mia

Microbiome analysis
https://microbiome.github.io/mia/
Artistic License 2.0
45 stars 25 forks source link

fix addDominant arguments and tests #566

Closed thpralas closed 4 weeks ago

thpralas commented 4 weeks ago

This PR aims to fix the following failing test:

── Failure ('test-5dominantTaxa.R:44:9'): getDominant ──────────────────────────
colData(addDominant(tse, rank = "Genus", na.rm = FALSE, name = "dominant"))$dominant[1:15] not equal to `exp.vals.two`.
8/15 mismatches
x[1]: "Class:Thermoprotei"
y[1]: "Genus:CandidatusSolibacter"

x[2]: "Class:Thermoprotei"
y[2]: "Genus:MC18"

x[3]: "Class:Thermoprotei"
y[3]: "Class:Chloracidobacteria"

x[7]: "Class:Thermoprotei"
y[7]: "Family:Moraxellaceae"

x[12]: "Class:Thermoprotei"
y[12]: "Family:ACK-M1"

I added back the argument onRankOnly in getDominant and addDominant functions so that the user can explicitly choose, the issue was that the default value of onRankOnly in agglomerateByRank is TRUE so addDominant needed to be explicitly called with onRankOnly = FALSE as it was done for getDominant.