Skip to content

Sort numeric columns numerically#347

Open
Macabe222 wants to merge 17 commits intoqiime2:devfrom
Macabe222:numeric-sort
Open

Sort numeric columns numerically#347
Macabe222 wants to merge 17 commits intoqiime2:devfrom
Macabe222:numeric-sort

Conversation

@Macabe222
Copy link
Contributor

@Macabe222 Macabe222 commented Dec 29, 2025

Adds functionality to automatically detect numeric columns that have been converted to strings by actions such as tabulate-feature-frequencies and convert them back to numeric metadata columns, allowing them to be properly sorted in the tabulate-seqs visualizer.
Resolves #344
Screenshot 2025-12-29 at 1 27 22 PM
Screenshot 2025-12-29 at 1 27 49 PM

@cherman2
Copy link
Contributor

cherman2 commented Jan 7, 2026

Hi @Macabe222, are you still working on this, or is it ready for review? No problem either way just trying to make sure that it gets triaged.

@cherman2 cherman2 moved this from Needs Triage to Awaiting Info in QIIME 2 - Triage 🚑 Jan 7, 2026
@Macabe222
Copy link
Contributor Author

Yes this one is read for review @cherman2

@cherman2 cherman2 moved this to Needs Review in 2026.1 ❄️ Jan 8, 2026
@colinvwood colinvwood moved this from Needs Review to In Review in 2026.1 ❄️ Jan 9, 2026
@colinvwood colinvwood self-assigned this Jan 9, 2026


def tabulate_feature_frequencies(table: biom.Table) -> qiime2.Metadata:
def tabulate_feature_frequencies(table: biom.Table, format: bool = False) \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove all these interface changes

Copy link
Contributor

@colinvwood colinvwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove all the interface changes so we don't have to deal with that headache and instead just convert all numeric-parseable columns in the metadata to numeric columns

@Macabe222 Macabe222 changed the title Adding option to sort frequency columns numerically Sort numeric columns numerically Jan 26, 2026
@github-project-automation github-project-automation bot moved this to Backlog in 2026.4 🌱 Jan 30, 2026
@lizgehret lizgehret moved this from Backlog to In Review in 2026.4 🌱 Jan 30, 2026
metadata_df = metadata.to_dataframe()

# Make sure numeric columns are represented correctly
types = {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this anymore


# Make sure numeric columns are represented correctly
types = {}
numeric_frame = pd.DataFrame()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need a separate dataframe, just update the columns in place

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

fix numeric sorting in qiime feature-table tabulate-seqs

3 participants