Skip to content

Commit

Permalink
Merge pull request #273 from NBISweden/snakemake-lecture
Browse files Browse the repository at this point in the history
Snakemake lecture
  • Loading branch information
fasterius authored Nov 20, 2024
2 parents bcfc8bc + 4052655 commit 10c6f74
Show file tree
Hide file tree
Showing 13 changed files with 1,145 additions and 808 deletions.
4 changes: 4 additions & 0 deletions assets/css/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ $footer-fg: DimGray;

/* code */

pre, code, .sourceCode {
font-size: 0.75rem;
}

pre {
line-height: 1.4;
background-color: $code-block-bg;
Expand Down
38 changes: 24 additions & 14 deletions home_precourse.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -284,38 +284,48 @@ into some problems with certain Conda packages that have not yet been built for
the ARM64 architecture. The [Rosetta](https://support.apple.com/en-us/HT211861)
software allows ARM64 Macs to use software built for the old AMD64 architecture,
which means you can always fall back on creating AMD/Intel-based environments
and use them in conjunction with Rosetta. This is how you do it:
and use them in conjunction with Rosetta. This can be done by specifying
`--subdir osx-64` when creating the environment, _e.g._:

```bash
conda env create -f <path-To-Environment.yml> --subdir osx-64
```

or

```bash
conda create -n myenv <packages...> --subdir osx-64
```

::: {.callout-important}
To make sure that subsequent installations into this environment also use the
`osx-64` architecture, activate the environment and then run:

```bash
CONDA_SUBDIR=osx-64 <conda-command>
conda activate <env>
conda config --env --set subdir osx-64
```
:::

The first command creates the Intel-based environment, while the last one
makes sure that subsequent commands are also using the Intel architecture. If
you don't want to remember and do this manually each time you want to use
AMD64/Rosetta you can check out [this bash script](https://github.com/fasterius/dotfiles/blob/main/scripts/intel-conda-env.sh).

## Installing Snakemake

We will use Conda environments for the set up of this tutorial, but don't worry
if you don't understand exactly what everything does - you'll learn all the
details at the course. First make sure you're currently situated inside the
tutorials directory (`workshop-reproducible-research/tutorials`) and then create
the Conda environment like so:
and activate the Conda environment with the commands below:

::: {.callout-caution title="ARM64 users"}
Some of the packages in this environment are not available for the ARM64
architecture, so you'll have to add `--subdir osx-64` to the `conda env create`
command. See the [instructions above](#conda-on-new-macs) for more details.
:::

```bash
conda env create -f snakemake/environment.yml -n snakemake-env
conda activate snakemake-env
```

::: {.callout-caution title="ARM64 users"}
Some of the packages in this environment is not available for the ARM64
architecture, so you'll have to follow the [instructions
above](#conda-on-new-macs).
:::

Check that Snakemake is installed correctly, for example by executing `snakemake
--help`. This should output a list of available Snakemake settings. If you get
`bash: snakemake: command not found` then you need to go back and ensure that
Expand Down
Binary file modified lectures/introduction/images/john-sundh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 10c6f74

Please sign in to comment.