Load data

We will be analyzing the CITE-seq human PBMC data. This data can be installed with SeuratData.

# install Seurat v4.0.0 and SeuratData
if (!requireNamespace("Seurat", quietly = TRUE) | utils::packageVersion("Seurat") < "4.0.0")
  remotes::install_version("Seurat", version = "4.0.0")
if (!requireNamespace("SeuratData", quietly = TRUE))
  devtools::install_github('satijalab/seurat-data')

library(FuseNet)
library(Seurat)
library(SeuratData)
InstallData("cbmc")
library(cbmc.SeuratData)

# Find highly variable features/genes
cbmc <- FindVariableFeatures(cbmc, selection.method = "vst", verbose = FALSE)

Run FuseNet on RNA data

data_rna <- cbmc@assays$RNA@counts[VariableFeatures(cbmc),]
cbmc_rna <- InitiateFuseNet(raw_data = data_rna, project_name = "RNA", normalization = "cosine", pca_dims = 20, kernel = "gaussian", k = 15)
cbmc_rna <- GeomSketch(object = cbmc_rna, geom_pca_dims = 20, geom_size = 3000, sketch_n_pca = 20, sketch_k = 15)
ptm <- proc.time()
cbmc_rna <- RunFuseNet(object = cbmc_rna, n_iters = 100, pca_dims = 20, k = 15, ratio = 0.5, norm_type = "l1")
ptm1 <- proc.time() 
print(x = ptm1 - ptm)
##    user  system elapsed 
##  21.310  11.901  51.186

Run FuseNet on ADT data

data_prt <- cbmc@assays$ADT@counts
cbmc_prt <- InitiateFuseNet(raw_data = data_prt, project_name = "Protein", normalization = "cosine", kernel = "gaussian", k = 15, verbose = FALSE)
cbmc_prt <- GeomSketch(object = cbmc_prt, geom_size = 3000, geom_pca_dims = 3, sketch_n_pca = 0, sketch_k = 15)
ptm <- proc.time()
cbmc_prt <- RunFuseNet(object = cbmc_prt, n_iters = 100, ratio = 0.5, k = 15, norm_type = "l1")
ptm1 <- proc.time() 
print(x = ptm1 - ptm)
##    user  system elapsed 
##  14.273  8.310  36.338

Fuse the RNA and ADT data.

We see that the mouse cells, which were used as the spike-in controls, were defined almost exclusively by RNA modality (RNA weight > 0.8). This is because there is no anti-mouse antibodies were used in the study.

In general lymphocytes were well defined in the ADT modality (protein weights > 0.6). Especially, CD8+ and CD4+ naive and memory T cells were more defined by the ADT data, on the other hand, dendritic cells (DC and pDCs) were more defined in the RNA data due to the absence of its surface markers in the ADT data.

fused <- FuseData(cbmc_rna, cbmc_prt, project_k = 15)
cbmc@meta.data["RNA_Weight"] <- fused$fused_weight["RNA",]
cbmc@meta.data["Protein_Weight"] <- fused$fused_weight["Protein",]
VlnPlot(object = cbmc, features = c("RNA_Weight", "Protein_Weight"), sort = TRUE, group.by = "rna_annotations")

Downstream analysis

We can perform UMAP dimensional reduction or clustering on the fused data for downstream analysis.

umap.dims <- uwot::umap(X = fused$fused_dist, n_components = 2)
dimnames(x = umap.dims) <- list(Cells(cbmc), c("UMAP_1", "UMAP_2"))
cbmc@reductions$umap <- CreateDimReducObject(embeddings = umap.dims, key = "UMAP_", assay = c("RNA", "ADT"))
cbmc@reductions$umap@cell.embeddings = umap.dims
DimPlot(object = cbmc, group.by = "rna_annotations", reduction = "umap", label = TRUE, repel = TRUE, label.box = TRUE)

Session Information

