Skip to content

Commit

Permalink
Merge pull request #201 from NBISweden/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
johnne authored Nov 25, 2022
2 parents ed19bf9 + bdd3e0f commit 3efd71c
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 28 deletions.
Binary file modified lectures/conda/conda.pdf
Binary file not shown.
9 changes: 9 additions & 0 deletions lectures/containers/containers.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,15 @@ an open source container platform suitable for HPC clusters

>Singularity was created to run complex applications on HPC clusters in a simple, portable, and reproducible way.
---
# What is Apptainer?

<img src="http://apptainer.org/static/hero-img-e614806cf573fd0cbbe09a25d9e69637.png" style="width:100%;"/>

In 2021 Singularity joined the Linux Foundation and became Apptainer.

The company Sylabs still maintains **Singularity**

---

# Docker vs. Singularity
Expand Down
Binary file modified lectures/containers/containers.pdf
Binary file not shown.
Binary file modified lectures/rmarkdown/rmarkdown.pdf
Binary file not shown.
51 changes: 25 additions & 26 deletions lectures/snakemake/snakemake.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ done

Using snakemake rules:


```python
rule trim_fastq:
output: temp("{prefix}.trimmed.fastq")
Expand All @@ -140,19 +139,19 @@ rule gzip:
# Example: sequence trimming

Using snakemake rules:

.small[
``` bash
$ snakemake {a,b}.trimmed.fastq.gz
$ snakemake -c 1 {a,b}.trimmed.fastq.gz
```

]
---

# Example: sequence trimming

Using snakemake rules:

.small[
``` bash
$ snakemake {a,b}.trimmed.fastq.gz
$ snakemake -c 1 {a,b}.trimmed.fastq.gz
Provided cores: 1
Rules claiming more threads will be scaled down.
Job counts:
Expand All @@ -174,19 +173,17 @@ rule gzip:
Removing temporary output file a.trimmed.fastq.
2 of 4 steps (50%) done
```

]
---

# Example: sequence trimming

Using snakemake rules:

.small[
``` bash
$ snakemake {a,b}.trimmed.fastq.gz
$ snakemake -c 1 {a,b}.trimmed.fastq.gz
```

...

``` bash
rule trim_fastq:
input: b.fastq
Expand All @@ -201,7 +198,7 @@ rule gzip:
Removing temporary output file b.trimmed.fastq.
4 of 4 steps (100%) done
```

]
---

# Piecing the rules together
Expand Down Expand Up @@ -231,28 +228,29 @@ than downstream files, so it reruns the necessary rules.

.pull-right[
<img src="dag1.png", width=100%>

`$ touch intermediate/NCTC8325.1.bt2`

`$ snakemake supplementary.pdf`

.small[
```bash
$ touch intermediate/NCTC8325.1.bt2
$ snakemake supplementary.pdf
```
]
]

---

# Anatomy of a Snakemake rule

.small[
``` python
rule trim_fastq:
output: temp("{prefix}.trimmed.fastq")
input: "{prefix}.fastq"
log: "logs/{prefix}.trim_fastq.log"
```

]
---

# Anatomy of a Snakemake rule

.small[
``` python
rule trim_fastq:
output: temp("{prefix}.trimmed.fastq")
Expand All @@ -265,11 +263,11 @@ rule trim_fastq:
2> {log}
"""
```

]
---

# Anatomy of a Snakemake rule

.small[
``` python
rule trim_fastq:
output: temp("{prefix}.trimmed.fastq")
Expand All @@ -288,11 +286,11 @@ rule trim_fastq:
2> {log}
"""
```

]
---

# Anatomy of a Snakemake rule

.small[
``` python
rule trim_fastq:
output: temp("{prefix}.trimmed.fastq")
Expand All @@ -315,11 +313,12 @@ rule trim_fastq:
2> {log}
"""
```

]
---

# Anatomy of a Snakemake rule

.small[
``` python
rule trim_fastq:
output: temp("{prefix}.trimmed.fastq")
Expand All @@ -346,7 +345,7 @@ rule trim_fastq:
2> {log}
"""
```

]
---

# Snakemake commandline
Expand Down
Binary file modified lectures/snakemake/snakemake.pdf
Binary file not shown.
9 changes: 8 additions & 1 deletion pages/containers/containers-7-singularity.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ images to the Singularity Image Format (SIF). This is great if there's a Docker
image that you want to use on an HPC cluster such as Uppmax where you cannot use
Docker.

> **Tip!** <br>
> If you are running singularity through Vagrant VirtualBox you may have to
> set the temporary directory that Singularity uses during pull/build commands
> to something with more disk space. First run `mkdir ~/tmp` to create a tmp
> directory inside the home folder of the VirtualBox, then
> `export SINGULARITY_TMPDIR="~/tmp"`.
Let's try to convert the Docker image for this course directly from DockerHub
using `singularity pull`:

Expand Down Expand Up @@ -67,7 +74,7 @@ Since Singularity bind mounts the current working directory we can simply
execute the workflow and generate the output files using:

```bash
singularity run --vm-ram 2048 mrsa_proj.sif
singularity run mrsa_proj.sif
```

This executes the default run command, which is
Expand Down
8 changes: 7 additions & 1 deletion pages/course-information/pre-course-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,14 @@ resources:
- [Installing and using Linux Bash on Windows](https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/)
- [Installing Linux Bash on Windows](https://itsfoss.com/install-bash-on-windows/)

> **Note** <br>
> If you run into error messages when trying to download files through the Linux
> shell (_e.g._ `curl:(6) Could not resolve host`) then try adding the Google
> nameserver to the internet configuration by running `sudo nano /etc/resolv.conf`
> then add `nameserver 8.8.8.8` to the bottom of the file and save it.
Open a bash shell Linux terminal and clone the GitHub repository containing all
files you will need for completing the tutorials as follows. First, `cd` into
files you will need for completing the tutorials as follows. First, `cd` into
a directory on your computer (or create one) where it makes sense to download
the course directory.

Expand Down

0 comments on commit 3efd71c

Please sign in to comment.