Add optional metadata columns to summary objects with show_full_input parameter (default FALSE)#483
Add optional metadata columns to summary objects with show_full_input parameter (default FALSE)#483
Conversation
Co-authored-by: kaiemjoy <16113030+kaiemjoy@users.noreply.github.com>
Co-authored-by: kaiemjoy <16113030+kaiemjoy@users.noreply.github.com>
Co-authored-by: kaiemjoy <16113030+kaiemjoy@users.noreply.github.com>
Co-authored-by: kaiemjoy <16113030+kaiemjoy@users.noreply.github.com>
Co-authored-by: kaiemjoy <16113030+kaiemjoy@users.noreply.github.com>
❌ 8 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
|
📖 https://UCD-SERG.github.io/serocalculator/preview/pr483/ |
|
@copilot fix these linting issues: Warning: file=R/est_seroincidence.R,line=71,col=5,[undesirable_function_linter] Avoid undesirable function "message". As an alternative, use cli::cli_inform(). |
Co-authored-by: kaiemjoy <16113030+kaiemjoy@users.noreply.github.com>
Fixed all linting issues in commit 7985a21: R/est_seroincidence.R:
R/summary.seroincidence.by.R:
Test files:
|
|
@copilot, address all these errors: Run files <- gh::gh("GET https://api.github.com/repos/UCD-SERG/serocalculator/pulls/483/files")
|
Co-authored-by: kaiemjoy <16113030+kaiemjoy@users.noreply.github.com>
Fixed all issues in commit 57cfcdc: Linting fixes:
Version and changelog:
|
|
@copilot fix all the lint errors |
Co-authored-by: kaiemjoy <16113030+kaiemjoy@users.noreply.github.com>
Fixed all lint errors in commit 20b8a1a: tests/testthat/test-summary.seroincidence.by.R:
All files now pass linting with 0 errors. |
Co-authored-by: kaiemjoy <16113030+kaiemjoy@users.noreply.github.com>
Changed metadata from attributes to columns in commit 1cf4511: Columns added to summary tibble:
All metadata is now directly accessible as columns in the summary tibble instead of as attributes. The noise parameter column names are now more meaningful and self-descriptive. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot instead of 1 &2 can you append the name of the antigen-iso? also add the names of the noise param file and the seroresponse file that was used |
Co-authored-by: kaiemjoy <16113030+kaiemjoy@users.noreply.github.com>
Updated in commit bcb6247: Column names now use antigen-iso names:
Added object name columns:
Note: These are R object names, not file names, since the parameters are passed as R data objects. The names are captured using |
|
@copilot we don't need n.pop.data as it is redundant to n. for the file names columns just call back the input objects names here: pop_data = sees_pop_data_pk_100, |
Co-authored-by: kaiemjoy <16113030+kaiemjoy@users.noreply.github.com>
Implemented all changes in commit 21d85d1:
Example usage: # With full input (default)
summary(est) # Shows noise params, counts, and object names
# Without full input
summary(est, show_full_input = FALSE) # Cleaner output, just estimatesWarning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot very close but i want the default to not show the full input parameter (default show = F) |
Co-authored-by: kaiemjoy <16113030+kaiemjoy@users.noreply.github.com>
|
@copilot, close but the output is not working when using est_seroincidence_by(): est3 <- est_seroincidence_by( summ3 <- summary(est3, show_full_input = TRUE)
|
Co-authored-by: kaiemjoy <16113030+kaiemjoy@users.noreply.github.com>
Fixed in commit a9be491. The object names now display correctly as simple names (e.g., "sees_pop_data_pk_100", "typhoid_curves_nostrat_100", "example_noise_params_pk") instead of the complex structure representations. The fix captures object names at the top level in |

Description
Summary objects for
seroincidenceandseroincidence.bynow optionally expose key analysis parameters as columns with antigen-specific naming and full provenance information via a newshow_full_inputparameter (defaultFALSE).Changes Made
est_seroincidence(): Captures noise parameters, observation counts, stratification status, and R object names (pop_data, sr_params, noise_params) as attributes usingdeparse(substitute())for single-level callsest_seroincidence_by(): Captures input object names at the function call level and passes them through to individual stratum fits, ensuring correct object name propagation in both parallel and serial processing modessummary.seroincidence(): Addedshow_full_inputparameter (defaultFALSE) to optionally include metadata columns with antigen-specific names (e.g.,measurement.noise.HlyE_IgA,biological.noise.HlyE_IgG) and input object name columns matching function parameter namessummary.seroincidence.by(): Passes throughshow_full_inputparameter and aggregates metadata columns from individual strata usingvapply(); replacedstop()withcli::cli_abort()show_full_inputparameter and metadata columnsshow_full_inputSummary Columns Added (when show_full_input = TRUE)
Antigen-specific noise parameters:
measurement.noise.<antigen>: measurement noise (eps) for each antigen-isotype (e.g.,measurement.noise.HlyE_IgA)biological.noise.<antigen>: biological noise (nu) for each antigen-isotype (e.g.,biological.noise.HlyE_IgG)Count column:
n.seroresponse.params: Number of longitudinal seroresponse parameter observationsStatus column:
seroresponse.params.stratified: Logical indicating whether seroresponse parameters were stratifiedInput object name columns (matching function parameter names):
pop_data: R object name for population data passed to the function (correctly captured even in stratified analyses)sr_params: R object name for seroresponse parameters passed to the functionnoise_params: R object name for noise parameters passed to the functionExample
Testing
show_full_input = FALSE(default) excludes metadata columnsshow_full_input = TRUEincludes metadata columnsest_seroincidence()andest_seroincidence_by()Checklist
testthat).Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.