previously published scrna - seq data were partly realigned by the dataset generators: the raw sequencing data of four previously published studies were realigned to grch38 using ensembl84 for the hlca. for two of these studies, the cell ranger 3. 1. 0 - based hlca pipeline was used for realignment. for the remaining two, data were processed as previously described, but with the reference genome and genome annotation adapted to the hlca ( grch38; ensembl84 ). all other datasets in the hlca core were originally already aligned to grch38 ( ensembl84 ) except data from ref. ( grch38; ensembl93 ) ( supplementary table 1 ). the count matrices provided had ambient rna removed, as described previously. for all of the datasets from the hlca core, a preformatted sample metadata form was filled out by the dataset providers for every sample, containing metadata such as the id of the donor from whom the sample came, the donor ’ s self - reported ethnicity, the type of sample, the sequencing platform and so on ( supplementary table 2 ). ethnicity metadata were based on self - reported ethnicity for live donors or retrieved from medical records or assigned by the organ procurement team in the case of organ donors, as collected in the individual studies. for donor ethnicity, the following categories of self - reported ethnicity were used during metadata collection: black, white, latino, asian, pacific islander and mixed. to conform to pre - existing 1, 000 genomes ancestry superpopulations, these self - reported ethnicity categories were then harmonized with the superpopulation categories as follows: black was categorized as african, white as european and latino as admixed american, while keeping the category asian ( merging the superpopulations east asians and south asians as this granularity was missing from the collected self - reported ethnicity data ) and keeping pacific islander, as this category did not correspond to any of the superpopulations but does constitute a separate population in hancestro. we refer to the resulting categories as harmonized ethnicity. both self - reported ethnicity ( as collected ) and harmonized ethnicity per donor are detailed in supplementary table 2. cell type annotations from dataset providers were included in all datasets. for tissue dissociation protocols, protocols were grouped based on: ( 1 ) enzyme ( s ) used for tissue dissociation; and ( 2 ) the digestion time in cases where large differences were observed between protocols ( that is, cold protease protocols were split into two groups: 30 – 60 min versus overnight ). patients with lung conditions affecting larger parts of the lung, such as asthma or pulmonary fibrosis, were excluded from the hlca core and later added to the extended atlas. for the hlca core, all matrices were gene filtered based on cell ranger ensembl84 gene - type filtering ( resulting in 33, 694 gene ids ). cells with fewer than 200 genes detected were removed ( removing 2, 335 cells and 21 extra erythrocytes with close to 200 genes expressed as these hampered scran normalization; see below ), along with genes expressed in fewer than ten cells ( removing 5, 167 out of 33, 694 genes ). to normalize for differences in total umi counts per cell, we performed scran normalization. since scran assumes that at least half of the genes in the data being normalized are not differentially expressed between subgroups of cells, we performed scran normalization within clusters. to this end, we first performed total count normalization, by dividing each count by its cell ’ s total count and multiplying by 10, 000. we then performed a log transformation using natural log and pseudocount 1. a pca was subsequently performed. using the first 50 principal components, a neighborhood graph was calculated with the number of neighbors set to k = 15. data were subsequently clustered with louvain clustering at a resolution of r = 0. 5. scran normalization was then performed on the raw counts, using the louvain clusters as input clusters and with the minimum mean ( library size adjusted ) average count of genes to be used for normalization set to 0. 1. the resulting size factors were used for normalization. for the final hlca ( and not the benchmarking subset ), cells with abnormally low size factors ( < 0. 01 ) or abnormally high total counts after normalization ( > 10 × 10 ) were removed from the data ( 267 cells in total ). to harmonize cell type labels from different datasets in the hlca core, a common reference was created to which original cell type labels were mapped ( supplementary table 4 ). to accommodate labels at different levels of detail, the cell type reference was made hierarchical, with level 1 containing the coarsest possible labels ( immune, epithelial and so on ) and level 5 containing the finest possible labels ( for example, naive cd4 t cells ). levels were created in a data - driven fashion, recursively breaking up coarser - level labels into finer ones where finer labels were available. to map anatomical location to a 1d ccf score that could be used for modeling, a distinc tion was made between upper and lower airways. first, an anatomical coordinate score was applied to the upper airways, starting at 0 and increasing linearly ( with a value of 0. 5 ) between each of the following anatomical locations: inferior turbinate, nasopharynx, oropharnyx, vesibula and larynx. the trachea received the next anatomical coordinate score using the same linear increment as in the upper airways ( a score of 2. 5 ). in the lower airways, the coordinate score within the bronchial tree was based on the generation airway, with the trachea being the first generation and the total number of generations assumed to be 23 ( ref. ). the alveol ar sac was assigned the coordinate score of the 23rd generation airway. the coordinate score of each generation airway was calculated by taking the log 2 value of the generation and adding it to the score of the trachea. using this methodology, the alveol us received an anatomical coordinate score of 7. 02. to calculate the final ccf coordinate, the coordinate scores ( ranging from 0 to 7. 02 ) were scaled to a value between 0 ( inferior turbinate ) and 1 ( alveol us ). samples were then mapped to this coordinate system using the best approximation of the sampling location for each of the samples of the core hlca ( supplementary table 3 ). for computational efficiency, benchmarking was performed on a subset of the total atlas, including data from ten studies split into 13 datasets ( ref. was split into 10xv1 and 10xv2 data; ref. was split into 10xv2 and 10xv3 data; and the pooled data from ref. and associated unpublished data were split into two based on the processing site ). the data came from 72 donors, 124 samples and 372, 111 cells. preprocessing of the benchmarking data included the filtering of cells ( minimum number of total umi counts: 500 ) and genes ( minimum number of cells expressing the gene: 5 ). for integration benchmarking, the scib benchmarking framework was used with default integration parameter settings unless otherwise specified. all benchmarked methods except scgen ( that is, bbknn, combat, conos, fas tmnn, harmony, scanorama, scanvi, scvi and seurat rpca ) were run at least twice: on the 2, 000 most hvgs; and on the 6, 000 most hvgs. of these methods, all that did not require raw counts as input were run twice on each gene set: once with gene counts scaled to have a mean of 0 and standard deviation of 1; and once with unscaled gene counts. scvi and scanvi, which require raw counts as input, were not run on scaled gene counts. scgen was only tested on 2, 000 unscaled hvgs. for hvg selection, first, hvgs were calculated per dataset using cell ranger - based hvg selection ( default parameter settings: min _ disp = 0. 5, min _ mean = 0. 0125, max _ mean = 3, span = 0. 3, n _ bins = 20 ).