Skip to content

Commit

Permalink
Merge pull request #67 from seqeralabs/Final_changes_22Mar2022
Browse files Browse the repository at this point in the history
Final changes 22 mar2022
  • Loading branch information
chriswyatt1 authored Apr 5, 2022
2 parents c36e42b + c940af3 commit fa4c8b6
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 72 deletions.
5 changes: 3 additions & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ tasks:
init: |
echo 'init script' # runs during prebuild
echo 'start script'
command: |
curl -s https://get.nextflow.io | bash
chmod +x nextflow
sudo mv nextflow /usr/local/bin/
docker pull nextflow/rnaseq-nf
command: |
sudo apt install -y tree
sudo apt install -y graphviz
unset JAVA_TOOL_OPTIONS
Expand Down
22 changes: 11 additions & 11 deletions asciidocs/rnaseq_pipeline.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ The script `script1.nf` defines the pipeline input parameters.

[source,nextflow,linenums]
----
params.reads = "$baseDir/data/ggal/*_{1,2}.fq"
params.transcriptome_file = "$baseDir/data/ggal/transcriptome.fa"
params.multiqc = "$baseDir/multiqc"
params.reads = "$projectDir/data/ggal/*_{1,2}.fq"
params.transcriptome_file = "$projectDir/data/ggal/transcriptome.fa"
params.multiqc = "$projectDir/multiqc"
println "reads: $params.reads"
----
Expand All @@ -45,10 +45,10 @@ that will be used as the pipeline output directory.
====
[source,nextflow,linenums]
----
params.reads = "$baseDir/data/ggal/*_{1,2}.fq"
params.transcriptome_file = "$baseDir/data/ggal/transcriptome.fa"
params.multiqc = "$baseDir/multiqc"
params.outdir = "$baseDir/myresults"
params.reads = "$projectDir/data/ggal/*_{1,2}.fq"
params.transcriptome_file = "$projectDir/data/ggal/transcriptome.fa"
params.multiqc = "$projectDir/multiqc"
params.outdir = "results"
----
====

