Skip to content

Commit

Permalink
Added RunningRealWorflow and SeqeraPlatform markdowns
Browse files Browse the repository at this point in the history
  • Loading branch information
apca committed Nov 11, 2024
1 parent 8c37655 commit 20ff9e4
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 22 deletions.
18 changes: 18 additions & 0 deletions course_contents/RunningRealWorkflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# RNA-Seq workflow

Let's run a commonly used Nextflow pipeline to analise RNA-seq data ([nf-core/rnaseq](https://nf-co.re/rnaseq/3.17.0)).

This pipeline that we will run will cover the following 4 steps using diffrent coomonly used bioinformatics tools:

1. Indexes a transcriptome file
2. Quality control of the high throughput sequence data with **FastQC**
3. Quantification of transcripts using **Salmon**
4. Creates a **MultiQC** report. MultiQC searches a given directory for analysis logs and compiles a easy-viwing HTML report.

This is based on this part of [Nextflow tutorial](https://training.nextflow.io/basic_training/rnaseq_pipeline/). There you can find the pipeline broken into the different pieces in a collection of 7 different scripts if you want to get into the details.

In this part of the tutorial you can also see that Nextflow allows the execution of a workflow project directly from a GitHub repository. This [GitHub repository](https://github.com/nextflow-io/rnaseq-nf) hosts a version of this tutorial workflow (first 4 steps with some test data). You can run it specifying the project name and executing each process in a Docker container (`with-docker` as parameter). The containers will be automatically downloaded and saved in the folder `$HOME/.nextflow`.

```groovy
nextflow run nextflow-io/rnaseq-nf -with-docker
```
26 changes: 26 additions & 0 deletions course_contents/SeqeraPlatform
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Run Nextflow CLI with Seqera Platform visualizing and capturing logs

## Seqera platform

The Seqera Platform is a collaborative environment where pipelines and analysis results can be launched, cataloged, monitored, organized, and shared with colleagues.

Seqera platform can help us by:

1. giving researchers early access to pipelines and computational resources
2. promoting effective collaboration,
3. standardizing and accelerating the generation of results,
4. ensuring compliance and security providing the framework for reliable and reproducible pipeline execution
5. allowing us to optimize and reduce computing and storage costs

First you need to create an account and creat an access token. Later you need to export the token to your system:

```bash
export TOWER_ACCESS_TOKEN=copyandpastetokenfromtheSqeraPlatformhere
```

Lets's run our first nextflow script in Seqera with the addition of the -with-tower command:

```{code-block} groovy
:caption: hello.nf capturing logs in Seqera platform
nextflow run hello.nf -with-tower
```
35 changes: 13 additions & 22 deletions course_contents/Tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ nextflow -h
```
## Running our first script

Let's run our first script, 'Hello World!' script. Open a new file in VSCode in the codespace and copy paste the following code. Save it as hello-world.nf.
Let's run our first script, 'Hello World!' script. Open a new file in VSCode in the codespace and copy paste the following code. Save it as hello.nf.

```{code-block} groovy
:caption: hello-world.nf
:caption: hello.nf
#!/usr/bin/env nextflow
Expand Down Expand Up @@ -52,8 +52,8 @@ As you can see, a Nextflow script involves two main types of core components: pr

Let's try to run this code in your codespace:
```{code-block} groovy
:caption: Running hello-world.nf
nextflow run hello-world.nf
:caption: Running hello.nf
nextflow run hello.nf
```

## Find the output and logs in the work directory
Expand Down Expand Up @@ -89,7 +89,7 @@ output:

Run the pipeline again!
```groovy
nextflow run hello-world.nf
nextflow run hello.nf
```
Find the output file in the work directory.

Expand All @@ -105,7 +105,7 @@ process sayHello {

Run the pipeline again!
```groovy
nextflow run hello-world.nf
nextflow run hello.nf
```
Was the output file saved in there? Is it the same or different than the output file saved in the corresponding work directory?

Expand Down Expand Up @@ -171,7 +171,7 @@ sayHello(greeting_ch)
And run the pipeline again!

```groovy
nextflow run hello-world.nf
nextflow run hello.nf
```

## Relaunch a pipeline without repeating steps
Expand All @@ -180,7 +180,7 @@ A very useful option of nextflow is the -resume to launch a pipeline again witho

Run the workflow again with -resume
```groovy
nextflow run hello-world.nf -resume
nextflow run hello.nf -resume
```

## Use command line interface (CLI) parameters for inputs
Expand All @@ -195,7 +195,7 @@ greeting_ch = Channel.of(params.greeting)
Run the pipeline! Let's greet på Dansk!

```groovy
nextflow run hello-world.nf --greeting 'Hej verden!'
nextflow run hello.nf --greeting 'Hej verden!'
```

> Notice one thing here, for parameters that apply to a pipeline, we use a double hyphen (--),
Expand Down Expand Up @@ -251,7 +251,7 @@ workflow {
Let's greet på Dansk igen!

```groovy
nextflow run hello-world.nf --greeting 'Hej verden!'
nextflow run hello.nf --greeting 'Hej verden!'
```

## Let's run the script on a batch of input values
Expand Down Expand Up @@ -288,7 +288,7 @@ process sayHello {
Let's run the script again. But hang on, to expand the logging to display one line per process call to have a closer look to what is going on, just add `-ansi-log false` to the command.

```groovy
nextflow run hello-world.nf -ansi-log false
nextflow run hello.nf -ansi-log false
```

Check the results folder and the output files:
Expand Down Expand Up @@ -336,7 +336,7 @@ greeting_ch = Channel.fromPath(params.input_file)
Ok, lets try this script one last time!

```groovy
nextflow run hello-world.nf
nextflow run hello.nf
```

>You know how to provide the input values to the workflow via a file.
Expand All @@ -348,7 +348,7 @@ nextflow run hello-world.nf
Here you have you first nextflow script in full! Congratulations!

```{code-block} groovy
:caption: hello-world.nf
:caption: hello.nf
#!/usr/bin/env nextflow
/*
Expand Down Expand Up @@ -410,12 +410,3 @@ workflow {
convertToUpper(sayHello.out)
}
```

## Run Nextflow CLI with Seqera Platform visualizing and capturing logs

Run a Nextflow workflow with the addition of the -with-tower command:

```{code-block} groovy
:caption: hello.nf capturing logs in Seqera platform
nextflow run nextflow-io/hello -with-tower
```
2 changes: 2 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ course_information/Timing
course_contents/Contents
course_contents/Tutorial
course_contents/RunningRealWorkflow
course_contents/SeqeraPlatform
```

```{toctree}
Expand Down

0 comments on commit 20ff9e4

Please sign in to comment.