https://github.com/schlosslab/ori_mikropml_snakemake_workflow
https://github.com/schlosslab/ori_mikropml_snakemake_workflow
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/schlosslab/ori_mikropml_snakemake_workflow
- Owner: SchlossLab
- License: mit
- Created: 2023-08-10T15:36:47.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-10T15:37:26.000Z (almost 3 years ago)
- Last Synced: 2025-10-30T04:58:39.911Z (8 months ago)
- Language: HTML
- Size: 32 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Run mikropml with snakemake 
[](https://github.com/SchlossLab/mikropml-snakemake-workflow/actions/workflows/build.yml) [](https://github.com/SchlossLab/mikropml-snakemake-workflow/actions/workflows/tests.yml) [](/LICENSE.md) [](https://zenodo.org/badge/latestdoi/292886119)
[Snakemake](https://snakemake.readthedocs.io/en/stable) is a workflow manager that enables massively parallel and reproducible analyses. Snakemake is a suitable tool to use when you can break a workflow down into discrete steps, with each step having input and output files.
[mikropml](http://www.schlosslab.org/mikropml/) is an R package for supervised machine learning pipelines. We provide this example workflow as a template to get started running mikropml with snakemake. We hope you then customize the code to meet the needs of your particular ML task.
For more details on these tools, see the [Snakemake tutorial](https://snakemake.readthedocs.io/en/stable/tutorial/tutorial.html) and read the [mikropml docs](http://www.schlosslab.org/mikropml/).
## The Workflow
The [`Snakefile`](workflow/Snakefile) contains rules which define the output files we want and how to make them. Snakemake automatically builds a directed acyclic graph (DAG) of jobs to figure out the dependencies of each of the rules and what order to run them in. This workflow preprocesses the example dataset, calls `mikropml::run_ml()` for each seed and ML method set in the config file, combines the results files, plots performance results (cross-validation and test AUROCs, hyperparameter AUROCs from cross-validation, and benchmark performance), and renders a simple [R Markdown report](report.Rmd) as a GitHub-flavored markdown file ([see example here](report-example.md)).

The DAG shows how calls to `run_ml` can run in parallel if snakemake is allowed to run more than one job at a time. If we use 100 seeds and 4 ML methods, snakemake would call `run_ml` 400 times. Here's a small example DAG if we were to use only 2 seeds and 1 ML method:

## Usage
Full usage instructions recommended by snakemake are available in the [snakemake workflow catalog](https://snakemake.github.io/snakemake-workflow-catalog/?usage=SchlossLab/mikropml-snakemake-workflow). Snakemake recommends using `snakedeploy` to use this workflow as a module in your own project.
Alternatively, you can download this repo and modify the code directly to suit your needs. See instructions [here](/quick-start.md).
## Help & Contributing
If you come across a bug, [open an issue](https://github.com/SchlossLab/mikropml-snakemake-workflow/issues) and include a minimal reproducible example.
If you have questions, create a new post in [Discussions](https://github.com/SchlossLab/mikropml-snakemake-workflow/discussions).
If you'd like to contribute, see our guidelines [here](.github/CONTRIBUTING.md).
## Code of Conduct
Please note that the mikropml-snakemake-workflow is released with a [Contributor Code of Conduct](.github/CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms.
## More resources
- [mikropml docs](http://www.schlosslab.org/mikropml/)
- [Snakemake tutorial](https://snakemake.readthedocs.io/en/stable/tutorial/tutorial.html)
- [conda user guide](https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html)
## Adena Collens Project Notes
#### August 10, 2023
- Currently, this repository contains output results from runs of the mikropml pipeline with a variety of configurations, a majority of which are run on the same set of features: individual grams (columns) and their occurances across 400 sampled ASM manuscripts (rows)
- obsolete folder contains the final reports of previous runs which either had sub-optimal hyperparameters or were runs with a mini dataset, or were run with fewer than 100 iterations.
- The most recent runs are 100 iterations of l2 linear regression (alpha = 0) with glmnet with a range of lambda values \<10\<