title: "Decoding Intracellular Pathogen of H3N2 at the Single-Cell level using Yeskit" author: "Wei Zhang" date: "2021/09/10" output: html_document: toc: yes toc_depth: 4 toc_float: no theme: cerulean highlight: tango number_sections: yes df_print: tibble pdf_document: toc: yes toc_depth: '4' fig_caption: yes vignette: > %\VignetteIndexEntry{Tutorial} %\usepackage[UTF-8]{inputenc} %\VignetteEncoding{UTF-8} %\VignetteEngine{knitr::rmarkdown}
knitr::opts_chunk$set(echo = TRUE, cache = FALSE, eval = TRUE, warnings = FALSE, message = FALSE, fig.width = 6, fig.height = 5)
Taking the in-vitro experiment of H3N2 infection data (SRA Accession number: SRP239555) as an example, we used PathogenTrack to identify H3N2 infected cells at the single-cell level and used Yeskit to analyze and explore the biological functions that may be related to H3N2 infection.
if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") if (!requireNamespace("devtools", quietly = TRUE)) BiocManager::install("devtools") if (requireNamespace("Yeskit", quietly = TRUE)) devtools::install_github("ncrna/Yeskit")
First, we load the package:
library(Yeskit) library(topGO)
Now, let's load the single-cell count matrix:
Bystander <- scRead(sample_name = "Bystander", data_dir = system.file("extdata/H3N2_10X_matrix/Bystander/", package="Yeskit"), gene_column = 2, project_name = "H3N2", group_name = "Bystander", meta_file = system.file("extdata/H3N2_10X_matrix/Bystander/microbes.tsv", package="Yeskit") )
Infected <- scRead(sample_name = "Infected", data_dir = system.file("extdata/H3N2_10X_matrix/Infected/", package="Yeskit"), gene_column = 2, project_name = "H3N2", group_name = "Infected", meta_file = system.file("extdata/H3N2_10X_matrix/Infected/microbes.tsv", package="Yeskit"))
Then, we integrate these two Seurat
object
Integrated <- scIntegrate(object.list=list(Bystander, Infected), object.names = c("Bystander", "Infected"), batch.rm = "harmony", res = 0.7)
slot(Integrated, "misc")$Markers <- Seurat::FindAllMarkers(object = Integrated, assay = 'RNA', test.use = 'MAST')
slot(Integrated, "misc")$Infected_vs_Bystander <- scDGE(object = Integrated, comparison = c("Infected", "Bystander"), group.by = "group", min.cells = 10, logFC = 0.25, clusters = NULL)
slot(Integrated, "misc")$H3N2 <- scPathogenDGE(object = Integrated, species.by = "H3N2", min.cells = 5)
slot(Integrated, "misc")$Markers.GO <- scGO(object = Integrated, key = "Markers", logFC = 0.25, only.pos = TRUE, reference = "human")
slot(Integrated, "misc")$Infected_vs_Bystander.GO <- scGO(object = Integrated, key = "Infected_vs_Bystander", logFC = 0.25, only.pos = FALSE, reference = "human")
slot(Integrated, "misc")$H3N2.GO <- scPathogenGO(object = Integrated, key = "H3N2", clusters = NULL, species = "H3N2", logFC = 0.25)
Integrated <- scMsigdbScoring(object = Integrated, category = "H", geneSets = c("HALLMARK_INFLAMMATORY_RESPONSE", "HALLMARK_TNFA_SIGNALING_VIA_NFKB", "HALLMARK_APOPTOSIS") )
scDimPlot(object = Integrated, reduction = "umap", cols = NULL, split.by = "sample", ncol = 2, pt.size = 2)
scDensityPlot(object = Integrated, reduction = "umap", split.by = "sample", ncol = 2)
scPopulationPlot(object = Integrated, by = "cluster", cols = "sc", order = c("Bystander", "Infected"))
scPopulationPlot(object = Integrated, by = "sample", order = c("Bystander", "Infected"))
scVizMeta(object = Integrated, reduction = "umap", signature="H3N2", title = "H3N2", raster = TRUE, split.by = "sample", pt.size = 2, interval = c( Abundant = 1000, Large = 500, Medium = 100, Small = 10, Single = 1, None = 0) )
scPathogenRatioPlot(object = Integrated, species = "H3N2", split.by = "sample", ncol = 2)
scVolcanoPlot(Integrated, key = "Infected_vs_Bystander", cluster = "0", top_n = 10)
scGOBarPlot(object = Integrated, key = "Infected_vs_Bystander.GO", ont = "BP", top_n = 6, direction = "up", cluster = "0")
scGOBarPlot(object = Integrated, key = "Infected_vs_Bystander.GO", ont = "BP", top_n = 6, direction = "down", cluster = "0")
scGODotPlot(object = Integrated, key = "Infected_vs_Bystander.GO", ont = "BP", direction = "up", top_n = 10, font.size = 8)
scGODotPlot(object = Integrated, key = "Infected_vs_Bystander.GO", ont = "BP", direction = "down", top_n = 10, clusters = c("0"), font.size = 8)
scGOBarPlot(Integrated, key = "H3N2.GO", cluster = "0", extra = "H3N2", top_n = 6)
scGODotPlot(Integrated, key = "H3N2.GO", clusters = "0", extra = "H3N2", top_n = 6)
scScoreDimPlot(Integrated, signature = "HALLMARK_INFLAMMATORY_RESPONSE", split.by="sample", ncol = 2, pt.size = 2)
scScoreDimPlot(Integrated, signature = "HALLMARK_TNFA_SIGNALING_VIA_NFKB", split.by="sample", ncol = 2, pt.size = 2)
scScoreDimPlot(Integrated, signature = "HALLMARK_APOPTOSIS", split.by="sample", ncol = 2, pt.size = 2)
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.