Pyramidal neuron subtype diversity governs microglia states in the neocortex
Microglia are specialized macrophages in the brain parenchyma that exist in multiple transcriptional states and reside within a wide range of neuronal environments1,2,3,4. However, how and where these states are generated remains poorly understood. Here, using the mouse somatosensory cortex, we demonstrate that microglia density and molecular state acquisition are determined by the local composition of pyramidal neuron classes. Using single-cell and spatial transcriptomic profiling, we unveil the molecular signatures and spatial distributions of diverse microglia populations and show that certain states are enriched in specific cortical layers, whereas others are broadly distributed throughout the cortex. Notably, conversion of deep-layer pyramidal neurons to an alternate class identity reconfigures the distribution of local, layer-enriched homeostatic microglia to match the new neuronal niche. Leveraging the transcriptional diversity of pyramidal neurons in the neocortex, we construct a ligand–receptor atlas describing interactions between individual pyramidal neuron subtypes and microglia states, revealing rules of neuron–microglia communication. Our findings uncover a fundamental role for neuronal diversity in instructing the acquisition of microglia states as a potential mechanism for fine-tuning neuroimmune interactions within the cortical local circuitry.