ftwkoopmans / msdap

MS-DAP: downstream analysis pipeline for quantitative proteomics
GNU General Public License v3.0
29 stars 6 forks source link

Technical replicates averaging before group comparation #14

Closed DiQin2023 closed 1 year ago

DiQin2023 commented 1 year ago

Hi, Thanks for the nice package! I have 2-3 technical replicates for each sample in my dataset, how can I make sure they are averaged before group comparison? Thanks!

ftwkoopmans commented 1 year ago

Perhaps you should account for the technical replicates in the statistical model instead of averaging values in the dataset (prior to statistical comparison of your experimental conditions). You can add random variables to the DEqMS and MSqRob linear regression models using the 'random_variables' parameter in the setup_contrasts() function. Example; dataset = setup_contrasts(dataset, contrast_list = list(c("control","disease")), random_variables = "patient") (assuming that 'patient' is a column in your sample metadata & this "groups" your technical replicates / repeated measurements of the same individual). This would be the easiest solution, but I'm not 100% sure if that applies to your dataset, it kind of depends on your experimental design; please consult your lab's statistician.

If you want to go down the route of averaging the data between replicates; this is not a built-in MS-DAP feature. But here's an example of how you could do this; 1) usual MS-DAP workflow of preparing the input data; import dataset, fasta files and sample metadata 2) apply the filter_dataset() function to perform filtering & normalization 3) write some code that summarizes/collapses the dataset$peptides table (unfortunately, I don't have time to help you write this code atm) 4) apply the dea() function to perform statistics

ftwkoopmans commented 1 year ago

release 1.0.6 is now live and includes a function for merging technical replicates right after importing the data (i.e. prior to any filtering/normalizing/stats). After updating MS-DAP (instructions on main MS-DAP GitHub page), see help page for the new merge_replicate_samples() function (e.g. by issuing the R command ?merge_replicate_samples , after installing the updated R package).

previous recommendations still apply though; for some datasets it's better to deal with replicate measurements in statistical modeling (please consult with your local statistician)

DiQin2023 commented 1 year ago

Dear Frank,

Thanks for your reply and kind suggestions. I tried your first suggestion of treating the replicates as random variables but popped up too many differential proteins. I will definitely update to the new version and try this new function. Thanks again for your amazing package, it's very handy and useful!

Best, Di


From: Frank Koopmans @.> Sent: Wednesday, August 23, 2023 23:22 To: ftwkoopmans/msdap @.> Cc: DiQin2023 @.>; Author @.> Subject: Re: [ftwkoopmans/msdap] Technical replicates averaging before group comparation (Issue #14)

release 1.0.6 is now live and includes a function for merging technical replicates right after importing the data (i.e. prior to any filtering/normalizing/stats). After updating MS-DAP (instructions on main MS-DAP GitHub page), see help page for the new merge_replicate_samples() function (e.g. by issuing the R command ?merge_replicate_samples , after installing the updated R package).

previous recommendations still apply though; for some datasets it's better to deal with replicate measurements in statistical modeling (please consult with your local statistician)

— Reply to this email directly, view it on GitHubhttps://github.com/ftwkoopmans/msdap/issues/14#issuecomment-1690658549, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A6WS3H55CXXY6AZH6JJE5XTXWZYBJANCNFSM6AAAAAAY7G3UFY. You are receiving this because you authored the thread.Message ID: @.***>