GithubHelp home page GithubHelp logo

snakemake-pixi-template's Introduction

snakemake-pixi-template

This is a template repository for snakemake workflow with pixi as a package manager. It is based on the pixi.

Idea

Traditionally, I would use Conda to create my environments and manage my packages. However the added step of making sure my environment.yml file is up to date is a bit of a hassle.

conda env create -f environment.yml -n snakemake
conda activate snakemake

Instead, I can use pixi to manage my packages and create a pixi.lock file that will be used to create the environment.

pixi install

This makes sure that the lock is synchronized and version controlled.

Usage

To add packages to the default environment:

pixi add pandas

To run a command in the environment

pixi run snakemake --dryrun

Enter into the environment

pixi shell

# Exit the environment using "exit"

Pixi Tasks

Pixi also allows defining tasks for common tasks. This is done in the pyproject.toml file.

[tool.pixi.tasks]
dryrun = "snakemake --dry-run"
snake = "snakemake --cores 1"

This allows me to run pixi run dryrun to see what snakemake would do and pixi run snake to run snakemake.

A common task I like to do is creating the dags regularly and including them in my README. This can then be automated with the task.

dag = "snakemake -F --dag | dot -Tsvg > resources/dag.svg"
rulegraph = "snakemake -F --rulegraph | dot -Tsvg > resources/rulegraph.svg"
filegraph = "snakemake -F --filegraph | dot -Tsvg > resources/filegraph.svg"
graphs = { depends_on = ["dag", "rulegraph", "filegraph"] }

Running pixi run graphs will create the three graphs and save them in the resources folder. This way, they are automatically updated below in this README.

DAG

DAG

Rulegraph

Rulegraph

Filegraph

Filegraph

snakemake-pixi-template's People

Contributors

jjjermiah avatar

Stargazers

Ivan Ruiz Manuel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.