View source: R/expression_processing.R
fix_frq_df | R Documentation |
fix_frq_df
Fix muscat-feature/bug in fraction calculation: in case a there are no cells of a cell type in a sample, that expression fraction will be NA / NaN. Change these NA/NaN to 0.
fix_frq_df(sce, frq_celltype_samples)
sce |
SingleCellExperiment object of the scRNAseq data of interest. Contains both sender and receiver cell types. |
frq_celltype_samples |
Sample-average data frame output of 'get_muscat_exprs_frac' |
Fixed data frame with fraction of cells expressing a gene.
## Not run:
library(dplyr)
sample_id = "tumor"
group_id = "pEMT"
celltype_id = "celltype"
frq_df = get_muscat_exprs_frac(sce, sample_id = sample_id, celltype_id = celltype_id, group_id = group_id) %>% .$frq_celltype_samples
if(nrow(frq_df %>% dplyr::filter(is.na(fraction_sample))) > 0 | nrow(frq_df %>% dplyr::filter(is.nan(fraction_sample))) > 0) {
frq_df = fix_frq_df(sce, frq_df)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.