by Jeon Lee (Jeon.Lee@UTSouthwestern.edu) on Nov. 28, 2018

\(~\)

Sometimes we want to test cluster similarity across multiple scRNA-seq experiments (e.g. Is fibroblast-1 in experiment A more similar to fibroblast-A or fibroblast-B in experiment B). For this, we can think about two ways: 1) to compare cluster markers of a specific cluster in experiment A with cluster markers of each cluster in experiment B (refer to ‘ClusterMap’ package); 2) to aggregate multiple experiments and identify which clusters from different experiments do cluster together

\(~\)

Load the ‘cellrangerRkit’ package

#library(ClusterMap)
library(cellrangerRkit)
library(knitr)

setwd("/project/BICF/BICF_Core/s167719/BICF_ShowCase/Single_Cell_RNAseq_Analysis")

\(~\)

Invasive_KIC scRNA-seq analysis results

A. load cellranger matrix and analysis results

path_invasiveKIC <- "./BRAH-4f7l7J"
sc_invasiveKIC <- load_cellranger_matrix(path_invasiveKIC)
## Searching for genomes in: ./BRAH-4f7l7J/outs/filtered_gene_bc_matrices 
## Using mm10 in folder: ./BRAH-4f7l7J/outs/filtered_gene_bc_matrices/mm10 
## Loaded matrix information
## Loaded gene information
## Loaded barcode information
## Loaded summary information
head(exprs(sc_invasiveKIC)[,c(1:25)],20) # expression matrix
## 20 x 25 sparse Matrix of class "dgTMatrix"
##                                                                     
## ENSMUSG00000051951 . . . . . . . . . . . . . . . . . . . . . . . . .
## ENSMUSG00000089699 . . . . . . . . . . . . . . . . . . . . . . . . .
## ENSMUSG00000102343 . . . . . . . . . . . . . . . . . . . . . . . . .
## ENSMUSG00000025900 . . . . . . . . . . . . . . . . . . . . . . . . .
## ENSMUSG00000109048 . . . . . . . . . . . . . . . . . . . . . . . . .
## ENSMUSG00000025902 . . . . . . . . . . . . . . . . . . . . . . . . .
## ENSMUSG00000104328 . . . . . . . . . . . . . . . . . . . . . . . . .
## ENSMUSG00000033845 1 . . . . 2 2 . . 5 3 1 . . . . . 2 1 . 1 . . . .
## ENSMUSG00000025903 . . . . . . 1 . . . . 3 . . . . . . . 1 . . . . .
## ENSMUSG00000104217 . . . . . . . . . . . . . . . . . . . . . . . . .
## ENSMUSG00000033813 . 1 3 1 . . 1 1 . 2 3 1 . . . . . 1 1 4 . . 1 . .
## ENSMUSG00000002459 . . . . . 1 . . . 1 . 1 . . . . . . . . . . . . .
## ENSMUSG00000085623 . . . . . . . . . . . . . . . . . . . . . . . . .
## ENSMUSG00000033793 . . . 1 1 1 1 . 1 . . . . . . . 1 . 1 . . . . . .
## ENSMUSG00000025905 . . . . . . . . . . . . . . . . . . . . . . . . .
## ENSMUSG00000033774 . . . . . . . . . . . . . . . . . . . . . . . . .
## ENSMUSG00000025907 2 2 . 1 . . . . . 4 1 3 . . . 1 1 . . 3 . . . . .
## ENSMUSG00000090031 . . . . . . . . . . . . . . . . . . . . . . . . .
## ENSMUSG00000087247 . . . . . . . . . . . . . . . . . . . . . . . . .
## ENSMUSG00000033740 . . . . . . . . . . . . . . . . . . . . . . . . .
head(fData(sc_invasiveKIC)) # data frame of genes
##                                    id  symbol
## ENSMUSG00000051951 ENSMUSG00000051951    Xkr4
## ENSMUSG00000089699 ENSMUSG00000089699  Gm1992
## ENSMUSG00000102343 ENSMUSG00000102343 Gm37381
## ENSMUSG00000025900 ENSMUSG00000025900     Rp1
## ENSMUSG00000109048 ENSMUSG00000109048     Rp1
## ENSMUSG00000025902 ENSMUSG00000025902   Sox17
head(pData(sc_invasiveKIC)) # data frame of cell barcodes
##                               barcode
## AAACGGGAGCGTAATA-1 AAACGGGAGCGTAATA-1
## AAACGGGCACTGTTAG-1 AAACGGGCACTGTTAG-1
## AAACGGGGTGCAGACA-1 AAACGGGGTGCAGACA-1
## AAAGCAAAGATGAGAG-1 AAAGCAAAGATGAGAG-1
## AAAGCAAGTACCGCTG-1 AAAGCAAGTACCGCTG-1
## AAAGCAATCTTTACGT-1 AAAGCAATCTTTACGT-1
analysis_results_invasiveKIC <- load_cellranger_analysis_results(path_invasiveKIC)

B. visualize its clusters and identify cluster markers

tsne_proj_invasiveKIC <- analysis_results_invasiveKIC$tsne
visualize_clusters(analysis_results_invasiveKIC$clustering$kmeans_8_clusters$Cluster, tsne_proj_invasiveKIC[c("TSNE.1", "TSNE.2")]) +
  ggtitle("invasive KIC model")

#prioritized_genes_invasiveKIC <- prioritize_top_genes(sc_invasiveKIC,analysis_results_invasiveKIC$clustering$kmeans_8_clusters$Cluster, "sseq", min_mean=0.5)
#prioritized_genes_invasiveKIC

C. test marker enrichment

sc_bcnorm_invasiveKIC <- normalize_barcode_sums_to_median(sc_invasiveKIC)
sc_log_invasiveKIC <- log_gene_bc_matrix(sc_bcnorm_invasiveKIC, base=10)

genesOfInterest <- c("Brd4", "Cd44", "Vim")
visualize_gene_markers(sc_bcnorm_invasiveKIC, genesOfInterest, tsne_proj_invasiveKIC[c("TSNE.1", "TSNE.2")]) +
  ggtitle("Marker enrichment: invasive KIC model")