## 2 Materials and Methods
### Imputation Strategy  
For each gene \(i\) in each cell subpopulation \(k\), the Gamma-Normal mixed model was used to identify dropout values. We divided gene \(i\) into a high-confidence cell set A and a low-confidence cell set B based on the dropout probability, and its expression value is modeled as a random variable \(Z_{i}^{(k)}\) with the following density function:  
\[f_{Z_{i}^{(k)}}(z)=\delta_{i}^{(k)}Gamma\Big{(}z;\alpha_{i}^{(k)},\beta_{i}^{( k)}\Big{)}+\Big{(}1-\delta_{i}^{(k)}\Big{)}Normal\Big{(}z;\mu_{i}^{(k)},\sigma_{i}^{(k)} \Big{)} \tag{2}\]  
where \(\delta_{i}^{(k)}\) is the dropout rate in cell subpopulation \(k\) of gene \(i\), \(\alpha_{i}^{(k)},\beta_{i}^{(k)}\) are parameters of Gamma distribution, \(\mu_{i}^{(k)},\sigma_{i}^{(k)}\) are parameters of Normal distribution. And the dropout probability \(p_{ij}\) can be calculated by the following formula:  
\[p_{ij}=\frac{\widehat{\delta_{i}^{(k)}}Gamma\Big{(}Z_{ij};\widehat{\alpha_{i} ^{(k)}},\widehat{\beta_{i}^{(k)}}\Big{)}}{\widehat{\delta_{i}^{(k)}}Gamma \Big{(}Z_{ij};\widehat{\alpha_{i}^{(k)}},\widehat{\beta_{i}^{(k)}}\Big{)}+ \Big{(}1-\widehat{\delta_{i}^{(k)}}\Big{)}Normal\Big{(}Z_{ij};\widehat{\mu_{i} ^{(k)}},\widehat{\sigma_{i}^{(k)}}\Big{)}} \tag{3}\]  
where \(\widehat{\alpha_{i}^{(k)}},\widehat{\beta_{i}^{(k)}},\widehat{\mu_{i}^{(k)}},\widehat{\sigma_{i}^{(k)}}\) and \(\widehat{\delta_{i}^{(k)}}\) are estimated by Expectation-Maximization (EM) algorithm, and the dropout probability \(p_{ij}\) represents the dropout rate of the gene \(i\) in the cell \(j\). After getting the dropout probability, for each gene \(i\) in each cell subpopulation \(k\), the dropout values are identified by the Gamma-Normal mixed model. The data with a dropout probability higher than 0.5 are considered to be low confidence set B, which needs to be imputed, and conversely, the data with a dropout probability lower than or equal to 0.5 are considered to be high confidence set A. After obtaining the high confidence set A and the low confidence set B for each cell subpopulation \(k\), we imputed the data in two steps. In the following two steps, the high confidence set A and the low confidence set B for each gene \(i\) are unchanged.  
1. For each gene \(i\), the data in set A were averaged, and its average value was used as the imputation of gene \(i\) in low confidence set B. We denoted the imputation matrix as Y. The information across cells was already incorporated into matrix Y at this stage, butthis is not the final imputation. And then, correlations between genes are calculated by the Pearson correlation coefficient for each cell subpopulation. The genes with an absolute value of the correlation coefficient greater than 0.5 were selected for the next step of the calculation.
2. For each gene \(i\), as shown in Figure 2, based on the matrix Y and the high correlation genes we filter out, random forest regression is used for regression training on data with high confidence cells. Then, predictions are made for data with low confidence cells. Thus, it preserves the heterogeneity across cells and does not impute all zeros. At the beginning of the regression with random forest, the low confidence set B is imputed with information from similar cells. When the gene \(i\) which has been predicted by random forest regression, is used to calculate other genes, the gene expression level of gene \(i\) corresponds to the value predicted by random forest; that is, after calculating gene \(i\), the set B of gene \(i\) is retained for the subsequent random forest regression of the next gene. The random forest regression model establishes several uncorrelated decision trees by randomly extracting samples and features. Each decision tree can obtain a prediction result based on the extracted samples and features. The regression model of the whole forest can be obtained by taking the average value of all the results. Using random forests, we can learn nonlinear relationships between genes.