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.
Examples
if (FALSE) { # \dontrun{
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)
}
} # }