Skip to content

Commit d190e67

Browse files
committed
clean up assay suffix uses, fix help menu
1 parent a8c7f5f commit d190e67

File tree

14 files changed

+68
-244
lines changed

14 files changed

+68
-244
lines changed

RNAseq/Workflow_Documentation/NF_RCP/workflow_code/main.nf

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// main.nf
2-
32
nextflow.enable.dsl=2
43

54
def colorCodes = [
@@ -10,26 +9,18 @@ def colorCodes = [
109
c_yellow: "\u001b[33;1m",
1110
c_reset: "\033[0m"
1211
]
12+
// Command for: 'run main.nf --version'
1313

14-
// Include the showHelp function from help.nf
15-
include { showHelp } from './modules/help.nf'
16-
// Only display the help message if --help parameter is specified
17-
if (params.help) {
18-
showHelp(workflow)
19-
}
20-
21-
if (params.version) {
22-
println("${workflow.manifest.name} ${workflow.manifest.version}")
23-
exit 0
24-
}
25-
26-
// Print the pipeline version
14+
// Print the pipeline version on start
2715
println """
2816
${colorCodes.c_bright_green}${colorCodes.c_line}
2917
${workflow.manifest.name} ${workflow.manifest.version}
3018
${colorCodes.c_line}${colorCodes.c_reset}
3119
""".stripIndent()
32-
20+
if (params.version) {
21+
println("${workflow.manifest.name} ${workflow.manifest.version}")
22+
exit 0
23+
}
3324
// Debug warning
3425
println("${colorCodes.c_yellow}")
3526
if (params.limit_samples_to || params.truncate_to || params.force_single_end || params.genome_subsample) {
@@ -43,32 +34,9 @@ if (params.limit_samples_to || params.truncate_to || params.force_single_end ||
4334
}
4435
println("${colorCodes.c_reset}")
4536

46-
// Check required parameters
47-
if ((params.accession) || params.runsheet_path || params.isa_archive_path) {
48-
// Proceed
49-
} else {
50-
log.error """
51-
Missing Required Parameters: You must provide either --accession, or --runsheet_path, or --accession and--isa_archive_path.
52-
Examples:
53-
--accession [OSD-# or GLDS-#]
54-
--runsheet_path /path/to/runsheet.csv
55-
--accession [OSD-# or GLDS-#] --isa_archive_path /path/to/isa_archive.zip
56-
"""
57-
exit 0
58-
}
59-
6037
include { RNASEQ } from './workflows/rnaseq.nf'
6138
include { RNASEQ_MICROBES } from './workflows/rnaseq_microbes.nf'
6239

63-
// Validate accession format. Must be OSD-# or GLDS-#
64-
if (params.accession && !params.accession.matches(/^(OSD|GLDS)-\d+$/)) {
65-
log.error "Invalid accession format. Expected format: OSD-# or GLDS-#"
66-
exit 1
67-
}
68-
69-
// Set up channels. This will be used to pass in parameters from initialization
70-
// into the entire workflow or subworkflows run independently (e.g. rerunning a
71-
// specific step for reprocessing a dataset after metadata updates)
7240
ch_dp_tools_plugin = params.dp_tools_plugin ?
7341
Channel.value(file(params.dp_tools_plugin)) :
7442
Channel.value(file(params.mode == 'microbes' ?
@@ -88,17 +56,15 @@ ch_force_single_end = Channel.value(params.force_single_end)
8856
ch_reference_store_path = Channel.value(params.reference_store_path)
8957
ch_derived_store_path = Channel.value(params.derived_store_path)
9058

91-
// Set outdir based on the presence of an accession input.. currently not implemented as nextflow.config's outdir is only used for nextflow run info
92-
// and ch_outdir is used for all processes' publishDir in order to set either ./results or ./{accession}
93-
ch_outdir = params.accession ? "$projectDir/${params.accession}" : "$projectDir/results"
94-
95-
9659
// set reference params
9760
ch_reference_source = params.reference_source ? Channel.value(params.reference_source) : null
9861
ch_reference_version = params.reference_version ? Channel.value(params.reference_version) : null
9962
ch_reference_fasta = params.reference_fasta ? Channel.fromPath(params.reference_fasta) : null
10063
ch_reference_gtf = params.reference_gtf ? Channel.fromPath(params.reference_gtf) : null
10164

65+
// Set outdir based on the presence of an accession input.. currently not implemented as nextflow.config's outdir is only used for nextflow run info
66+
// and ch_outdir is used for all processes' publishDir in order to set either ./results or ./{accession}
67+
ch_outdir = params.accession ? "$projectDir/${params.accession}" : "$projectDir/results"
10268

10369
// Main workflows
10470
workflow {
@@ -137,4 +103,4 @@ workflow {
137103
ch_derived_store_path
138104
)
139105
}
140-
}
106+
}

RNAseq/Workflow_Documentation/NF_RCP/workflow_code/modules/add_gene_annotations.nf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ process ADD_GENE_ANNOTATIONS {
1111
path(dge_no_annotations)
1212

1313
output:
14-
path("differential_expression${params.output_suffix}.csv"), emit: annotated_dge_table
14+
path("differential_expression${params.assay_suffix}.csv"), emit: annotated_dge_table
1515
path("versions.txt"), emit: versions_txt
1616

1717
script:
18-
def output_filename_suffix = params.output_suffix ?: ""
18+
def output_filename_suffix = params.assay_suffix ?: ""
1919
def annotations_rmd_file = "${projectDir}/bin/add_gene_annotations.Rmd"
2020

2121
"""

RNAseq/Workflow_Documentation/NF_RCP/workflow_code/modules/dge_deseq2.nf

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ process DGE_DESEQ2 {
1111
path(gene_counts)
1212

1313
output:
14-
tuple path("Normalized_Counts${params.output_suffix}.csv"),
15-
path(params.mode == "microbes" ? "FeatureCounts_Unnormalized_Counts${params.output_suffix}.csv" :
16-
"RSEM_Unnormalized_Counts${params.output_suffix}.csv"), emit: norm_counts
17-
path("contrasts${params.output_suffix}.csv"), emit: contrasts
18-
path("SampleTable${params.output_suffix}.csv"), emit: sample_table
19-
path("differential_expression_no_annotations${params.output_suffix}.csv"), emit: dge_table
20-
path("VST_Normalized_Counts${params.output_suffix}.csv"), emit: vst_norm_counts
14+
tuple path("Normalized_Counts${params.assay_suffix}.csv"),
15+
path(params.mode == "microbes" ? "FeatureCounts_Unnormalized_Counts${params.assay_suffix}.csv" :
16+
"RSEM_Unnormalized_Counts${params.assay_suffix}.csv"), emit: norm_counts
17+
path("contrasts${params.assay_suffix}.csv"), emit: contrasts
18+
path("SampleTable${params.assay_suffix}.csv"), emit: sample_table
19+
path("differential_expression_no_annotations${params.assay_suffix}.csv"), emit: dge_table
20+
path("VST_Normalized_Counts${params.assay_suffix}.csv"), emit: vst_norm_counts
2121
path("summary.txt"), emit: summary
2222
path("versions2.txt"), emit: versions
2323

2424
script:
25-
def output_filename_suffix = params.output_suffix ?: ""
25+
def output_filename_suffix = params.assay_suffix ?: ""
2626
def microbes = params.mode == 'microbes' ? 'TRUE' : 'FALSE'
2727
def dge_rmd_file = "${projectDir}/bin/dge_deseq2.Rmd"
2828
def debug_dummy_counts = params.use_dummy_gene_counts ? 'TRUE' : 'FALSE'

RNAseq/Workflow_Documentation/NF_RCP/workflow_code/modules/extend_dge_table.nf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ process EXTEND_DGE_TABLE {
99
path(dge_table)
1010

1111
output:
12-
path("visualization_output_table${params.output_suffix}.csv"), emit: dge_visualization_table
12+
path("visualization_output_table${params.assay_suffix}.csv"), emit: dge_visualization_table
1313
path("versions.txt"), emit: versions_txt
1414

1515
script:
16-
def output_filename_suffix = params.output_suffix ?: ""
16+
def output_filename_suffix = params.assay_suffix ?: ""
1717
def extend_rmd_file = "${projectDir}/bin/extend_dge_table.Rmd"
1818

1919
"""

RNAseq/Workflow_Documentation/NF_RCP/workflow_code/modules/featurecounts.nf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ process FEATURECOUNTS {
88
path(bam_files)
99

1010
output:
11-
path("FeatureCounts_GLbulkRNAseq.tsv"), emit: counts
12-
path("FeatureCounts_GLbulkRNAseq.tsv.summary"), emit: summary
11+
path("FeatureCounts${params.assay_suffix}.tsv"), emit: counts
12+
path("FeatureCounts${params.assay_suffix}.tsv.summary"), emit: summary
1313
path("versions.yml"), emit: versions
1414

1515
script:
@@ -35,7 +35,7 @@ process FEATURECOUNTS {
3535
-a ${genomeGtf} \\
3636
-t "\${GTF_FEATURES}" \\
3737
-s ${strandOption} \\
38-
-o "FeatureCounts_GLbulkRNAseq.tsv" \\
38+
-o "FeatureCounts${params.assay_suffix}.tsv" \\
3939
\$bam_list
4040
4141
echo '"${task.process}":' > versions.yml

RNAseq/Workflow_Documentation/NF_RCP/workflow_code/modules/generate_pca_table.nf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ process GENERATE_PCA_TABLE {
99
path(normalized_counts)
1010

1111
output:
12-
path("visualization_PCA_table${params.output_suffix}.csv"), emit: pca_table
12+
path("visualization_PCA_table${params.assay_suffix}.csv"), emit: pca_table
1313
path("versions.txt"), emit: versions_txt
1414

1515
script:
16-
def output_filename_suffix = params.output_suffix ?: ""
16+
def output_filename_suffix = params.assay_suffix ?: ""
1717
def pca_rmd_file = "${projectDir}/bin/generate_pca_table.Rmd"
1818

1919
"""

RNAseq/Workflow_Documentation/NF_RCP/workflow_code/modules/help.nf

Lines changed: 0 additions & 122 deletions
This file was deleted.

RNAseq/Workflow_Documentation/NF_RCP/workflow_code/modules/multiqc.nf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ process MULTIQC {
1010

1111
output:
1212
// path("${ mqc_label }_multiqc_GLbulkRNAseq_report.zip"), emit: zipped_report, to do: reimplement zip output w/ cleaned paths
13-
path("${ mqc_label }_multiqc_GLbulkRNAseq_report"), emit: unzipped_report
14-
path("${ mqc_label }_multiqc_GLbulkRNAseq_report.zip"), emit: zipped_report
15-
path("${ mqc_label }_multiqc_GLbulkRNAseq_report/${ mqc_label }_multiqc_GLbulkRNAseq.html"), emit: html
16-
path("${ mqc_label }_multiqc_GLbulkRNAseq_report/${ mqc_label }_multiqc_GLbulkRNAseq_data"), emit: data
13+
path("${ mqc_label }_multiqc_${ params.assay_suffix }_report"), emit: unzipped_report
14+
path("${ mqc_label }_multiqc_${ params.assay_suffix }_report.zip"), emit: zipped_report
15+
path("${ mqc_label }_multiqc_${ params.assay_suffix }_report/${ mqc_label }_multiqc_${ params.assay_suffix }.html"), emit: html
16+
path("${ mqc_label }_multiqc_${ params.assay_suffix }_report/${ mqc_label }_multiqc_${ params.assay_suffix }_data"), emit: data
1717
path("versions.yml"), emit: versions
1818

1919
script:
@@ -22,11 +22,11 @@ process MULTIQC {
2222
multiqc \\
2323
--force \\
2424
--interactive \\
25-
-o ${ mqc_label }_multiqc_GLbulkRNAseq_report \\
26-
-n ${ mqc_label }_multiqc_GLbulkRNAseq \\
25+
-o ${ mqc_label }_multiqc_${ params.assay_suffix }_report \\
26+
-n ${ mqc_label }_multiqc_${ params.assay_suffix } \\
2727
${ config_arg } \\
2828
.
29-
zip -r '${ mqc_label }_multiqc_GLbulkRNAseq_report.zip' '${ mqc_label }_multiqc_GLbulkRNAseq_report'
29+
zip -r '${ mqc_label }_multiqc_${ params.assay_suffix }_report.zip' '${ mqc_label }_multiqc_${ params.assay_suffix }_report'
3030
3131
echo '"${task.process}":' > versions.yml
3232
echo " multiqc: \$(multiqc --version | sed "s/multiqc, version //")" >> versions.yml

0 commit comments

Comments
 (0)