epiverse-trace / epiparameter

R package with library of epidemiological parameters for infectious diseases and functions and classes for working with parameters
https://epiverse-trace.github.io/epiparameter
Other
33 stars 11 forks source link

show if epiparameter is `extrinsic` TRUE or FALSE #363

Open avallecam opened 4 months ago

avallecam commented 4 months ago

Is your feature request related to a problem? Please describe.

The extrinsic incubation periods are only two, but the current interface does not show the variable "extrinsic" yet

library(epiparameter)
library(tidyverse)
epidist_db(subset = extrinsic == TRUE)
#> Returning 2 results that match the criteria (2 are parameterised). 
#> Use subset to filter by entry variables or single_epidist to return a single entry. 
#> To retrieve the citation for each use the 'get_citation' function
#> # List of 2 <epidist> objects
#> Number of diseases: 1
#> ❯ Dengue
#> Number of epi distributions: 1
#> ❯ incubation period
#> [[1]]
#> Disease: Dengue
#> Pathogen: Dengue Virus
#> Epi Distribution: incubation period
#> Study: Chan M, Johansson M (2012). "The Incubation Periods of Dengue Viruses."
#> _PLoS One_. doi:10.1371/journal.pone.0050972
#> <https://doi.org/10.1371/journal.pone.0050972>.
#> Distribution: lnorm
#> Parameters:
#>   meanlog: 2.553
#>   sdlog: 0.481
#> 
#> [[2]]
#> Disease: Dengue
#> Pathogen: Dengue Virus
#> Epi Distribution: incubation period
#> Study: Chan M, Johansson M (2012). "The Incubation Periods of Dengue Viruses."
#> _PLoS One_. doi:10.1371/journal.pone.0050972
#> <https://doi.org/10.1371/journal.pone.0050972>.
#> Distribution: lnorm
#> Parameters:
#>   meanlog: 1.792
#>   sdlog: 0.468
#> 
#> # ℹ Use `parameter_tbl()` to see a summary table of the parameters.
#> # ℹ Explore database online at: https://epiverse-trace.github.io/epiparameter/dev/articles/database.html

epidist_db(subset = extrinsic == TRUE) %>% 
  parameter_tbl()
#> Returning 2 results that match the criteria (2 are parameterised). 
#> Use subset to filter by entry variables or single_epidist to return a single entry. 
#> To retrieve the citation for each use the 'get_citation' function
#> # Parameter table:
#> # A data frame:    2 × 7
#>   disease pathogen   epi_distribution prob_distribution author  year sample_size
#>   <chr>   <chr>      <chr>            <chr>             <chr>  <dbl>       <dbl>
#> 1 Dengue  Dengue Vi… incubation peri… lnorm             Chan …  2012         146
#> 2 Dengue  Dengue Vi… incubation peri… lnorm             Chan …  2012         146

Created on 2024-08-02 with reprex v2.1.0

Describe the solution you'd like

Possibly related with #50, the solution could include a line in the epidist/epiparameter class object print saying extrinsic: FALSE or extrinsic: TRUE. Also a column in the parameter_tbl() output

Additional context It's not urgent, but it's for your consideration. Although {epiparameter} currently only has Denge extrinsic incubation period, when Zika values be added we can showcase them in how-to guides about the usage of {epiparameter} to access inputs to a Zika model build with {deSolve} as a next step for learners after reading the "building a simple mathematical model for Zika" (Spanish, English)

joshwlambert commented 3 months ago

Thanks for raising @avallecam. The extrinsic field in the <epiparameter> object was originally used in the <vb_epidist> class to link intrinsic and extrinsic epidemiological parameters. Now it is just a descriptor of whether the parameter set is either for the vector or the human.

On the proposed solution, I do not want to add too many fields to the print method or the output of parameter_tbl() as I think it would become overly complex for the user and we want to distill the key information. Especially for extrinsic as I don't think this information is used very often by users and so in most cases would be unnecessary information.

One possible solution could be to add extrinsic: TRUE in the print out for only extrinsic parameter sets. This would help users identify if they are using parameters for the vector. It's not a perfect solution as it would produce discrepancies between printing different <epiparameter> objects. Let me know what you think and we can further discuss.