Skip to content

Commit

Permalink
Merge pull request #71 from NBISweden/dev-percyfal
Browse files Browse the repository at this point in the history
Dev percyfal
  • Loading branch information
percyfal authored Nov 1, 2023
2 parents 3ad04bf + 135074d commit 79871e9
Show file tree
Hide file tree
Showing 38 changed files with 3,036 additions and 374 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ repos:
docs/slides/datageneration/index\.qmd|
docs/slides/foundations/index\.qmd|
docs/slides/variant_filtering/index\.qmd|
docs/slides/variant_calling/index\.qmd|
docs/exercises/variant_filtering/index\.qmd|
docs/slides/simulation/index\.qmd
)$
Expand Down
44 changes: 22 additions & 22 deletions conda-linux-64.lock

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions docs/_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ __yellow_recal_bam__:

__reference__:
- M_aurantiacus_v1.fasta: monkeyflower/tiny/M_aurantiacus_v1_splitline_ordered.fasta
- M_aurantiacus_v1.fasta.fai: monkeyflower/tiny/M_aurantiacus_v1_splitline_ordered.fasta.fai

__sampleinfo__:
- monkeyflower/sampleinfo.csv
Expand Down Expand Up @@ -137,3 +138,22 @@ exercises/genetic_diversity:

slides/foundations:
- data/Homo_sapiens: Homo_sapiens

slides/variant_calling:
- monkeyflower/tiny/PUN-R-ELF/PUN-R-ELF_R1.fastq.gz
- monkeyflower/tiny/PUN-R-ELF/PUN-R-ELF_R2.fastq.gz
- monkeyflower/tiny/PUN-R-ELF/PUN-R-ELF.sort.dup.bam
- monkeyflower/tiny/PUN-R-ELF/PUN-R-ELF.sort.dup.bai
- monkeyflower/tiny/PUN-R-ELF/PUN-R-ELF.sort.dup.recal.bam
- monkeyflower/tiny/PUN-R-ELF/PUN-R-ELF.sort.dup.recal.bai
- monkeyflower/tiny/PUN-Y-INJ/PUN-Y-INJ_R1.fastq.gz
- monkeyflower/tiny/PUN-Y-INJ/PUN-Y-INJ_R2.fastq.gz
- monkeyflower/tiny/PUN-Y-INJ/PUN-Y-INJ.sort.dup.recal.bam
- monkeyflower/tiny/PUN-Y-INJ/PUN-Y-INJ.sort.dup.recal.bai
- monkeyflower/tiny/PUN-Y-INJ/PUN-Y-INJ.sort.dup.bam
- monkeyflower/tiny/PUN-Y-INJ/PUN-Y-INJ.sort.dup.bai
- monkeyflower/small/redyellow.variantsites.vcf.gz
- monkeyflower/small/redyellow.variantsites.vcf.gz.tbi
- allsites.vcf.gz: monkeyflower/tiny/redyellow.allsites.vcf.gz
- allsites.vcf.gz.tbi: monkeyflower/tiny/redyellow.allsites.vcf.gz.tbi
- __reference__
25 changes: 19 additions & 6 deletions docs/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,27 @@ project:
- "syllabus.qmd"
# Exercises
# - "exercises/data.qmd"
- "exercises/index.qmd"
- "exercises/compute_environment/index.qmd"
- "exercises/datasets/monkeyflowers.qmd"
- "exercises/index.qmd"
- "exercises/simulation/index.qmd"
- "exercises/variant_calling/index.qmd"
- "exercises/variant_filtering/index.qmd"
- "exercises/genetic_diversity/index.qmd"
- "exercises/population_structure/index.qmd"
- "exercises/demography/index.qmd"
- "exercises/selection/index.qmd"
# Slides
- "slides/index.qmd"
- "slides/pgip/index.qmd"
- "slides/foundations/index.qmd"
- "slides/simulation/index.qmd"
# - "slides/variant_calling/index.qmd"
# - "slides/datageneration/index.qmd"
- "slides/variant_calling/index.qmd"
- "slides/variant_filtering/index.qmd"
- "slides/genetic_diversity/index.qmd"
- "slides/population_structure/index.qmd"
- "slides/demography/index.qmd"
- "slides/selection/index.qmd"
# Recipes
- "recipes/index.qmd"
- "recipes/slim/index.qmd"
Expand Down Expand Up @@ -62,6 +69,7 @@ format:
quarto-required: ">=1.2.475"
toc: true
include-after-body: assets/www/logo-hyperlink.html
include-before: [ '<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: {enableAssistiveMml: false}});</script>']
toc-depth: 1
slide-level: 2
slide-number: true
Expand All @@ -73,9 +81,14 @@ format:
fig-align: left
fig-height: 12
fig-width: 10
# All three combinations have same aspect ratio
width: 1280
height: 720
margin: 0.1
# width: 1920
# height: 1080
# width: 1600
# height: 900
margin: 0.08
date: last-modified
date-format: "DD-MMM-YYYY"
navigation-mode: vertical
Expand All @@ -97,13 +110,13 @@ revealjs-plugins:
- pointer

execute:
cache: true
cache: false
echo: true
warning: false
include: true
autodep: true
eval: true
error: true
error: false

