Skip to content

Commit 58b1fd7

Browse files
committed
docs: added detailed instructions for running nextflow pipelines
1 parent 2336109 commit 58b1fd7

1 file changed

Lines changed: 108 additions & 0 deletions

File tree

docs/3_pipelines.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,79 @@
33
By default, we run [nf-core](https://nf-co.re) pipelines. To run a pipeline, read
44
the official [documentation with an example](https://nf-co.re/configs/ku_sund_danhead).
55

6+
## Basic workflow for running an nf-core pipeline
7+
8+
You will need at least 3 things to run a pipeline:
9+
10+
- A slurm (sbatch) script that will run the pipeline on one the computing nodes
11+
- A parameter file which contains the options specific for your experiment
12+
- A samplesheet, typically specific for the pipeline in question. Sometimes (such as is the case with the PRIME-seq pipeline), you will need a few more csv files
13+
14+
### The samplesheet
15+
16+
You will need to follow the instructions specific to the experiment you have done and pipeline you wish to run.
17+
18+
An example of an RNA-seq samplesheet is taken from the [nf-core website](https://nf-co.re/rnaseq/3.14.0/):
19+
20+
``` bash
21+
sample,fastq_1,fastq_2,strandedness
22+
CONTROL_REP1,AEG588A1_S1_L002_R1_001.fastq.gz,AEG588A1_S1_L002_R2_001.fastq.gz,auto
23+
CONTROL_REP1,AEG588A1_S1_L003_R1_001.fastq.gz,AEG588A1_S1_L003_R2_001.fastq.gz,auto
24+
CONTROL_REP1,AEG588A1_S1_L004_R1_001.fastq.gz,AEG588A1_S1_L004_R2_001.fastq.gz,auto
25+
```
26+
As good practice, place the full path of the FASTQ files, e.g.: /maps/projects/dan1/data/Brickman/assays/RNA_ABC_19700101/raw/SAMPLE_S1_L001_R1_001.fastq.gz
27+
28+
It might be easier to make this sheet in Excel and then export it as a csv file.
29+
30+
Save or copy this file as samplesheet.csv in your assay folder.
31+
32+
### Parameters
33+
34+
A params.yml file contains the options you can customise for your run or experiment.
35+
36+
``` bash
37+
input: /maps/projects/dan1/data/Brickman/assays/RNA_ABC_19700101/samplesheet.csv
38+
outdir: /projects/dan1/scratch/temp/abc123/19700101_ABC_RNAseq
39+
fasta: /maps/projects/dan1/data/Brickman/shared/references/homo_sapiens/ensembl/GRCh38_110/Homo_sapiens.GRCh38.dna_sm.primary_assembly.fa
40+
aligner: star_rsem
41+
gtf: /maps/projects/dan1/data/Brickman/shared/references/homo_sapiens/ensembl/GRCh38_110/Homo_sapiens.GRCh38.110.gtf
42+
skip_pseudo_alignment: true
43+
```
44+
45+
Here I have specified the genome and gene annotation files I would like to use. This will depend on your experiment.
46+
47+
### A slurm script
48+
49+
Here is an example of a slurm script required. Modify it to your liking.
50+
51+
``` bash
52+
#!/bin/bash
53+
54+
#SBATCH --job-name=wooo_pipelines # job name
55+
#SBATCH --mail-type=NONE # mail events (NONE, BEGIN, END, FAIL, ALL)
56+
#SBATCH -c 1 # number of requested cores
57+
#SBATCH --mem=4gb # total requested RAM
58+
#SBATCH --time=2-00:00:00 # max. running time of the job, format in D-HH:MM:SS
59+
#SBATCH --output=pipeline_%j.log # Standard output and error log, '%j' gives the job ID
60+
#SBATCH -w dancmpn02fl # dancmpn01fl or dancmpn02fl
61+
62+
ml purge
63+
ml openjdk/20.0.0 nextflow/23.04.1.5866 singularity/3.8.0
64+
65+
nextflow run nf-core/rnaseq \
66+
-r 3.14.0 \
67+
-with-tower \
68+
-profile ku_sund_danhead,dancmpn02fl # The second bit needs to match the SBATCH -w at the top; send the run to the same server!
69+
70+
```
71+
72+
To schedule the script:
73+
74+
``` bash
75+
sbatch pipeline.sbatch
76+
```
77+
78+
679
## Monitoring runs with Nextflow Tower
780

881
This is a guide on how to use [Nextflow Tower](https://help.tower.nf/23.1/) to
@@ -26,6 +99,41 @@ wget https://github.com/seqeralabs/tower-cli/releases/download/v0.7.3/tw-0.7.3-l
2699
# Make the file executable and move to directory accessible by $PATH variable:
27100
mkdir ~/.local/bin && mv tw-* tw && chmod +x ~/.local/bin/tw
28101
```
102+
## Failed to pull singularity image error
103+
104+
If you see the following error in your nextflow.log or in tower:
105+
106+
```
107+
Failed to pull singularity image
108+
```
109+
110+
Then you need to force download the images you need to run the pipeline. Singularity images are specific to __both__ the computing server and the version of the pipeline.
111+
112+
Create an interactive session in the server you would like to send your pipeline to.
113+
114+
``` bash
115+
srun -c 2 --mem=8gb -w [dancmpn01fl OR dancmpn02fl] --time=0-04:00:00 -J mBanana --pty bash
116+
```
117+
118+
Load in a few modules
119+
120+
``` bash
121+
ml dangpu_libs python/3.8.16 nextflow nf-core/2.13.1a singularity
122+
```
123+
124+
Download the containers for a particular pipeline
125+
126+
``` bash
127+
nf-core download --revision [PIPELINE_VERSION] --compress none --container-system singularity [PIPELINE]
128+
129+
```
130+
131+
An example for version 3.14.0 of the nf-core RNA-seq pipeline is:
132+
133+
``` bash
134+
nf-core download --revision 3.14.0 --compress none container-system singularity nf-core/rnaseq
135+
```
136+
29137

30138
[^1]: [Tower CLI configuration](https://github.com/seqeralabs/tower-cli/#2-configuration)
31139
[^2]: [Tower Agent](https://help.tower.nf/22.3/agent/)

0 commit comments

Comments
 (0)