print(sessionInfo())
## R version 4.0.3 (2020-10-10)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Big Sur 10.16
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] stxBrain.SeuratData_0.1.1 ssHippo.SeuratData_3.1.4  cbmc.SeuratData_3.1.4     bmcite.SeuratData_0.3.0   SeuratData_0.2.1         
## [6] SeuratObject_4.0.0        Seurat_4.0.1              FuseNet_0.99.0           
## 
## loaded via a namespace (and not attached):
##   [1] Rtsne_0.15            colorspace_2.0-0      deldir_0.2-3          ellipsis_0.3.2        ggridges_0.5.3        rprojroot_2.0.2      
##   [7] fs_1.5.0              rstudioapi_0.13       spatstat.data_1.7-0   leiden_0.3.6          listenv_0.8.0         ggrepel_0.9.0        
##  [13] codetools_0.2-18      splines_4.0.3         doParallel_1.0.16     cachem_1.0.1          knitr_1.38            polyclip_1.10-0      
##  [19] jsonlite_1.7.2        ica_1.0-2             cluster_2.1.0         png_0.1-7             uwot_0.1.10           shiny_1.5.0          
##  [25] sctransform_0.3.2     spatstat.sparse_2.0-0 compiler_4.0.3        httr_1.4.2            Matrix_1.3-2          fastmap_1.1.0        
##  [31] lazyeval_0.2.2        cli_3.2.0             later_1.1.0.1         htmltools_0.5.2       tools_4.0.3           igraph_1.2.6         
##  [37] gtable_0.3.0          glue_1.6.2            RANN_2.6.1            reshape2_1.4.4        dplyr_1.0.2           rappdirs_0.3.1       
##  [43] Rcpp_1.0.7            scattermore_0.7       jquerylib_0.1.3       pkgdown_2.0.2         vctrs_0.4.1           nlme_3.1-151         
##  [49] iterators_1.0.13      lmtest_0.9-38         xfun_0.30             stringr_1.4.0         globals_0.14.0        mime_0.9             
##  [55] miniUI_0.1.1.1        lifecycle_1.0.1       irlba_2.3.3           goftest_1.2-2         future_1.21.0         MASS_7.3-53          
##  [61] zoo_1.8-8             scales_1.1.1          spatstat.core_1.65-5  ragg_0.4.0            promises_1.1.1        spatstat.utils_2.1-0 
##  [67] parallel_4.0.3        expm_0.999-5          RColorBrewer_1.1-2    yaml_2.2.1            memoise_2.0.1         reticulate_1.18      
##  [73] pbapply_1.4-3         gridExtra_2.3         ggplot2_3.3.3         sass_0.4.0            rpart_4.1-15          stringi_1.5.3        
##  [79] desc_1.4.1            foreach_1.5.1         rlang_1.0.2           pkgconfig_2.0.3       systemfonts_0.3.2     matrixStats_0.57.0   
##  [85] evaluate_0.15         lattice_0.20-41       ROCR_1.0-11           purrr_0.3.4           tensor_1.5            patchwork_1.1.1      
##  [91] htmlwidgets_1.5.3     cowplot_1.1.1         tidyselect_1.1.0      parallelly_1.23.0     RcppAnnoy_0.0.18      plyr_1.8.6           
##  [97] magrittr_2.0.1        R6_2.5.0              generics_0.1.0        DBI_1.1.0             mgcv_1.8-33           pillar_1.4.7         
## [103] fitdistrplus_1.1-3    survival_3.2-7        abind_1.4-5           tibble_3.0.4          future.apply_1.7.0    crayon_1.3.4         
## [109] KernSmooth_2.23-18    spatstat.geom_1.65-5  plotly_4.9.2.2        rmarkdown_2.13        grid_4.0.3            data.table_1.13.6    
## [115] digest_0.6.27         xtable_1.8-4          tidyr_1.1.2           httpuv_1.5.4          textshaping_0.2.1     munsell_0.5.0        
## [121] viridisLite_0.3.0     bslib_0.3.1