-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add last question corrections for TP1
- Loading branch information
Showing
4 changed files
with
145 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
nextflow.enable.dsl=2 | ||
|
||
params.ref = "ref.fa" | ||
refch = file(params.ref) | ||
|
||
process buildIndex(){ | ||
input: | ||
path ref | ||
output: | ||
path "transcripts_index" | ||
publishDir "index", mode: "copy" | ||
shell: | ||
''' | ||
salmon index -t !{ref} -i transcripts_index | ||
''' | ||
} | ||
|
||
workflow { | ||
buildIndex(refch) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
nextflow.enable.dsl=2 | ||
|
||
params.ref = "ref.fa" | ||
params.input = "fastq/" | ||
|
||
refch = file(params.ref) | ||
fastqch = channel.fromFilePairs("${params.input}/*_{1,2}.fastq.gz") | ||
|
||
process buildIndex(){ | ||
input: | ||
path ref | ||
output: | ||
path "transcripts_index" | ||
publishDir "index", mode: "copy" | ||
shell: | ||
''' | ||
salmon index -t !{ref} -i transcripts_index | ||
''' | ||
} | ||
|
||
process quant(){ | ||
input: | ||
path index | ||
tuple val(ID), path(fastq) | ||
output: | ||
path "${ID}" | ||
publishDir "expression", mode: "copy" | ||
shell: | ||
''' | ||
salmon quant -i !{index} -l A -1 !{fastq[0]} -2 !{fastq[1]} -o !{ID} | ||
''' | ||
} | ||
|
||
workflow { | ||
buildIndex(refch) | ||
quant( buildIndex.out, fastqch) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
nextflow.enable.dsl=2 | ||
|
||
params.ref = "ref.fa" | ||
params.input = "fastq/" | ||
|
||
refch = file(params.ref) | ||
fastqch = channel.fromSRA("SRP156394") | ||
|
||
process buildIndex(){ | ||
input: | ||
path ref | ||
output: | ||
path "transcripts_index" | ||
publishDir "index", mode: "copy" | ||
shell: | ||
''' | ||
salmon index -t !{ref} -i transcripts_index | ||
''' | ||
} | ||
|
||
process quant(){ | ||
input: | ||
path index | ||
tuple val(ID), path(fastq) | ||
output: | ||
path "${ID}" | ||
publishDir "expression", mode: "copy" | ||
shell: | ||
''' | ||
salmon quant -i !{index} -l A -1 !{fastq[0]} -2 !{fastq[1]} -o !{ID} | ||
''' | ||
} | ||
|
||
workflow { | ||
buildIndex(refch) | ||
quant( buildIndex.out, fastqch) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
nextflow.enable.dsl=2 | ||
|
||
params.index = null | ||
params.ref = "ref.fa" | ||
params.input = "fastq/" | ||
params.cpus = 2 | ||
params.memory = 5 | ||
|
||
refch = file(params.ref) | ||
fastqch = channel.fromFilePairs("${params.input}/*_{1,2}.fastq.gz") | ||
|
||
process buildIndex(){ | ||
input: | ||
path ref | ||
output: | ||
path "transcripts_index" | ||
publishDir "index", mode: "copy" | ||
shell: | ||
''' | ||
salmon index -t !{ref} -i transcripts_index | ||
''' | ||
} | ||
|
||
process quant(){ | ||
cpus params.cpus | ||
memory params.memory+"GB" | ||
|
||
input: | ||
path index | ||
tuple val(ID), path(fastq) | ||
output: | ||
path "${ID}" | ||
publishDir "expression", mode: "copy" | ||
shell: | ||
''' | ||
salmon quant -i !{index} -l A -1 !{fastq[0]} -2 !{fastq[1]} -o !{ID} | ||
''' | ||
} | ||
|
||
workflow { | ||
if(!params.index){ | ||
ind = buildIndex(refch) | ||
}else{ | ||
ind = channel.from(params.ref) | ||
} | ||
quant( ind, fastqch) | ||
} | ||
|