Please make sure these conditions are met
What happened?
After running sc.tl.rank_genes_groups, I noticed that in the adata.uns["rank_genes_groups"]dictionary, the ptsand pts_restfields are stored as pandas.DataFrameobjects, while other fields (like names, pvals, logfoldchanges, pvals_adj, scores) are stored as numpy.ndarray.
More importantly, the index order of ptsand pts_restfollows the original adata.var_namesorder, whereas the other fields are ordered by statistical significance (p-value or score). This inconsistency caused confusion in my analysis.
Minimal code sample
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "scanpy@git+https://github.com/scverse/scanpy.git@main",
# ]
# ///
#
# This script automatically imports the development branch of scanpy to check for issues
import scanpy as sc
# your reproducer code
Error output
Versions
Details