Compute Cell Type Enrichments Using xCell Cell Markers
Source:R/downstream.R
compute_xCell_enrichment.Rd
Compute cell type enrichments using xCell cell markers with Fisher test.
Arguments
- membership_matrix
a community membership (kME) matrix with genes as rows and communities as columns. Often
community_membership
orfull_community_membership
output fromicwgcna()
- 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)
} # }