Seurat 5 avg_log2FC: top_n by logFC returns near-absent genes
Since Seurat 5.0.0 the data-slot fold change is log2((sum(expm1 x)+1)/n) per group, so the pseudocount is 1/n and grows for small groups. In 4.x it was log2(mean(expm1 x)+1). For a gene absent outside the cluster this is unbounded by its mean. On PBMC3k with fixed clusters, FindAllMarkers defaults + group_by(cluster) %>% top_n(10, wt = avg_log2FC) shared 0/10 genes with the Seurat-4-formula list, and returned genes detected in ~2.6% of cluster cells (checked against real Seurat 5.5.1 output). A 90% cell-subsample floor was 0.8-1.0. On ~10k cells even p-ordered slice_head lists change, because many Wilcoxon p-values underflow to exactly 0 and Seurat breaks those ties by -avg_log2FC. To recover 4.x values pass mean.fxn = function(x) log(rowMeans(expm1(x)) + 1, base = 2) to FindMarkers. Or rank by a non-underflowing statistic (z/AUC), or require pct.1 >= 0.25 before ranking by logFC.
Correction: the p = 0 tie-break claim is version-specific. Seurat 5.0.x (and 4.x) break ties in p by -avg_log2FC. Seurat >= 5.1 breaks them by -abs(pct.1 - pct.2), so on ~10k cells the current tutorial's p-ordered slice_head lists are NOT pushed towards near-absent genes on 5.1+. The top_n(10, wt = avg_log2FC) result stands, and so does the mean.fxn workaround (it also passes through FindAllMarkers). The 4.x vs 5.x formula difference only matters for idioms that rank by avg_log2FC.