knitr:
opts_chunk:
Expand Down
130 changes: 122 additions & 8 deletions docs/assets/bibliography.bib

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/assets/css/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ code.large {

.flushright {
float: right;
font-size: 70%;
}

.translatey50 {
Expand Down
69 changes: 43 additions & 26 deletions docs/exercises/compute_environment/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ format: html

<!-- markdownlint-enable MD041 -->

## UPPMAX
## {{< fa server >}} UPPMAX

::: {.callout-important collapse=true}

Expand Down Expand Up @@ -74,23 +74,29 @@ UPPMAX hosts tutorials and user guides at
<https://www.uppmax.uu.se/support/user-guides/guide--first-login-to-uppmax/>
has information on how to connect to and work on UPPMAX.

## JupyterLite
## {{< fa laptop >}} Jupyter Notebooks

Some exercises will be run using
[JupyterLite](https://github.com/jupyterlite/jupyterlite) which is a
JupyterLab distribution that runs entirely in the browser. Apart from
having a browser, no preparations are necessary. Note that some users
have reported issues with Firefox and that Google Chrome may be a
better solution.
[Jupyter Notebook](https://jupyter.org/) exercises will be run in
local compute environments on your laptop. See the section below on
setting up a `pgip` conda environment, which by default installs `jupyter` and its dependencies.

## Fallback solution: conda
### {{< fa brands firefox >}} JupyterLite

In case there are issues with the HPC, a fallback option is to install
software packages locally on your computer. We will use the
[conda](https://docs.conda.io/en/latest/) package manager to install
necessary requirements from the package repositories
There are some Jupyter Notebook exercises that are hosted online and
run using [JupyterLite](https://github.com/jupyterlite/jupyterlite)
which is a JupyterLab distribution that runs entirely in the browser.
Apart from having a browser, no preparations are necessary. Note that
some users have reported issues with Firefox and that Google Chrome
may be a better solution.

## {{< fa laptop >}} Conda {#sec-compute-environment-conda}

Exercises that require local software installation will make use of
the [conda](https://docs.conda.io/en/latest/) package manager to
install necessary requirements from the package repositories
[bioconda](https://bioconda.github.io/) and
[conda-forge](https://conda-forge.org/).
[conda-forge](https://conda-forge.org/). This is also the fallback
solution in case there are issues with the HPC.

### 1. Install conda

Expand Down Expand Up @@ -124,28 +130,38 @@ Please note that the order of these commands is important!
### 3. Create an isolated course environment

It is suggested you create and change to a isolated environment `pgip`
dedicated to the course. We also suggest you use
[mamba](https://mamba.readthedocs.io/en/latest/index.html) package
manager to install programs as this is much quicker.
dedicated to the course. The command below will create an environment
named `pgip` and install the packages `python` version 3.10, an R base
installation (`r-base`), the `jupyter` package that provides support
for Jupyter Notebooks, and the `mamba` package manager.

```{bash }
#| label: create-conda-pgip
#| echo: true
#| eval: false
mamba create -n pgip python=3.10 r-base
mamba activate pgip
conda create --name pgip python=3.10 r-base jupyter mamba
conda activate pgip
```

To deactivate an environment you issue the command `mamba deactivate`.
The `activate` command is required to access the isolated environment
named `pgip`. Once you have activated the environment, you gain access
to whatever programs are installed. To deactivate an environment you
issue the command `conda deactivate`.

### 4. Install packages

You can install packages as follows (remember to activate `pgip`!):
Installation of packages in an environment is done with the `install`
command, but we recommend you use the
[mamba](https://mamba.readthedocs.io/en/latest/index.html) package
manager as it is faster (`mamba` is a rewrite of `conda` in C++). An
example of how to install packages `bcftools, angsd, mosdepth` follows
(remember to activate `pgip`!):

```{bash }
#| label: conda-install-packages
#| echo: true
#| eval: false
conda activate pgip
mamba install bcftools angsd mosdepth
```

Expand Down Expand Up @@ -191,13 +207,10 @@ Example:
#| label: uppmax-load-modules
#| echo: true
#| eval: false
module load uppmax bioinfo-tools bwa/0.7.17 FastQC/0.11.9
module load uppmax bioinfo-tools bwa/0.7.17 \
FastQC/0.11.9
```

:::

:::

#### Conda

Provides a [conda environment
Expand All @@ -218,4 +231,8 @@ dependencies:
- fastqc=0.12.1
```

:::

:::

## References
77 changes: 77 additions & 0 deletions docs/exercises/demography/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
title: "Demographic inference"
author:
- "André Soares"
- "Per Unneberg"
format: html
---

::: {.callout-important collapse=true}

#### {{< fa server >}} Compute environment setup

If you haven't already done so, please read [Compute
environment](../compute_environment/index.qmd) for information on how
to prepare your working directory.

:::

::: {.callout-tip collapse=true}

## Learning objectives

:::

::: {.callout-note collapse=true}

## Data setup

:::{.panel-tabset}

#### UPPMAX

#### Local

:::

:::

::: {.callout-note collapse=true}

## Tools

:::{.panel-tabset}

#### Listing

- [psmc](https://github.com/lh3/psmc) [@li_InferenceHumanPopulation_2011]

#### UPPMAX modules

Execute the following command to load modules:

```{bash }
#| label: uppmax-load-modules
#| echo: true
#| eval: false
module load uppmax bioinfo-tools \
psmc/0.6.5-r67-e5f7df5
```

#### Conda

Copy the contents to a file `environment.yml` and install packages
with `mamba env update -f environment.yml`.

```{lang="text" }
channels:
- conda-forge
- bioconda
- default
dependencies:
- psmc
```

:::

:::
Loading

0 comments on commit 79871e9

Please sign in to comment.