jeffsocal / tidyproteomics

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

Uncaught error in expression analysis with stats::t.test #3

Closed ejmackrell closed 1 year ago

ejmackrell commented 1 year ago

Expected Behavior

Expression analysis with the default stats::t.test following normalization and imputation should return a tidyproteomics object.

Actual Behavior

Expression analysis with the default stats::t.test executes unsuccessfully, returning an error after attempting to extracting a p-value from the stats::t.test output. Requesting a modification of calc_pv in analysis_expressiondiff_test.R to handle p-value errors and return 1 or NA in such instances (identical data across groups) if appropriate for this test and others if applicable.

Steps to Reproduce the Problem

The reprex

hela_proteins %>% normalize(.method = "median") %>% impute() %>% expression(control / knockdown)

produces output

ℹ Normalizing quantitative data ✔ ... using median shift [495ms] ✔ Selecting best normalization method ... done ℹ ... selected median ✔ Imputing by row using the function ::, base, and min [1.8s] ℹ ... 1838 values imputed Error in dplyr::mutate(): ! Problem while computing p_value = purrr::map2(x, y, calc_pv, .method, ...). ℹ The error occurred in group 166: identifier = "A0A2R8Y783". Caused by error in t.test.default(): ! data are essentially constant

Specifications

jeffsocal commented 1 year ago

addressed in update 1.5.6 - 2023.09.07, essentially wrapping a try-catch block around the test and reporting 1 on error

ejmackrell commented 1 year ago

Works great. Thanks, Jeff!