top_differential_markers: Retrieve top marker genes from list of differential analysis

View source: R/interpretation.R

top_differential_markersR Documentation

Retrieve top marker genes from list of differential analysis

Description

Retrieve top marker genes from list of differential analysis

Usage

top_differential_markers(
  object,
  top = 1,
  gene_col = "gene",
  logFC_col = "avg_log2FC",
  qvalue_col = "p_val_adj",
  order_by = c("logFC_col", "qvalue_col")[1],
  pseudogene_pattern = NULL
)

Arguments

object

A data.frame of differential features at each clustering iteration produced by iterative_differential_clustering() ("IDC_DA.csv").

top

An integer specifying the number of top features to retrieve per cluster.

gene_col

A character specifying the column in which to retrieve the gene / feature name.

logFC_col

A character specifying the column in which to retrieve the logFC.

qvalue_col

A character specifying the column in which to retrieve the adjusted p.value.

order_by

A character specifying the column by which to order the top markers (default to logFC_col.

pseudogene_pattern

A character specifying the pattern of 'pseudo-genes' to exclude from the top markers.

Examples

#scRNA
data("IDC_DA_scRNA", package = "IDclust")

top_differential_markers(
    IDC_DA_scRNA,
    top = 1,
    gene_col = "gene",
    logFC_col = "avg_log2FC",
    qvalue_col = "p_val_adj",
    order_by = "logFC_col",
    pseudogene_pattern = NULL
)

#scEpigenomics
data("scExp", package = "IDclust")
data("IDC_DA_scEpigenomics", package = "IDclust")

# We must first add the gene information to the DA list: 
IDC_DA_scEpigenomics = add_gene_to_DA_list(
    scExp = scExp, 
    IDC_DA = IDC_DA_scEpigenomics,
    feature_ID_col = "ID", 
    gene_col = "Gene", 
    distanceToTSS = 1000,
    split = TRUE,
    split_char = ", "
)

top_differential_markers(
    IDC_DA_scEpigenomics,
    top = 3,
    gene_col = "Gene",
    logFC_col = "logFC",
    qvalue_col = "qval",
    order_by = "logFC_col",
    pseudogene_pattern = "Rik|Vmn|Gm|AW"
)
    

vallotlab/IDclust documentation built on July 5, 2024, 3:26 p.m.