Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve getTaxonomyLabels #672

Merged
merged 5 commits into from
Jan 18, 2025
Merged

Improve getTaxonomyLabels #672

merged 5 commits into from
Jan 18, 2025

Conversation

TuomasBorman
Copy link
Contributor

Add option to collapse taxonomy ranks and to set lowest rank that will be consider when taxonomy labels are generated.

> data(peerj13075)
> tse <- peerj13075
> # Add OTUs to taxonomy table and set taxonomy ranks of mia
> rowData(tse)[["OTU"]] <- rownames(tse)
> setTaxonomyRanks(colnames(rowData(tse)))
> # Get taxonomy labels which correspond to OTUs
> labs <- getTaxonomyLabels(tse)
> labs[62:63]
[1] "OTU184" "OTU185"
> # Get taxonomy labels with genus
> labs <- getTaxonomyLabels(tse, with.rank=TRUE, lowest.rank = "genus")
> labs[62:63]
[1] "genus:Amycolatopsis_OTU184" "genus:Amycolatopsis_OTU185"

R/taxonomy.R Outdated Show resolved Hide resolved
@TuomasBorman
Copy link
Contributor Author

Add unit test and example.

@TuomasBorman TuomasBorman merged commit a8e1e0a into devel Jan 18, 2025
2 of 3 checks passed
@TuomasBorman TuomasBorman deleted the improve_taxlabs branch January 18, 2025 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant