View source: R/pipeline_wrappers.R
process_abundance_expression_info | R Documentation |
process_abundance_expression_info
Visualize cell type abundances. Calculate the average and fraction of expression of each gene per sample and per group. Calculate relative abundances of cell types as well. Under the hood, the following functions are used: 'get_avg_frac_exprs_abund', 'process_info_to_ic', 'combine_sender_receiver_info_ic'
process_abundance_expression_info(sce, sample_id, group_id, celltype_id, min_cells = 10, senders_oi, receivers_oi, lr_network, batches = NA, frq_list, abundance_info)
sce |
SingleCellExperiment object of the scRNAseq data of interest. Contains both sender and receiver cell types. |
sample_id |
Name of the meta data column that indicates from which sample/patient a cell comes from |
group_id |
Name of the meta data column that indicates from which group/condition a cell comes from |
celltype_id |
Name of the column in the meta data of sce that indicates the cell type of a cell. |
min_cells |
Indicates the minimal number of cells that a sample should have to be considered in the DE analysis. Default: 10. See 'muscat::pbDS'. |
senders_oi |
Default NULL: all celltypes will be considered as senders. If you want to select specific senders_oi: you can add this here as character vector. |
receivers_oi |
Default NULL: all celltypes will be considered as receivers. If you want to select specific receivers_oi: you can add this here as character vector. |
lr_network |
Prior knowledge Ligand-Receptor network (columns: ligand, receptor) |
batches |
NA if no batches should be corrected for. If there should be corrected for batches during DE analysis and pseudobulk expression calculation, this argument should be the name(s) of the columns in the meta data that indicate the batch(s). Should be categorical. Pseudobulk expression values will be corrected for the first element of this vector. |
frq_list |
output of 'get_frac_exprs' |
rel_abundance_df |
'rel_abundance_df' slot of 'get_abundance_info()' output. |
List containing data frames with average and fraction of expression per sample and per group, and relative cell type abundances as well.
## Not run:
library(dplyr)
lr_network = readRDS(url("https://zenodo.org/record/3260758/files/lr_network.rds"))
lr_network = lr_network %>% dplyr::rename(ligand = from, receptor = to) %>% dplyr::distinct(ligand, receptor)
sample_id = "tumor"
group_id = "pEMT"
celltype_id = "celltype"
senders_oi = SummarizedExperiment::colData(sce)[,celltype_id] %>% unique()
receivers_oi = SummarizedExperiment::colData(sce)[,celltype_id] %>% unique()
abundance_info = get_abundance_info(sce = sce, sample_id = sample_id, group_id = group_id, celltype_id = celltype_id, min_cells = 10, senders_oi = senders_oi, receivers_oi = receivers_oi)
frq_list = get_frac_exprs(sce = sce, sample_id = sample_id, celltype_id = celltype_id, group_id = group_id)
abundance_celltype_info = process_abundance_expression_info(sce = sce, sample_id = sample_id, group_id = group_id, celltype_id = celltype_id, min_cells = 10, senders_oi = senders_oi, receivers_oi = receivers_oi, lr_network, frq_list = frq_list, abundance_info = abundance_info)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.