Hi,
Functions like mean(), sum(), and others typically include an na.rm parameter, which allows you to control whether NA values should be excluded from calculations. However, it appears that aggregation functions in scuttle do not provide an option for excluding NA values. While one could convert NA values to 0, this approach is not appropriate for calculating the mean.
Could an na.rm option be added to handle this case?
library(scuttle)
sce <- mockSCE()[1:5, 1:2]
ids <- c("A", "B", "A", "C", "D")
assay(sce)[1, ] <- NA
sumCountsAcrossFeatures(assay(sce), ids)
Cell_001 Cell_002
A NA NA
B 111 98
C 260 233
D 64 70
summarizeAssayByGroup(sce, c("A", "A")) |> assay()
A
Gene_0001 NA
Gene_0002 104.5
Gene_0003 5.0
Gene_0004 246.5
Gene_0005 67.0
Hi,
Functions like
mean(),sum(), and others typically include anna.rmparameter, which allows you to control whetherNAvalues should be excluded from calculations. However, it appears that aggregation functions inscuttledo not provide an option for excludingNAvalues. While one could convertNAvalues to0, this approach is not appropriate for calculating the mean.Could an
na.rmoption be added to handle this case?