Guidance for the designSampleSize function

15 views
Skip to first unread message

Sam Siljee

unread,
Mar 24, 2026, 11:53:49 PMMar 24
to MSstats
Hi all,

I'd like some help using the designSampleSize function from the MSstats package, apologies in advance for my ignorance!

My project design has eight biological replicates, three technical replicates, and two experimental conditions. I have a paired design, with the same biological replicate used across both experimental condition.
I'd like to provide some evidence for the statement that my design supports findings from paired comparisons (experimental condition A vs  experimental condition B), but not group-based comparison (female biological replicates vs male biological replicates). I ran a variety of different comparisons with the comparison matrix, but mostly I used it to account for covariates.

I'm using the designSampleSize function using the following code:

sample_size_calc <- designSampleSize(
  data = test_MSstats$FittedModel,
  desiredFC = c(1.3, 2.5),
  FDR = 0.05,
  numSample = 8,
  power = TRUE
)

However my problem is that the result doesn't appear to make any distinction by comparison.
Should I run the model based comparison separately for each comparison, and then run the designSampleSize comparison separately on each resulting model?

Thanks,
Sam

Anthony Wu

unread,
Apr 8, 2026, 4:11:35 PM (19 hours ago) Apr 8
to MSstats

Hi Sam,

Sorry for the delayed response.  This is a great question and requires some thinking.

At the moment, designSampleSize is set up to reflect the sample size estimation for direct pairwise comparisons (e.g. disease male vs disease female; disease male vs control female; etc.).  However, it doesn't handle sample size estimation with covariates at the moment.  With covariates, the estimated number of samples should decrease.  I'd need to investigate further to understand the extent of this decrease; I can say confidently it depends on your comparison of interest.

We can look to add a feature to account for your comparison for sample size calculation if you think that'd be useful.  

Thanks,

Tony

Sam Siljee

unread,
Apr 8, 2026, 7:35:02 PM (16 hours ago) Apr 8
to MSstats
Hi Tony,

Thanks for your response!
I note that I'm getting plenty of differentially abundant proteins for paired comparisons, almost none for unpaired comparisons.  Essentially I wanted to make the argument in my thesis that I had sufficient sample size for paired comparisons, but not for unpaired comparisons, due to different tests being used for statistical significance in these comparisons. I wanted to use the power analysis to support this, but at this point I think I'll just compare the proportions of protein found to be statistically significant.
Hopefully this clears up what I'm after!

Sam

Anthony Wu

unread,
10:34 AM (1 hour ago) 10:34 AM
to MSstats
That makes a lot of sense that the paired design had more differentially abundant proteins.  I agree that's enough evidence you had sufficient sample size for paired vs unpaired designs.


Thanks for the context.

Tony

Reply all
Reply to author
Forward
0 new messages