From dad4a63f02a8888ff0ea077095c24419d68f393f Mon Sep 17 00:00:00 2001 From: Anastasiia Hryhorzhevska Date: Mon, 11 Apr 2022 17:19:28 +0200 Subject: [PATCH] Update README.md Updated with exercises' description --- README.md | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b03e286..2f0e8ad 100644 --- a/README.md +++ b/README.md @@ -1 +1,49 @@ -# mpip_cc_smk_tutorial \ No newline at end of file +# Code Club: Gentle Introduction to Snakemake + +## Exercises + +### Exercise ex1: + +Write a Snakemake rule __generate_data__ using Python language to generate two vectors of random numbers of size 100 and save each vector to a separate text file: _x.txt_ and _y.txt_. + + **Hint 1.** Import numpy library + + ```{py} + import numpy as np + ``` + + **Hint 2.** Define the names of the output files before the rules + + ```{py} + file_ids = ['x', 'y'] + ``` + + **Hint 3.** Use special Snakemake function to create a list of output filenames from a pattern (for example, in the rule all) + + ```{} + expand("data/{file}.txt", file = file_ids) + ``` + +___ + +### Exercise ex2: + +Write a snakemake rule **subset_data** using shell to create two subsets from the generated files, so that each new file will contain the value less or equal to **0.5**. Save each new generated vector to a separate text file: _x_subset.txt_ and _y_subset.txt_. + + **Hint 1.** Use the ```awk``` shell command to subset the data and ```>``` to redirect the output: + ```{sh} + awk ‘$1 <= 0.5’ {input} > {output} + ``` +____ + +### Exercise ex3: + +Write a snakemake rule using the custom R script (see scripts folder) to plot two vectors generated in the **ex2**. + +____ + +### Exercise ex4: + +Combine all rules into one pipeline, delete all before generated files and run the whole pipeline again specifying the final output. + +