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:
#| fig.cap="Quality control for bystander" 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") )
#| fig.cap="Quality control for bystander" 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
#| fig.cap="Harmony Interation" Integrated <- scIntegrate(object.list=list(Bystander, Infected), object.names = c("Bystander", "Infected"), batch.rm = "harmony", resolution = 0.7)
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")$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 = "HALLMARK_INFLAMMATORY_RESPONSE" )
#| fig.cap="Cell DimPlot" scDimPlot(object = Integrated, reduction = "umap", cols = NULL, split.by = "sample", ncol = 2, pt.size = 2)
#| fig.cap="Cell Density Plot" scDensityPlot(object = Integrated, reduction = "umap", split.by = "sample", ncol = 2)
the x axis stands for clusters
#| fig.cap="Cell Population Plot by cluster" scPopulationPlot(object = Integrated, by = "cluster", cols = "sc", order = c("Bystander", "Infected"))
#| fig.cap="H3N2 DimPlot" 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) )
#| fig.cap="H3N2 Ratio Plot" scPathogenRatioPlot(object = Integrated, species = "H3N2", split.by = "sample", ncol = 2)
#| fig.cap="Volcano Plot of Infected_vs_Bystander" scVolcanoPlot(object = Integrated, key = "Infected_vs_Bystander", cluster = "0", top_n = 10)
#| fig.cap="Infected_vs_Bystander.GO_up" scGOBarPlot(object = Integrated, key = "Infected_vs_Bystander.GO", ont = "BP", top_n = 6, direction = "up", cluster = "0")
#| fig.cap="Infected_vs_Bystander.GO_down" scGOBarPlot(object = Integrated, key = "Infected_vs_Bystander.GO", ont = "BP", top_n = 6, direction = "down", cluster = "0")
#| fig.cap="Infected_vs_Bystander.GO_up" scGODotPlot(object = Integrated, key = "Infected_vs_Bystander.GO", ont = "BP", direction = "up", top_n = 10, font.size = 8)
#| fig.cap="Infected_vs_Bystander.GO_down" scGODotPlot(object = Integrated, key = "Infected_vs_Bystander.GO", ont = "BP", direction = "down", top_n = 10, clusters = c("0"), font.size = 8)
#| fig.cap="H3N2pos_vs_H3N2neg.GO_up" scGOBarPlot(object = Integrated, key = "H3N2.GO", cluster = "0", extra = "H3N2", top_n = 6)
#| fig.cap="H3N2pos_vs_H3N2neg.GO_up" scGODotPlot(object = Integrated, key = "H3N2.GO", clusters = "0", extra = "H3N2", top_n = 6)
#| fig.cap = "HALLMARK_INFLAMMATORY_RESPONSE" scScoreDimPlot(object = Integrated, signature = "HALLMARK_INFLAMMATORY_RESPONSE", 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.