irGSEA.hub: Calculate the hub gene of the geneset

View source: R/irGSEA.hub.R

irGSEA.hubR Documentation

Calculate the hub gene of the geneset

Description

Easy to calculate the hub gene of the geneset based on the correlation between the geneset's score and the expression or rank of gene included in the geneset

Usage

irGSEA.hub(
  object = NULL,
  assay = "RNA",
  slot = "data",
  method = NULL,
  show.geneset = NULL,
  ncores = 4,
  type = "rank",
  maxRank = 2000,
  top = 5,
  correlation.color = c("#0073c2", "white", "#efc000"),
  method.color = NULL
)

Arguments

object

A Seurat after perform irGSEA.score

assay

Name of assay to calculate the correction. Default RNA.

slot

Default data.

method

A character.

show.geneset

A character.

ncores

Default 4.

type

expression or rank. Default rank. Calculate the correlation between the geneset's score and the rank of gene included in the geneset while the type is rank. Calculate the correlation between the geneset's score and the expression of gene included in the geneset while the type is expression.

maxRank

Maximum number of genes to rank per cell; above this rank, a given gene is considered as not expressed. Default 2000.

top

The number of top-ranked positively correlated genes in each method is displayed in a heatmap.

correlation.color

A vector.

method.color

A vector. Default "ggsci::pal_png()(the number of methods)" when it is set to NULL.

Value

list includes hub_result and hub_plot

Examples

## Not run: 
# load PBMC dataset by R package SeuratData
library(Seurat)
library(SeuratData)
# download 3k PBMCs from 10X Genomics
InstallData("pbmc3k")
data("pbmc3k.final")
pbmc3k.final <- SeuratObject::UpdateSeuratObject(pbmc3k.final)

# Seurat object
pbmc3k.final <- irGSEA.score(object = pbmc3k.final, assay = "RNA",
slot = "data", msigdb = T, species = "Homo sapiens",
category = "H", geneid = "symbol",
method = c("AUCell", "UCell", "singscore", "ssgsea"), kcdf = 'Gaussian')

hub.result <- irGSEA.hub(object = pbmc3k.final, assay = "RNA", slot = "data",
method = c("AUCell","UCell","singscore", "ssgsea"),
show.geneset = c("HALLMARK-INFLAMMATORY-RESPONSE", "HALLMARK-APOPTOSIS"),
ncores = 4, type = "rank", maxRank = 2000, top = 5,
correlation.color = c("#0073c2","white","#efc000"), method.color = NULL)

head(hub.result$hub_result)
hub.result$hub_plot$`HALLMARK-APOPTOSIS`
hub.result$hub_plot$`HALLMARK-INFLAMMATORY-RESPONSE`



## End(Not run)


chuiqin/irGSEA documentation built on July 27, 2024, 6:27 a.m.