Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COVID outbreak simulator example #4

Open
gaow opened this issue Oct 2, 2020 · 3 comments
Open

COVID outbreak simulator example #4

gaow opened this issue Oct 2, 2020 · 3 comments
Assignees

Comments

@gaow
Copy link

gaow commented Oct 2, 2020

Below is a demonstration of DSC running https://github.com/ictr/covid19-outbreak-simulator @BoPeng developed.

issue_3.tar.gz

@BoPeng this bundle contains the DSC script and output. A notebook is included in it, which I'll also paste below for us to see. It would be great if you could try it out :) It is a naive replica of the simulation notebook you provided me so it might not look much more elegant than your original notebook implementation. But at least you see to an end user all they have to provide is a short dsc configuration file, and their own Python script; and use a query at the end to load results.

@junyanj1 @lmxy0212 : Dr. Peng (@BoPeng ) is associate professor of computational biology and epidemiology at Baylor College of Medicine. He is the creator of SoS and SoS notebook on which DSC is built. Dr. Peng will help us (by providing you instructions and suggestions) to improve the engineering of DSC, and explore more applications of it.

@BoPeng : Junyang and Manxueying are master students of CS at Columbia. They are working with me for the Fall semester (and hopefully beyond!) on DSC. Just here to make an introduction, and looking forward to the collaboration!

@gaow
Copy link
Author

gaow commented Oct 2, 2020

DSC demonstration of the COVID outbreak simulator

To install DSC,

pip install dsc

To run a test (one paramter combination) to make sure everything works,

dsc covid_simulator.dsc --truncate 
INFO: DSC script exported to �[32mtest_output.html�[0m
INFO: Constructing DSC from �[32mcovid_simulator.dsc�[0m ...
INFO: Building DSC database ...
�[32m[�[0m�[97m.�[0m�[97m.�[0m�[97m.��[32m.�[0�[32m#�[0m�[33m#�[0m�[32m#�[0m�[32m]�[0m 3 steps processed (3 jobs completed)
INFO: DSC complete!
INFO: Elapsed time �[32m5.218�[0m seconds.

To run all analysis on a local computer,

dsc covid_simulator.dsc
INFO: DSC script exported to �[32mtest_output.html�[0m
INFO: Constructing DSC from �[32mcovid_simulator.dsc�[0m ...
INFO: Building DSC database ...

3 steps processed (182 jobs completed)
INFO: DSC complete!
INFO: Elapsed time �[32m85.918�[0m seconds.

To submit job to the cluster,

dsc covid_simulator.dsc --host midway.yml
tree test_output
�[01;34mtest_output�[00m
├── �[01;34msimulate�[00m
│   ├── simulate_100.pkl
│   ├── simulate_100.stderr
│   ├── simulate_101.pkl
│   ├── simulate_101.stderr
│   ├── simulate_102.pkl
│   ├── simulate_102.stderr
│   ├── simulate_103.pkl
│   
├── test_output.conf.mpk
├── test_output.db
└── test_output.map.mpk

1 directory, 365 files

To extract results, you need to install the dscrutils package at:

https://github.com/stephenslab/dsc/tree/master/dscrutils

library(dscrutils)
res = dscquery('test_output', 
               targets = c("simulate.quarantine_days", "simulate.test_name", "simulate.test_days", "simulate.failure_rate"),
               verbose = FALSE)
tail(res)
A data.frame: 6 × 5
DSCsimulate.quarantine_dayssimulate.test_namesimulate.test_dayssimulate.failure_rate
<int><int><chr><chr><int>
17518AG855, 71111
17618AG855, 71111
17718AG855, 71111
17818AG855, 71111
17918AG855, 71111
18018AG855, 71111

@gaow
Copy link
Author

gaow commented Oct 3, 2020

@lmxy0212 Depending on what you are interested in, I'm thinking of either get your help to improve the DSC syntax parser, or implementing more benchmark like this above using DSC, or perhaps both. We can discuss it in our next meeting.

@lmxy0212
Copy link
Collaborator

lmxy0212 commented Oct 3, 2020

I also notice that reticulate package is also needed for extracting result

install.packages("reticulate")
library(reticulate)

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

No branches or pull requests

2 participants