Fix to_functional_df function - #677
Open
pkonieczny wants to merge 4 commits into
Open
Conversation
petraszd
reviewed
Jul 20, 2026
petraszd
approved these changes
Jul 20, 2026
petraszd
left a comment
Contributor
There was a problem hiding this comment.
Code changes looks good. Though I am not fully sold on breaking backwards compatibility.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status
Description
This PR makes 2 major changes:
to_functional_dfto matchto_classification_df: functional profiles (so, samples) are the rows whereas function ids (or function ids x taxa names for stratified results) are the columns. For stratified results, the function ids x taxa names is a MultiIndex on the columns.taxa_stratified=Trueis handled properly in that data frame: each contributing taxon gets its own column in the dataframe.As part of this PR some benchmarks were run on sparse representation of the data frame - the verdict is: not worth it since the wide format introduces a lot of columns so huge overhead in pandas. The sparse format actually uses more memory due to that even at values at ~25% full. We'd need ~1k samples for sparse to become useful.
Related PRs
TODOs
CHANGELOG?