{"id":17175941,"url":"https://github.com/kyleam/mlb-rundiff","last_synced_at":"2025-06-12T19:36:01.254Z","repository":{"id":69238061,"uuid":"105231256","full_name":"kyleam/mlb-rundiff","owner":"kyleam","description":"Analysis of MLB run differentials and jet lag","archived":false,"fork":false,"pushed_at":"2018-03-28T12:07:57.000Z","size":7815,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-12T19:36:01.015Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://kyleam.github.io/mlb-rundiff","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kyleam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-29T04:53:49.000Z","updated_at":"2020-04-13T22:11:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"a5a14160-07e0-4344-bdcd-5b13eb5b43f1","html_url":"https://github.com/kyleam/mlb-rundiff","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kyleam/mlb-rundiff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyleam%2Fmlb-rundiff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyleam%2Fmlb-rundiff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyleam%2Fmlb-rundiff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyleam%2Fmlb-rundiff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kyleam","download_url":"https://codeload.github.com/kyleam/mlb-rundiff/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyleam%2Fmlb-rundiff/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259520270,"owners_count":22870411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T23:58:27.192Z","updated_at":"2025-06-12T19:36:01.231Z","avatar_url":"https://github.com/kyleam.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/kyleam/mlb-rundiff.svg?branch=master)](https://travis-ci.org/kyleam/mlb-rundiff)\n\nThis repository contains\n\n  * Stan code for modeling baseball run differentials\n\n    See the [code/models] subdirectory and the [description][site] of\n    the main model.\n\n  * Python and R code for calculating a team's \"jet lag\" from\n    Retrosheet game logs\n\n    These scripts (try to) use the definition of jet lag from [this\n    study][ssa].  See the [inputs/gamelogs] submodule and [code/lag]\n    subdirectory, as well as [this page][lag-checks].\n\n  * Source files for https://kyleam.github.io/mlb-rundiff\n\n    See the [docs] subdirectory.\n\n\n## Running the analyses\n\n### Input data\n\nThe lag values are calculated using Retrosheet's game logs.  These are\navailable in the [inputs/gamelogs] submodule, which you can download\nwith\n\n```bash\ngit submodule update --init inputs/gamelogs\n```\n\n### Singularity container\n\nAll the dependencies for running these analyses are available in the\n[Singularity] container defined [here][garps].  If you have\nSingularity installed on your system, you can pull the image with the\nfollowing command:\n\n```bash\n$ singularity pull --name snakemake.simg shub://kyleam/garps\n```\n\nThe name \"snakemake.simg\" was chosen because the Singularity\ncontainer's runscript is set to `snakemake`, but you can of course use\nwhatever naming scheme you'd like.\n\n### Building output files with Snakemake\n\nAll output files can be built with [Snakemake], and, as mentioned\nabove, the container runs `snakemake` by default.  To generate an\noutput file, pass it as an argument to the image.\n\nAs an example,\n\n```bash\n$ ./snakemake.simg outputs/lag/log-with-lags-cleaned.csv\n```\n\nwill execute all the necessary steps to generate the lag dataset.\n\nIf you want to execute this in a more isolated environment, you can\ninstead use something like\n\n```bash\n$ singularity run -c -e -B $PWD:/mnt/scratch --pwd /mnt/scratch \\\n  snakemake.simg outputs/lag/log-with-lags-cleaned.csv\n```\n\nIf you run the container without a target, you will see a help message\nthat lists some possible targets of interest.\n\n```bash\n$ ./snakemake.simg\n```\n\n[Singularity]: http://singularity.lbl.gov/\n[Snakemake]: http://snakemake.readthedocs.io/en/stable/\n[code/models]: https://github.com/kyleam/mlb-rundiff/tree/master/code/models\n[docs]: https://github.com/kyleam/mlb-rundiff/tree/master/docs\n[garps]: https://github.com/kyleam/garps/tree/master/Singularity\n[inputs/gamelogs]: https://github.com/kyleam/retrosheet-gamelogs\n[lag-checks]: https://kyleam.github.io/mlb-rundiff/lag-calculation-checks\n[code/lag]: https://github.com/kyleam/mlb-rundiff/tree/master/code/lag\n[site]: https://kyleam.github.io/mlb-rundiff\n[ssa]: http://dx.doi.org/10.1073/pnas.1608847114\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyleam%2Fmlb-rundiff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyleam%2Fmlb-rundiff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyleam%2Fmlb-rundiff/lists"}