Does minSamples override minFraction when grouping?
Pembs opened this issue · comments
Hello, I use the below workflow to process my raw metabolomics data. I noticed out of the ~ 6000 features detected, 35 features have NA values for one group (76 QC samples), and only a few samples of the other group will have intensity values (~5%). These 35 features range in m/z from 400-700.
Please could anybody explain why this might arise (if I specify a minFraction but keep minSamples as 1, does the latter override the former?). Here, the minFraction is 0.5, so I would have thought features would have only been retained if they were in at least 50% of either group.
Thank you
param = CentWaveParam(
ppm = 5,
peakwidth = c(10, 45),
snthresh = 10,
noise = 10000,
prefilter = c(5, 1000),
mzdiff = 0.015,
mzCenterFun = "wMean",
integrate = 1,
fitgauss = FALSE)
##peak pick
xdata1 <- findChromPeaks(polar_data,param =param)
I use CPC and merge neighbouring peaks before alignment.
#rt alignment
obiwarpy = ObiwarpParam(binSize = 1,
distFun = "cor_opt",
response = 1,
gapInit = numeric(),
gapExtend = numeric(),
factorDiag = 2,
factorGap = 1,
localAlignment = FALSE)
register(SerialParam())
xdata_rt <- adjustRtime(xdata1, param = obiwarpy)
##grouping
xdata_group <- groupChromPeaks(xdata_rt, param=PeakDensityParam(sampleGroups = xdata_rt$sample_group, minFraction = 0.5, bw = 30, minSamples = 1,binSize = 0.01))
##fill peaks
xdata_fill <- fillChromPeaks(xdata_group, param = ChromPeakAreaParam())
Both minFraction
and minSamples
are considered (combined with a logical AND), so minSamples
does not override minFraction
. Note however that minFraction
does not mean that a chromatographic peak needs to be detected in minFraction
of samples of all groups, but only in one of the groups.
Thank you for your reply - I see, only specifying minFraction as 0.5 and minSamples as 1, got features towards the higher mz that were only in 4% of only one group not 50% ( NA for other). I'm running again, specifying minFraction as 0.5 and minSamples as half of the smaller group and will see how it affects feature presence.