Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Updated with exercises' description
  • Loading branch information
ahryhorzhevska authored Apr 11, 2022
1 parent c3b5ee1 commit dad4a63
Showing 1 changed file with 49 additions and 1 deletion.
50 changes: 49 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,49 @@
# mpip_cc_smk_tutorial
# 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.


0 comments on commit dad4a63

Please sign in to comment.