Skip to contents

Compute cell type enrichments using xCell cell markers with Fisher test.

Usage

compute_xCell_enrichment(
  membership_matrix,
  K = 100,
  memb_cut = 0.65,
  p_cut = 0.001
)

Arguments

membership_matrix

a community membership (kME) matrix with genes as rows and communities as columns. Often community_membership or full_community_membership output from icwgcna()

K

cutoff for top community genes to include for computing enrichment. Used in an AND condition with memb_cut.

memb_cut

cutoff as a membership score threshold for determining top community genes for computing enrichment. Used in an AND condition with K.

p_cut

p value cutoff for determining importance. If all p values are below p_cut for a community, no cell type is selected

Value

Returns a list with the following items:

  • top_enr - the most significant cell type from the enrichment scores.

  • full_enr - all panglaoDB cell type enrichment scores for all communities.

Details

note that this is distinct from running xCell which is run on expression data. This is an enrichment using their cell markers.

Examples

if (FALSE) { # \dontrun{
library("UCSCXenaTools")
luad <- getTCGAdata(
  project = "LUAD", mRNASeq = TRUE, mRNASeqType = "normalized",
  clinical = FALSE, download = TRUE
)
ex <- as.matrix(data.table::fread(luad$destfiles), rownames = 1)
results <- icwgcna(ex)

compute_xCell_enrichment(results$community_membership)
} # }