Skip to content

hreypar/felicidades

Repository files navigation

Snakemake workflow: felicidades

Snakemake GitHub actions status

A Snakemake workflow that plots a birthday cake for your friends in their special day.

Overview

This workflow takes as input a friends csv table with their names and dates of birth. The workflow "bakes" (plots) a cake using R if today() is the person's birthday (or if the dob is within +/- 3 days of today(). Otherwise, it plots an ice cream for the person as a consolation prize.

Usage

The usage of this workflow is described in the Snakemake Workflow Catalog.

If you use this workflow in a paper, don't forget to give credits to the authors by citing the URL of this (original) sitory and its DOI (see above).

Prerequisites

  • Conda (Miniconda or Anaconda). Conda is a package manager that can manage dependencies and environments for your workflow. If you don't have Conda installed, you can install Miniconda (a minimal Conda installer) or Anaconda (a full Conda installer with additional data science packages). My personal preference is Miniconda.

  • Mamba (Optional, but recommended for faster environment management). Mamba is a drop-in replacement for the Conda package manager that offers significantly faster environment resolution and dependency handling. It can be used interchangeably with Conda commands. To install Mamba, first ensure you have Conda installed (either Miniconda or Anaconda). Then, create a Conda environment and install Mamba using the following commands:

conda install -n base -c conda-forge mamba
  • Snakemake: a workflow management system that allows you to create reproducible and scalable data analyses. Install Snakemake using Conda to ensure compatibility with your workflow. You can create an environment and install Snakemake with the following commands:
conda activate base
mamba create -c conda-forge -c bioconda -n snakemake snakemake

Instructions to use this Workflow

# clone this repository 
git clone [email protected]:hreypar/felicidades.git

# change directory into the repo
cd felicidades

# activate snakemake environment
conda activate snakemake

# run workflow on default data 
snakemake --use-conda --cores 2 

# check results
tree results 

# alternatively check results with ls
ls results/celebracion

Input

The input data for this project consists of a csv table of "cumpleaneros" (see example here), which includes information about individuals celebrating their birthdays. The table contains the following columns:

  • Name: The name of the person celebrating the birthday.
  • Birthday: The date of the birthday celebration.
  • Favorite Cake Flavor (Color): The favorite cake flavor represented by colors.
  • Favorite Cake Frosting (Color): The favorite cake frosting represented by colors.

Output

The output of the project consists of a birthday greeting for each person listed in the input table. The workflow generates a PDF file containing a warm congratulatory message customized for the individual and a Birthday Cake if applicable (if it is in fact the person's birthday, a plot visualization representing their favorite cake flavor (color) is included).

The actual output files are organized into the following structure within the results/celebracion/ directory:

  • felicitaciones_para_Name.pdf: Individualized PDF file, where Name is replaced with the name of the individual (e.g., felicitaciones_para_Bill.pdf).
  • pastel_Name.log: Log file documenting the process of creating the birthday cake visualization, where Name is replaced with the name of the individual (e.g., pastel_Bill.log).

Use your own data

If you want to congratulate your own friends with virtual cakes, you only need to add (or edit) a csv table similar to config/cumpleaneros_octubre.csv with your own people's birthdays and update the config/config.yaml file accordingly.

Project structure

.
├── benchmarks                           # Directory for benchmark data (automatically generated)
│   └── celebracion
│       └── pastel_Bill.tsv              # Sample benchmark data for celebration
│
├── config                               # Configuration files
│   ├── config.yaml                      # Configuration for the workflow
│   ├── cumpleaneros_octubre.csv          # Input data: October birthdays
│   └── README.md                        # Information about the configuration files
│
├── LICENSE                              # License file for the project
├── README.md                            # Main project README file
│
├── results                              # Directory for generated results (automatically generated)
│   └── celebracion
│       ├── felicitaciones_para_Bill.pdf  # Example birthday greeting PDF
│       └── pastel_Bill.log              # Log file for the creation of Bill's pastel
│
└── workflow                             # Workflow-related files
    ├── envs                             # Conda environment files
    │   └── graficar_pastel.yaml         # Environment file for the project
    ├── rules                            # Snakemake rule files
    │   ├── common.smk                   # Rule for common tasks
    │   └── felicitar_con_pastel.smk     # Rule for creating greetings with cakes
    ├── scripts                          # Scripts used in the workflow
    │   └── pastel.R                     # R script for generating cake visualizations
    └── Snakefile                        # Main Snakemake workflow file

Additional Information

What I actually do is Bioinformatics and Computational Biology 👩🏽‍💻, particularly analysis of sequencing data (both bulk and single-cell). As you might've inferred, I think programming is fun! and my good friend Israel Aguilar (also a bioinformatician) has a birthday coming up 🎂. Now, reproducible code is one of his favorite things in the world, and he's a pro at creating workflows with Nextflow but I'm more on the Snakemake side so I thought I'd gift him an excuse to start learning it 🐍.

Authors

Helena Reyes-Gopar

Acknowledgements

This workflow was heavily inspired by this script from Qiuyu's Blog.

About

Repositorio para darle un pastel de cumpleaños a tus amix

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published