Compute Cell Type Enrichments Using xCell Cell Markers
Source:R/downstream.R
compute_xCell_enrichment.RdCompute 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_membershiporfull_community_membershipoutput 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_cutfor 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)
} # }