Skip to content

Modify and add some .qmd and .R files.#4

Open
Kwan-Jenny wants to merge 22 commits intomainfrom
practice_Kwan
Open

Modify and add some .qmd and .R files.#4
Kwan-Jenny wants to merge 22 commits intomainfrom
practice_Kwan

Conversation

@Kwan-Jenny
Copy link
Copy Markdown
Collaborator

I modified two .qmd files and added one new .qmd file. I also added some R function files. I think I may need to delete some unnecessary R function files.

There are three .qmd files. Please review them step by step:

  1. shigella-kinetics.qmd
  2. _sec_outtakes-data-load.qmd
  3. simulation-shigella.qmd

Please go through the .qmd files above in order.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 26, 2025

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

Copy link
Copy Markdown
Member

@d-morrison d-morrison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is looking great! Please address my inline comments, and try to get all the automated checks to pass; if you have questions about any of those checks, please tag me in a comment on this PR, and we can discuss them when we meet.


```
-->
I think the commented-out section above is not necessary in this .qmd file. I would like to generate simulated data from the longitudinal data for this .qmd file only. The section above will be handled in the _ses_outtakes-data-load.qmd file.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with taking this part out; in fact, let's limit this .qmd even further; it should only contain the code that fits the longitudinal model to the real longitudinal data, performs MCMC diagnostics, and graphs the fitted model.

Simulating longitudinal data from an existing seroresponse model should be a separate .qmd.

curve_params_shigella <- jags.post |> postprocess_jags_output()
usethis::use_data(curve_params_shigella, overwrite = TRUE)

#curve_params_shigella <- jags.post |> postprocess_jags_output() #somehow it doesn't work
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what error did it produce?


#curve_params_shigella <- jags.post |> postprocess_jags_output() #somehow it doesn't work

# Use Sam's package rather than my current R function
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version of postprocess_jags_data() in the {serodynamics} package is an extended version of your function from this project.
We can remove the original version from this project, and we can use and extend the {serodynamics} version going forward;
it's not inherently specific to shigella, so it belongs in the serodynamics package.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion for line 2:

  generate_final_table <- function(results_list, sample_size = attr(results_list, "sample_size")) {

See related change to end of simulated_seroincidence2(); metadata such as sample size should stay connected to the corresponding object

the output of generate_final_table() should also have attributes sample_size and age_range

Comment on lines +136 to +145
ggplot(summary_metrics_combined, aes(x = sample_size, y = empirical_se, color = Age_Group)) +
geom_line() +
geom_point() +
labs(
title = "IpaB-IgG with the Smallest Lambda",
x = "Sample Size",
y = "Empirical Standard Error",
color = "Age Group"
) +
theme_minimal()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's turn all this ggplot code (lines 136-145) into a function?

Kwan-Jenny and others added 19 commits March 3, 2025 13:23
Co-authored-by: Douglas Ezra Morrison <demorrison@ucdavis.edu>
Co-authored-by: Douglas Ezra Morrison <demorrison@ucdavis.edu>
Co-authored-by: Douglas Ezra Morrison <demorrison@ucdavis.edu>
Co-authored-by: Douglas Ezra Morrison <demorrison@ucdavis.edu>
Co-authored-by: Douglas Ezra Morrison <demorrison@ucdavis.edu>
Co-authored-by: Douglas Ezra Morrison <demorrison@ucdavis.edu>
Co-authored-by: Douglas Ezra Morrison <demorrison@ucdavis.edu>
Co-authored-by: Douglas Ezra Morrison <demorrison@ucdavis.edu>
Co-authored-by: Douglas Ezra Morrison <demorrison@ucdavis.edu>
Co-authored-by: Douglas Ezra Morrison <demorrison@ucdavis.edu>
Co-authored-by: Douglas Ezra Morrison <demorrison@ucdavis.edu>
Merge branch 'practice_Kwan' of https://github.com/UCD-SERG/shigella into practice_Kwan
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants