Preliminary analyses showed that the dataset contained hundreds of distinct cell types and that the dynamic range of cell-type abundances spanned four orders of magnitude. In addition, the dataset was affected by a number of technical artifacts, including low-quality cells, batch effects, sex-specific gene expression, neuronal-activity-dependent gene expression, and more. To overcome these challenges, we developed a multistage analysis pipeline called “cytograph,” which progressively discovers cell types or states while mitigating the impact of technical artifacts (see STAR Methods).