Skip to content

Commit 0901996

Browse files
committed
NF4Science course template
- Stub including index, orientation and method overview (part 1)
1 parent c3f0d85 commit 0901996

File tree

3 files changed

+258
-0
lines changed

3 files changed

+258
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Orientation
2+
3+
The training environment contains all the software, code and data necessary to work through this training course, so you don't need to install anything yourself.
4+
However, you do need a (free) account to log in, and you should take a few minutes to familiarize yourself with the interface.
5+
6+
If you have not yet done so, please the [Environment Setup](../../envsetup/) mini-course before going any further.
7+
8+
## Materials provided
9+
10+
Throughout this training course, we'll be working in the `nf4-science/[course-name]/` directory, which you need to move into when you open the training workspace.
11+
This directory contains all the code files, test data and accessory files you will need.
12+
13+
Feel free to explore the contents of this directory; the easiest way to do so is to use the file explorer on the left-hand side of the training workspace in the VSCode interface.
14+
Alternatively, you can use the `tree` command.
15+
Throughout the course, we use the output of `tree` to represent directory structure and contents in a readable form, sometimes with minor modifications for clarity.
16+
17+
Here we generate a table of contents to the second level down:
18+
19+
```bash
20+
tree . -L 3
21+
```
22+
23+
If you run this inside `nf4-science/[course-name]`, you should see the following output:
24+
25+
```console title="Directory contents"
26+
.
27+
├── data
28+
│ ├── ...
29+
│ └── ...
30+
├── nextflow.config
31+
├── [course-name].nf
32+
└── solutions
33+
├── modules
34+
│ ├── ....nf
35+
│ └── ....nf
36+
├── [course-name]-x.y.nf
37+
└── [course-name]-x.y.nf
38+
39+
```
40+
41+
!!!note
42+
43+
Don't worry if this seems like a lot; we'll go through the relevant pieces at each step of the course.
44+
This is just meant to give you an overview.
45+
46+
**Here's a summary of what you should know to get started:**
47+
48+
- **The `[course-name].nf` file** is the outline if the workflow script we will work to develop.
49+
50+
- **The file `nextflow.config`** is a configuration file that sets minimal environment properties. You can ignore it for now.
51+
52+
- **The `data` directory** contains input data and related resources:
53+
54+
- _thing_ called `filename` [details].
55+
56+
- **The `solutions` directory** contains the completed workflow scripts and modules that result from each step of the course.
57+
They are intended to be used as a reference to check your work and troubleshoot any issues.
58+
The number in the filename corresponds to the step of the relevant part of the course.
59+
60+
!!!tip
61+
62+
If for whatever reason you move out of this directory, you can always run this command to return to it:
63+
64+
```bash
65+
cd /workspaces/training/nf4-science/[course-name]
66+
```
67+
68+
Now, to begin the course, click on the arrow in the bottom right corner of this page.
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# Part 1: Method overview and manual testing
2+
3+
[High level summary of what the analysis aims to achieve.]
4+
5+
There are multiple valid methods for performing this type of analysis.
6+
For this course, we are following the method described [here](url) by [authors] at [affiliation](url).
7+
8+
Our goal is therefore to develop a workflow that implements the following processing steps: [brief enumeration].
9+
10+
<figure class="excalidraw">
11+
--8<-- "docs/nf4_science/[course-name]/img/[filename]"
12+
</figure>
13+
14+
- **[TOOL]:** [Summary of analysis step]
15+
16+
However, before we dive into writing any workflow code, we are going to try out the commands manually on some test data.
17+
The tools we need are not installed in the GitHub Codespaces environment, so we'll use them via containers.
18+
19+
For more detailed explanations about where to find containers and how they work, see the [Hello Containers](../../hello_nextflow/05_hello_containers.md) chapter in the beginners' course.
20+
21+
[TODO: consider making a note about Seqera containers]
22+
23+
!!! note
24+
25+
Make sure you're in the `nf4-science/[course-name]` directory.
26+
The last part of the path shown when you type `pwd` should be `[course-name]`.
27+
28+
---
29+
30+
## 1. [Name of analysis step]
31+
32+
We're going to pull a container image that has [relevant tools] installed, spin it up interactively and run the [analysis] commands on one of the example data files.
33+
34+
### 1.1. Pull the `[tool]` container
35+
36+
First, we use `docker pull` to download the container image.
37+
38+
```bash
39+
docker pull community.wave.seqera.io/library/[container]
40+
```
41+
42+
This gives you the following console output as the system downloads the image:
43+
44+
```console title="Output"
45+
[console output]
46+
```
47+
48+
The image has been downloaded to your computer, but it's not active yet.
49+
We need to actually spin it up (=make it run interactively).
50+
51+
### 1.2. Spin up the container
52+
53+
Let's spin up the container using `docker run -it` to run it interactively.
54+
55+
```bash
56+
docker run -it -v ./data:/data community.wave.seqera.io/library/[container]
57+
```
58+
59+
Your prompt will change to something like `(base) root@b645838b3314:/tmp#`, which indicates that you are now _inside_ the container.
60+
61+
The `-v ./data:/data` part of the command will enable us to access the contents of the `data/` directory from inside the container.
62+
63+
```bash
64+
ls /data/[thing]
65+
```
66+
67+
```console title="Output"
68+
[console output]
69+
```
70+
71+
You are now ready to try running [analysis or tool].
72+
73+
### 1.3. Run the [analysis] command
74+
75+
Now, we can run `[tool]` to [do analysis].
76+
77+
[optional explanations about command options]
78+
79+
```bash
80+
[command]
81+
```
82+
83+
This should run very quickly:
84+
85+
```console title="Output"
86+
[console output]
87+
```
88+
89+
[adapt depending on tool behavior] You can find the output files in the same directory as the original data:
90+
91+
```bash
92+
ls /data/[path]
93+
```
94+
95+
```console title="Output"
96+
console output
97+
```
98+
99+
[some explanation of the output; provide contents preview if applicable]
100+
101+
### 1.4. Save the output files
102+
103+
[adapt depending on tool behavior; delete if not necessary]
104+
105+
Output files that were created _inside_ the container will be inaccessible to future work, so let's move these to a new directory.
106+
107+
```bash
108+
mkdir /data/[path]
109+
mv [things]* /data/[path]
110+
```
111+
112+
Now you will be able to use those files as inputs for subsequent analysis steps.
113+
114+
### 1.5. Exit the container
115+
116+
```bash
117+
exit
118+
```
119+
120+
[Concluding statement]
121+
122+
[For the first step: Now we're going to repeat this process for the other steps we plan to implement in our pipeline.]
123+
124+
---
125+
126+
## 2. [Name of second analysis step]
127+
128+
[repeat as needed]
129+
130+
[At final step: call out the final outputs]
131+
132+
---
133+
134+
### Takeaway
135+
136+
You have reviewed the analysis method and tested all the individual commands interactively in the relevant containers.
137+
138+
### What's next?
139+
140+
Learn how to wrap those same commands into a multi-step workflow that uses containers to execute the work.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: Nextflow for [course-name]
3+
hide:
4+
- toc
5+
---
6+
7+
# Nextflow for [course-name]
8+
9+
This training course is intended for researchers in [main field] and related fields who are interested in developing or customizing data analysis pipelines.
10+
It builds on the [Hello Nextflow](../../hello_nextflow/) beginner training and demonstrates how to use Nextflow in the specific context of [course-name] analysis.
11+
12+
Specifically, this course demonstrates how to implement a simple [course name or analysis] pipeline to [high-level summary].
13+
14+
Let's get started! Click on the "Open in GitHub Codespaces" button below to launch the training environment (preferably in a separate tab), then read on while it loads.
15+
16+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/nextflow-io/training?quickstart=1&ref=master)
17+
18+
## Learning objectives
19+
20+
By working through this course, you will learn how to apply foundational Nextflow concepts and tooling to a typical [course-name] use case.
21+
22+
By the end of this workshop you will be able to:
23+
24+
- Write a linear workflow to apply basic [course-name or applicable terms] methods
25+
- Handle domain-specific files such as [examples] appropriately
26+
- Handle [type of data] data
27+
- Leverage Nextflow's dataflow paradigm to parallelize [analysis]
28+
- [add as applicable] using relevant channel operators [and other features as applicable]
29+
30+
<!-- TODO
31+
[optional advanced add-ons]
32+
- Configure pipeline execution and manage resource allocations
33+
- Handle metadata propagation
34+
- Implement per-step and end-to-end pipeline tests that handle analysis-specific idiosyncrasies appropriately
35+
-->
36+
37+
## Prerequisites
38+
39+
The course assumes some minimal familiarity with the following:
40+
41+
- Tools and file formats commonly used in this scientific domain
42+
- Experience with the command line
43+
- Foundational Nextflow concepts and tooling covered in the [Hello Nextflow](../../hello_nextflow/) beginner training.
44+
45+
For technical requirements and environment setup, see the [Environment Setup](../../envsetup/) mini-course.
46+
47+
<!-- TODO
48+
For courses with the advanced add-ons, document the relevant prerequisites, eg:
49+
- Part X assumes familiarity with [Side Quest](url) or [Collection](url)
50+
-->

0 commit comments

Comments
 (0)