The analysis of single-cell RNA sequencing (scRNA-seq) data presents unique challenges due to the high dimensionality, technical noise, and biological heterogeneity inherent in the data. Rigorous quality control (QC) and preprocessing are essential to ensure the reliability of downstream analyses, which are increasingly applied to understand the cellular and molecular basis of mental health conditions. The scater package in R provides a comprehensive suite of tools for QC, visualization, and preprocessing of scRNA-seq data. A critical aspect of this process involves identifying and filtering out low-quality cells and features, which can be conceptualized as finding and fitting the boundaries of the dataset. This involves using statistical and visual methods to define acceptable ranges for key QC metrics, thereby establishing the "border" between high-quality data suitable for analysis and problematic data that could introduce bias. This article, based exclusively on the provided source material, details the methods and rationale for these boundary-finding procedures within the scater framework, highlighting their importance for producing clean datasets for downstream mental health research.
Single-cell RNA-seq analysis begins with the generation of data objects, such as the SCESet or SingleCellExperiment objects, which store expression data alongside phenotype data (metadata about each cell). The scater package facilitates the calculation of QC metrics and provides visualization functions to explore these metrics. The primary goal is to identify and remove cells that are likely to be technical artifacts (e.g., cells with low sequencing depth, high mitochondrial read content, or empty droplets) and features (genes) that are not reliably detected. This process is not about imposing a single, universal threshold but about using the data itself to inform the boundaries. For instance, the plotScater function offers an overall view of the dataset by plotting the cumulative proportion of each cell’s library accounted for by the top highest-expressed features. This plot helps visualize differences in expression distributions across cells, similar to how per-sample boxplots are used for bulk RNA-seq data. Due to the large number of zero values in single-cell data, boxplots are less informative, making the cumulative expression plot a valuable tool for identifying cells with abnormal expression profiles. By splitting cells based on metadata variables, researchers can gain a finer-grained look at differences between cell populations, which is crucial for studies involving distinct cellular types in brain tissue relevant to psychiatric disorders.
A core function for boundary detection is plotQC, which enables the identification of potentially problematic cells through various visualizations. For example, plotPhenoData (a function within the scater ecosystem) can plot two cell metadata variables against each other, such as total counts versus total features (number of expressed genes). This allows researchers to visually identify cells that fall outside the expected range—cells with very low total counts or an unusually low number of expressed genes for their library size are often low-quality and are candidates for removal. The function can also color points by the expression level of specific genes, which can help identify cells with anomalous expression patterns for genes of interest. The output of these functions is a ggplot object, which can be customized for publication-quality figures. Furthermore, plotQC with the type = "expl" option computes the median marginal R² for each variable in the phenotype data when fitting a linear model regressing expression values against just that variable. This helps quantify the relative importance of different explanatory variables, such as experimental conditions (e.g., treatment, cell cycle) or technical factors (e.g., total features, total counts). Identifying which variables explain a significant portion of the variance is key to understanding potential confounders and informing whether they should be conditioned out during data normalization.
Subsetting capabilities are fundamental to applying the boundaries defined through visualization. The scater package provides easy ways to drop unwanted cells based on the QC metrics and visualizations. The calculateQCMetrics function adds columns to the phenotype data, such as is_cell_control, which indicates if a cell is defined as a control (e.g., based on spike-in controls or empty droplets). The $ operator allows easy access to these columns for subsetting. For example, researchers can compare the most-expressed features in cell controls versus cells of biological interest by creating two separate SCESet objects based on the is_cell_control flag and generating plots for each. This comparison helps establish a baseline for technical noise and informs the thresholds for filtering biological cells. The filter function, inspired by the dplyr package, provides a convenient way to subset cells based on phenotype data variables, allowing for the application of user-defined thresholds for metrics like library size, number of expressed genes, and percentage of mitochondrial reads.
Outlier detection is another critical method for defining data boundaries. The plotPCA function can perform principal component analysis (PCA) on QC metrics to highlight cells that differ from other cells based on technical features. By setting detect_outliers = TRUE, the function can automatically flag cells that are outliers along the principal components. The outlier designation is stored in the outlier element of the phenotype data, which can then be used to filter out these cells. While automatic outlier detection is informative, the sources emphasize that a close inspection of QC metrics and tailored filtering for the specifics of the dataset is strongly recommended. This underscores the principle that boundary fitting is an iterative, context-dependent process rather than a one-size-fits-all application.
The Galaxy training material provides a practical example of manual filtering using scater. For a large dataset, users can set specific parameters informed by prior visualization. Key parameters include the number of reads mapped to a gene for it to be counted as expressed (default is 1, but can be made more stringent), the minimum library size (e.g., 100,000 mapped reads), the minimum number of expressed genes (e.g., 500), and the maximum percentage of mitochondrial genes per cell (e.g., 35%). These thresholds are not arbitrary; they are derived from observing the distributions of these metrics in plots like plotQC. For instance, a plot of total counts might reveal a natural break point, or a scatter plot of total counts versus total features might show a cluster of low-quality cells with low values for both metrics. Setting a minimum library size of 100,000 reads, as in the example, is informed by seeing that few cells have fewer than 200,000 reads in the plotted data. This process of visually inspecting the data distribution and setting thresholds based on observed patterns is the essence of fitting the boundary of the dataset.
The ultimate goal of these QC and filtering steps is to produce a clean dataset ready for downstream statistical modeling and analysis. After QC and data normalization (methods also available in scater), the dataset can be used for answering scientific questions. For mental health research, this might involve identifying cell-type-specific gene expression changes in post-mortem brain tissue from individuals with depression or schizophrenia, or analyzing immune cell responses in peripheral blood from patients with anxiety disorders. The reliability of these downstream findings hinges on the quality of the initial data. By meticulously applying the boundary detection and filtering tools in scater, researchers can minimize the impact of technical noise and ensure that the biological signals they observe are genuine.
In conclusion, finding and fitting the boundary of a scRNA-seq dataset is a multifaceted process that combines visualization, statistical outlier detection, and manual filtering. The scater package provides a robust framework for this process, enabling researchers to identify and remove low-quality cells and features based on a range of QC metrics. This rigorous approach is not merely a technical prerequisite but a foundational step in ensuring the integrity of research into the cellular mechanisms underlying mental health conditions. The methods described—using plots to visualize data distributions, calculating explanatory variable importance, detecting outliers via PCA, and applying manual filters—allow for the establishment of data-driven boundaries that maximize the biological relevance of the dataset. Adherence to these practices is essential for generating reproducible and meaningful insights from single-cell genomics in psychiatry and psychology.