Skip to contents

Quick Start Guide

Loading Datasets

To show the different capabilities of scX, we will use single cell data related to the oligodendrocyte developmental lineage (Marques et al. 2016). In this dataset we have cells from 12 regions of the central nervous system of juvenile and adult mice and 10 distinct cell populations have been identified. This package includes a modified version of this dataset in which the original cells have been subsampled and a pseudotime has been calculated to demonstrate how scX can represent numerical attributes.

In this example we will use the ‘inferred_cell_type’ covariate to explore differential expression patterns (partitionVars parameter). The rest of the metadata will be used for visualization purposes (metadataVars parameter). While partitionVars should be categorical variables, metadataVars can be discrete or continuous covariates.

library(scX)

#SCE example data
scXample

colData(scXample)[1:3,]
# DataFrame with 3 rows and 8 columns
#                                   title     source_name         age inferred_cell_type                    sex      strain   treatment pseudotime
#                             <character>     <character> <character>        <character>            <character> <character> <character>  <numeric>
#   C1-1771017-030-C09 C1-1771017-030-C09       cortex S1         p22                OPC pooled male and female  PDGFRa-GFP          No    23.1662
#   C1-1771017-028-G05 C1-1771017-028-G05 hippocampus CA1         p22                OPC                      F  PDGFRa-GFP          No    21.7566
#   C1-1771052-132-B02 C1-1771052-132-B02 corpus callosum         p69                OPC                      M         CD1          No    23.3207

The scX app can be created and launched with only two functions. createSCEobject() creates the single cell experiment object that will be used within the application. This function performs a set of preprocessing steps required for the various scX functions. Among these steps we can mention:

  1. Calculation of quality control metrics.

  2. If no partition was declared in the partitionVars parameter, a preliminary clustering will be calculated with the scran package function scran::quickCluster().

  3. Normalization of the gene expression matrix.

  4. Determination of the most variable genes (HVG).

  5. Calculation of different dimensionality reductions: PCA, tSNE, and UMAP.

If the input dataset already has these characteristics, some of these steps can be avoided. For example, if the dataset already has a precomputed PCA, scX will not recalculate it but will calculate the dimensionality reductions that are not already calculated in the dataset.

On the other hand, different options for the calculation of the marker genes of the different clusters can be determined. This can be done within the parameter paramFindMarkers which expects a list of parameters taken by the function scran::findMarkers().

Finally with the launch_scX() function the application is deployed.

library(scX)
# Creating SCE object
cseo <- createSCEobject(xx = scXample, 
                        partitionVars = "inferred_cell_type", 
                        metadataVars = c("source_name", "age", "sex", "strain", "treatment", "pseudotime"),
                        descriptionText = "Quick Start Guide")

launch_scX(cseo)