microbiome / mia

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

splitOn error is not clear if using a wrong column name #647

Open artur-sannikov opened 1 month ago

artur-sannikov commented 1 month ago

If I have a SummarizedExperiment, want to split it by group and specify a non-existing column, I get a generic Error: 'group' is not found. Please check that 'group' specifies a column from rowData or colData.

> splitOn(se, "Treatment")
Error: 'group' is not found. Please check that 'group' specifies a column from rowData or colData.

Treatment column does not exist here.

The error can be improved: Error: column 'Treatment' is not found. Please check that this column exists in rowData or colData.

TuomasBorman commented 1 month ago

Thanks!

This is a thing that we can improve. However, it seems that most of the error messages are in former format. Not sure, if we should then improve them all. It is better that messages informing a similar thing are structured similarly. That is done in HoloFoodR (a common function for creating error messages), and we could use it as a template. However, this is not currently top priority.