PlusOneData / NetworkInfection

2 stars 0 forks source link

Graph COP Community Coding Sessions

This is a repo dedicated to community coding sessions in which we get together and trouble shoot problems related to graphs.


Installing local packages

devtools::install("./path/to/package")

or

install.packages("./path/to/package/root/dir", repo = NULL, type = "source")


Getting familiar with the code

The infection.graph package uses modules to extend a network based discrete time SIR model.

Modules have two components:

init - how should this module modify initial conditions

next - how should this module modify conditions in the next time step

Modules are combined to create an infection model which is then run on a particular network (g).

The network is either generated synthetically or created by surveying individuals in group. (plan to extend with ergm)

To get the central tendencies of system, we run infection model hundreds or thousands of times to create a distribution outcomes.

Summary of Approach

SARS-COV-2 infections result from interactions at fine spatial and temporal scales; however, case clusters occur within a larger scale epidemiological context. Appropriately integrating the interactions between processes that occur across spatial and temporal scales is essential for simulating systems of disease transmission and understanding infection risk. Here we present a simulation engine that places a fine scale network based infection model within the broader epidemiological context of the study population. Using this system, we are able to simulate seeding events and fully explore the control strategy space.

Our simulation engine can integrate a spatially explicit COVID-19 case estimation technique at the county scale with institution level disease transmission at a “building” scale. The case estimation technique takes into account location specific factors around infection control and population level movement to estimate disease burden in a given location. The institution level model uses a multigraph to integrate social and spatial contact networks under various hazard reduction strategies at two different time scales (24 hour and 15 min segements). This allows us to model individual level interactions in the local context of the COVID-19 pandemic, opening a closed system to external forces.

Our model provides realistic estimates of SARS-COV-2 outbreaks and the ability to discover novel control strategies. By integrating models at multiple scales, our simulation engine empowers decision makers to develop location specific preparedness policies based on realistic estimates of how SARS-COV-2 will spread through their institutions.

model diagram

Install git

Here is a link to the official install page Just download the software and run it if you dont want to install via command line.

Git Basics

get the remote on your computer

In your git terminal/gui navigate to the appropriate folder on local. cd my/folder/for/repo

clone the repo from remote with the proper URL into that folder. git clone HTTPS:some/remote/url

Move files or folders into your repo if needed

Your repo folder is now being tracked by git. When you change branches files may disappear or be added based on changes others have made.

You can add files and folders like normal, just know they will be tracked by git. If you are generating files you would like git to ignore, put the path in the .gitignore file.

Add files to the stage

To add files, use the following command: git add some/folder/fileName

Commit files

To locally commit the changes you have staged via add, run the following: git commit -m "informative but brief message"

Push changes to remote

To have you changes show up on the remote: git push

Pull changes on remote to local

git pull

Check your status

git status this lets you know what you have changed on your local branch.

Typical git workflow

Check the branch you are working on

Commiting more frequently is better cheatsheet

Creating Branches

While on main branch

git checkout -b feature/Name

For first push, set it up stream

git push -u origin feature/Name

Ready to merge into main? Make a pull request

Reviewing code

So you got a pull request, now what? Checkout the branch, make sure the code runs as expected. Reference the description to the work item and make sure they align. If the code doesn't run, or the feature doesn't match the work item/description, talk with the person who submitted the pull request. Do not approve a PR that does not run. After you approve the pull request, talk with the author of the code to determine who will merge the code into dev and merge with a stand merge (not fast forward).

Creating a branch of a branch

branch of branch diagram