Expand Down Expand Up @@ -183,7 +183,7 @@ process index {
input:
...
----
Then check it worked, by looking at the script executed in the work directory. Look for the hexidecimal (e.g. work/7f/f285b80022d9f61e82cd7f90436aa4/), Then `cat` the .command.sh.
Then check it worked, by looking at the script executed in the work directory. Look for the hexidecimal (e.g. work/7f/f285b80022d9f61e82cd7f90436aa4/), Then `cat` the `.command.sh` file.
====

[discrete]
Expand Down Expand Up @@ -313,7 +313,7 @@ In this script, note how the `index_ch` channel, declared as output in the `inde
is now used as a channel in the input section.

Also, note how the second input is declared as a `tuple` composed by two elements:
the `pair_id` and the `reads` in order to match the structure of the items emitted
the `sample_id` and the `reads` in order to match the structure of the items emitted
by the `read_pairs_ch` channel.


Expand Down Expand Up @@ -348,7 +348,7 @@ Add a https://www.nextflow.io/docs/latest/process.html#tag[tag] directive to the
====
Add the following before the input declaration:
```
tag "Salmon on $pair_id"
tag "Salmon on $sample_id"
```
====

Expand Down Expand Up @@ -531,7 +531,7 @@ the following code:
----
script:
"""
fastqc.sh "$pair_id" "$reads"
fastqc.sh "$sample_id" "$reads"
"""
----

Expand Down
16 changes: 7 additions & 9 deletions asciidocs/setup.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Nextflow can be used on any POSIX compatible system (Linux, OS X, Windows Subsys

* Bash
* http://www.oracle.com/technetwork/java/javase/downloads/index.html[Java 8 (or later, up to 15)]
* Git

*Optional requirements for this tutorial*:

Expand Down Expand Up @@ -40,7 +41,7 @@ Then ensure that the downloaded binary is executable:
chmod +x nextflow
----

or put the nextflow executable into your $PATH (e.g. /usr/bin)
AND put the nextflow executable into your $PATH (e.g. /usr/local/bin)

=== Training material

Expand All @@ -49,14 +50,7 @@ in the terminal:

[source,bash,linenums]
----
curl https://s3-eu-west-1.amazonaws.com/seqeralabs.com/public/nf-training.tar.gz | tar xvz
----

Or alternatively if you have `wget` instead of curl:

[source,bash,linenums]
----
wget -q -O- https://s3-eu-west-1.amazonaws.com/seqeralabs.com/public/nf-training.tar.gz | tar xvz
git clone https://github.com/seqeralabs/nf-training-public.git
----

Check the correct installation of `nextflow` by running the following command:
Expand Down Expand Up @@ -123,6 +117,10 @@ image::gitpod.welcome.png[]

**The main window** allows you to view and edit files. Clicking on a file in the explorer will open it within the main window. We can also see the nf-training material in this window, but if you find the space too small you can open it separately in another browser window (https://training.seqera.io/). Finally, if you accidently close the Gitpod training window, you can reopen it by entering `gp preview https://training.seqera.io`.

4. Saving your files in Gitpod to local machine.

To save your files, choose your file of interest, then either use the left/top hand side bar (File/Save As...) or use you're keyboard shortcut to save as (On Mac: CMD, shift, s), then choose `Show local`. This will open up a explorer to choose where to save your file on your local machine.

### Reopening a Gitpod session

Any running workspace will be automatically stopped after 30 minutes. You can open the environment again by going to https://gitpod.io/workspaces and finding your previous environment, then clicking the three dot button to the right, and selecting Open.
Expand Down
6 changes: 3 additions & 3 deletions nf-training/script1.nf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
params.reads = "$baseDir/data/ggal/gut_{1,2}.fq"
params.transcriptome_file = "$baseDir/data/ggal/transcriptome.fa"
params.multiqc = "$baseDir/multiqc"
params.reads = "$projectDir/data/ggal/gut_{1,2}.fq"
params.transcriptome_file = "$projectDir/data/ggal/transcriptome.fa"
params.multiqc = "$projectDir/multiqc"

println "reads: $params.reads"
6 changes: 3 additions & 3 deletions nf-training/script2.nf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* pipeline input parameters
*/
params.reads = "$baseDir/data/ggal/*_{1,2}.fq"
params.transcriptome_file = "$baseDir/data/ggal/transcriptome.fa"
params.multiqc = "$baseDir/multiqc"
params.reads = "$projectDir/data/ggal/*_{1,2}.fq"
params.transcriptome_file = "$projectDir/data/ggal/transcriptome.fa"
params.multiqc = "$projectDir/multiqc"
params.outdir = "results"

log.info """\
Expand Down
6 changes: 3 additions & 3 deletions nf-training/script3.nf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* pipeline input parameters
*/
params.reads = "$baseDir/data/ggal/gut_{1,2}.fq"
params.transcriptome_file = "$baseDir/data/ggal/transcriptome.fa"
params.multiqc = "$baseDir/multiqc"
params.reads = "$projectDir/data/ggal/gut_{1,2}.fq"
params.transcriptome_file = "$projectDir/data/ggal/transcriptome.fa"
params.multiqc = "$projectDir/multiqc"
params.outdir = "results"

log.info """\
Expand Down
12 changes: 6 additions & 6 deletions nf-training/script4.nf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* pipeline input parameters
*/
params.reads = "$baseDir/data/ggal/gut_{1,2}.fq"
params.transcriptome_file = "$baseDir/data/ggal/transcriptome.fa"
params.multiqc = "$baseDir/multiqc"
params.reads = "$projectDir/data/ggal/gut_{1,2}.fq"
params.transcriptome_file = "$projectDir/data/ggal/transcriptome.fa"
params.multiqc = "$projectDir/multiqc"
params.outdir = "results"

log.info """\
Expand Down Expand Up @@ -43,14 +43,14 @@ process quantification {

input:
path salmon_index from index_ch
tuple pair_id, path(reads) from read_pairs_ch
tuple val(sample_id), path(reads) from read_pairs_ch

output:
path pair_id into quant_ch
path sample_id into quant_ch

script:
"""
salmon quant --threads $task.cpus --libType=U -i $salmon_index -1 ${reads[0]} -2 ${reads[1]} -o $pair_id
salmon quant --threads $task.cpus --libType=U -i $salmon_index -1 ${reads[0]} -2 ${reads[1]} -o $sample_id
"""
}

22 changes: 11 additions & 11 deletions nf-training/script5.nf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* pipeline input parameters
*/
params.reads = "$baseDir/data/ggal/gut_{1,2}.fq"
params.transcriptome_file = "$baseDir/data/ggal/transcriptome.fa"
params.multiqc = "$baseDir/multiqc"
params.reads = "$projectDir/data/ggal/gut_{1,2}.fq"
params.transcriptome_file = "$projectDir/data/ggal/transcriptome.fa"
params.multiqc = "$projectDir/multiqc"
params.outdir = "results"

log.info """\
Expand Down Expand Up @@ -43,29 +43,29 @@ process quantification {

input:
path salmon_index from index_ch
tuple pair_id, path(reads) from read_pairs_ch
tuple val(sample_id), path(reads) from read_pairs_ch

output:
path pair_id into quant_ch
path sample_id into quant_ch

script:
"""
salmon quant --threads $task.cpus --libType=U -i $salmon_index -1 ${reads[0]} -2 ${reads[1]} -o $pair_id
salmon quant --threads $task.cpus --libType=U -i $salmon_index -1 ${reads[0]} -2 ${reads[1]} -o $sample_id
"""
}

process fastqc {
tag "FASTQC on $pair_id"
tag "FASTQC on $sample_id"

input:
tuple pair_id, path(reads) from read_pairs_ch
tuple sample_id, path(reads) from read_pairs_ch

output:
path "fastqc_${pair_id}_logs" into fastqc_ch
path "fastqc_${sample_id}_logs" into fastqc_ch

script:
"""
mkdir fastqc_${pair_id}_logs
fastqc -o fastqc_${pair_id}_logs -f fastq -q ${reads}
mkdir fastqc_${sample_id}_logs
fastqc -o fastqc_${sample_id}_logs -f fastq -q ${reads}
"""
}
24 changes: 12 additions & 12 deletions nf-training/script6.nf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* pipeline input parameters
*/
params.reads = "$baseDir/data/ggal/gut_{1,2}.fq"
params.transcriptome_file = "$baseDir/data/ggal/transcriptome.fa"
params.multiqc = "$baseDir/multiqc"
params.reads = "$projectDir/data/ggal/gut_{1,2}.fq"
params.transcriptome_file = "$projectDir/data/ggal/transcriptome.fa"
params.multiqc = "$projectDir/multiqc"
params.outdir = "results"

log.info """\
Expand Down Expand Up @@ -40,34 +40,34 @@ Channel
.into { read_pairs_ch; read_pairs2_ch }

process quantification {
tag "$pair_id"
tag "$sample_id"

input:
path salmon_index from index_ch
tuple pair_id, path(reads) from read_pairs_ch
tuple val(sample_id), path(reads) from read_pairs_ch

output:
path pair_id into quant_ch
path sample_id into quant_ch

script:
"""
salmon quant --threads $task.cpus --libType=U -i $salmon_index -1 ${reads[0]} -2 ${reads[1]} -o $pair_id
salmon quant --threads $task.cpus --libType=U -i $salmon_index -1 ${reads[0]} -2 ${reads[1]} -o $sample_id
"""
}

process fastqc {
tag "FASTQC on $pair_id"
tag "FASTQC on $sample_id"

input:
tuple pair_id, path(reads) from read_pairs2_ch
tuple val(sample_id), path(reads) from read_pairs2_ch

output:
path "fastqc_${pair_id}_logs" into fastqc_ch
path "fastqc_${sample_id}_logs" into fastqc_ch

script:
"""
mkdir fastqc_${pair_id}_logs
fastqc -o fastqc_${pair_id}_logs -f fastq -q ${reads}
mkdir fastqc_${sample_id}_logs
fastqc -o fastqc_${sample_id}_logs -f fastq -q ${reads}
"""
}

Expand Down
24 changes: 12 additions & 12 deletions nf-training/script7.nf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* pipeline input parameters
*/
params.reads = "$baseDir/data/ggal/gut_{1,2}.fq"
params.transcriptome_file = "$baseDir/data/ggal/transcriptome.fa"
params.multiqc = "$baseDir/multiqc"
params.reads = "$projectDir/data/ggal/gut_{1,2}.fq"
params.transcriptome_file = "$projectDir/data/ggal/transcriptome.fa"
params.multiqc = "$projectDir/multiqc"
params.outdir = "results"

log.info """\
Expand Down Expand Up @@ -40,35 +40,35 @@ Channel
.into { read_pairs_ch; read_pairs2_ch }

process quantification {
tag "$pair_id"
tag "$sample_id"

input:
path salmon_index from index_ch
tuple pair_id, path(reads) from read_pairs_ch
tuple val(sample_id), path(reads) from read_pairs_ch

output:
path pair_id into quant_ch
path sample_id into quant_ch

script:
"""
salmon quant --threads $task.cpus --libType=U -i $salmon_index -1 ${reads[0]} -2 ${reads[1]} -o $pair_id
salmon quant --threads $task.cpus --libType=U -i $salmon_index -1 ${reads[0]} -2 ${reads[1]} -o $sample_id
"""
}

process fastqc {
tag "FASTQC on $pair_id"
tag "FASTQC on $sample_id"

input:
tuple pair_id, path(reads) from read_pairs2_ch
tuple val(sample_id), path(reads) from read_pairs2_ch

output:
path "fastqc_${pair_id}_logs" into fastqc_ch
path "fastqc_${sample_id}_logs" into fastqc_ch


script:
"""
mkdir fastqc_${pair_id}_logs
fastqc -o fastqc_${pair_id}_logs -f fastq -q ${reads}
mkdir fastqc_${sample_id}_logs
fastqc -o fastqc_${sample_id}_logs -f fastq -q ${reads}
"""
}

Expand Down

0 comments on commit fa4c8b6

Please sign in to comment.