-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workflow outputs (second preview) #30
Open
bentsherman
wants to merge
13
commits into
master
Choose a base branch
from
workflow-outputs-2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2d653c3
Replace publishDir with workflow output definition
bentsherman 0c08ad8
wip
pditommaso 4ca46a3
publish path redirection in modules
marcodelapierre 772d179
Move publish redirects to workflows
bentsherman f8957dd
Merge branch 'workflow-output-dsl' of github.com:nextflow-io/rnaseq-n…
pditommaso f54b6c8
Merge branch 'master' into workflow-output-dsl
pditommaso bb44e64
Remove workflow publish redirection
pditommaso aeb5525
Remove publish from workflow
pditommaso 267981b
Add index file
bentsherman 642dbad
Update to second preview
bentsherman b0c2f87
Refactor output directory structure
bentsherman e514be5
Merge branch 'master' into workflow-outputs-2
bentsherman 50d7f94
refactor multiqc output target
bentsherman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#!/usr/bin/env bash | ||
sample_id="$1" | ||
reads="$2" | ||
reads="$1" | ||
|
||
mkdir fastqc_${sample_id}_logs | ||
fastqc -o fastqc_${sample_id}_logs -f fastq -q ${reads} | ||
mkdir fastqc | ||
fastqc -o fastqc -f fastq -q ${reads} |
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 |
---|---|---|
|
@@ -4,36 +4,65 @@ | |
* Proof of concept of a RNAseq pipeline implemented with Nextflow | ||
*/ | ||
|
||
nextflow.preview.output = true | ||
|
||
/* | ||
* Default pipeline parameters. They can be overriden on the command line eg. | ||
* given `params.foo` specify on the run command line `--foo some_value`. | ||
*/ | ||
|
||
params.reads = "$baseDir/data/ggal/ggal_gut_{1,2}.fq" | ||
params.transcriptome = "$baseDir/data/ggal/ggal_1_48850000_49020000.Ggal71.500bpflank.fa" | ||
params.outdir = "results" | ||
params.multiqc = "$baseDir/multiqc" | ||
|
||
|
||
// import modules | ||
/* | ||
* import modules | ||
*/ | ||
include { RNASEQ } from './modules/rnaseq' | ||
include { MULTIQC } from './modules/multiqc' | ||
|
||
/* | ||
* main script flow | ||
*/ | ||
workflow { | ||
main: | ||
log.info """\ | ||
R N A S E Q - N F P I P E L I N E | ||
=================================== | ||
transcriptome: ${params.transcriptome} | ||
reads : ${params.reads} | ||
outdir : ${params.outdir} | ||
""".stripIndent() | ||
|
||
log.info """\ | ||
R N A S E Q - N F P I P E L I N E | ||
=================================== | ||
transcriptome: ${params.transcriptome} | ||
reads : ${params.reads} | ||
outdir : ${params.outdir} | ||
""" | ||
|
||
read_pairs_ch = channel.fromFilePairs( params.reads, checkIfExists: true ) | ||
read_pairs_ch = channel.fromFilePairs( params.reads, checkIfExists: true, flat: true ) | ||
RNASEQ( params.transcriptome, read_pairs_ch ) | ||
MULTIQC( RNASEQ.out, params.multiqc ) | ||
|
||
samples_ch = RNASEQ.out.quant | ||
| join(RNASEQ.out.fastqc) | ||
|
||
multiqc_ch = RNASEQ.out.quant | ||
| concat(RNASEQ.out.fastqc) | ||
| map { _id, file -> file } | ||
| collect | ||
MULTIQC( multiqc_ch, params.multiqc ) | ||
|
||
publish: | ||
samples_ch >> 'samples' | ||
MULTIQC.out >> 'summary' | ||
} | ||
|
||
output { | ||
samples { | ||
path { id, _quant, _fastqc -> "${workflow.outputDir}/${id}" } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is a bug in the workflow output DSL, it is not resolving the dynamic name against the base output directory |
||
index { | ||
path 'index.json' | ||
mapper { id, quant, fastqc -> | ||
[id: id, quant: quant, fastqc: fastqc] | ||
} | ||
} | ||
} | ||
|
||
summary { | ||
path '.' | ||
} | ||
} |
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 |
---|---|---|
@@ -1,18 +1,16 @@ | ||
params.outdir = 'results' | ||
|
||
process FASTQC { | ||
tag "FASTQC on $sample_id" | ||
tag "$sample_id" | ||
conda 'bioconda::fastqc=0.12.1' | ||
publishDir params.outdir, mode:'copy' | ||
|
||
input: | ||
tuple val(sample_id), path(reads) | ||
tuple val(sample_id), path(fastq_1), path(fastq_2) | ||
|
||
output: | ||
path "fastqc_${sample_id}_logs", emit: logs | ||
tuple val(sample_id), path('fastqc') | ||
|
||
script: | ||
""" | ||
fastqc.sh "$sample_id" "$reads" | ||
fastqc.sh "$fastq_1 $fastq_2" | ||
""" | ||
} |
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
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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
|
||
process QUANT { | ||
tag "$pair_id" | ||
tag "$sample_id" | ||
conda 'bioconda::salmon=1.10.3' | ||
|
||
input: | ||
path index | ||
tuple val(pair_id), path(reads) | ||
path index | ||
tuple val(sample_id), path(fastq_1), path(fastq_2) | ||
|
||
output: | ||
path pair_id | ||
tuple val(sample_id), path('quant') | ||
|
||
script: | ||
""" | ||
salmon quant --threads $task.cpus --libType=U -i $index -1 ${reads[0]} -2 ${reads[1]} -o $pair_id | ||
salmon quant --threads $task.cpus --libType=U -i $index -1 ${fastq_1} -2 ${fastq_2} -o quant | ||
""" | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change is the important bit -- we are joining the metadata, fastqc logs, and quant results for each sample into a single channel, and publishing that channel
then the
path
target directive is used to control the output directory structure