Skip to content

SchlossLab/ori_mikropml_snakemake_workflow

Repository files navigation

Run mikropml with snakemake

build tests License DOI

Snakemake 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 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 and read the mikropml docs.

The Workflow

The 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 as a GitHub-flavored markdown file (see example here).

rulegraph

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:

dag

Usage

Full usage instructions recommended by snakemake are available in the snakemake workflow catalog. 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.

Help & Contributing

If you come across a bug, open an issue and include a minimal reproducible example.

If you have questions, create a new post in Discussions.

If you'd like to contribute, see our guidelines here.

Code of Conduct

Please note that the mikropml-snakemake-workflow is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

More resources

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<

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages