jeffsocal / tidyproteomics

An S3 data object and framework for common quantitative proteomic analyses
https://jeffsocal.github.io/tidyproteomics/
MIT License
33 stars 5 forks source link

Comparisons for multiple groups #12

Closed tywang-tw closed 11 months ago

tywang-tw commented 11 months ago

Hi Jeff,

I'd like to run the expression analysis for multiple comparisons such as the list below.

pairs <- list( c("exp1", "ctrl"), c("exp2", "ctrl"), c("exp3", "ctrl"), c("exp4", "ctrl"), ...)

Can you include some augments for this request? Thanks.

jeffsocal commented 11 months ago

Thank you for the suggestion. I created an option to allow for "pairs" exactly as you had pointed out for both expression() and enrichment(). This will first validate your pairs against the data to ensure those sample names exist, then it will iterate through each pair, saving the data back into the original data object. This is available in the v1.6.1 release.

data |> expression(.pairs = pairs) |> enrichment(pairs = pairs, .term = 'biological_process)