microbiome / mia

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

taxonomyranks #476

Closed ake123 closed 4 months ago

ake123 commented 7 months ago

Add setTaxonomyRanks and getTaxonomyRanks functions

TuomasBorman commented 7 months ago

Can you also update loadFromBiom? I have seen lots of BIOM files that have "skBacteria" for instance. Currently, column that have this kind of values is not detected as superkingdom. (For example, a column with "kkingdom" value is detected as "KIngdom" column)

TuomasBorman commented 5 months ago

What do you think? When user imports data with loadFromMetaphlan or similar imported, should we automatically set the taxonomyRanks based on colnames(rowData(tse))? There could be parameter for that... The downside is that there might be some taxonomy ranks that importer is not detecting...

ake123 commented 5 months ago

As you noted, there's a risk that the importer might not detect some taxonomy ranks, especially if the data contains unconventional or mislabeled column names. This could lead to incomplete or incorrect taxonomy assignment, potentially affecting downstream analysis.

TuomasBorman commented 5 months ago

Well how about a new internal function something like .set_taxonomy_ranks --> it has parameter detect.ranks (TRUE/FALSE) --> it sets the ranks and give warning "Ranks are set to rank1, rank2... (Use setTaxonomyRanks() to overwrite ranks)."

We can use it hidden and see if it is good or not.

ake123 commented 5 months ago

Added the .set_taxonomy_ranks internal function.

antagomir commented 5 months ago

Yes I think this is a perfect solution.

TuomasBorman commented 4 months ago

Hi! Can you do PR again but not in mia (it is easier to review since then I can also run it locally without cloning your fork). The changes in this PR were good

ake123 commented 4 months ago

I seems I lost it in this PR I have made a new one