Skip to content

Commit e9c9c8a

Browse files
committed
Linting
1 parent 6cc4f19 commit e9c9c8a

1 file changed

Lines changed: 51 additions & 53 deletions

File tree

  • subworkflows/local/utils_nfcore_proteinannotator_pipeline

subworkflows/local/utils_nfcore_proteinannotator_pipeline/main.nf

Lines changed: 51 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99
*/
1010

11-
include { UTILS_NFSCHEMA_PLUGIN } from '../../nf-core/utils_nfschema_plugin'
12-
include { paramsSummaryMap } from 'plugin/nf-schema'
13-
include { samplesheetToList } from 'plugin/nf-schema'
14-
include { completionEmail } from '../../nf-core/utils_nfcore_pipeline'
15-
include { completionSummary } from '../../nf-core/utils_nfcore_pipeline'
16-
include { imNotification } from '../../nf-core/utils_nfcore_pipeline'
17-
include { UTILS_NFCORE_PIPELINE } from '../../nf-core/utils_nfcore_pipeline'
18-
include { UTILS_NEXTFLOW_PIPELINE } from '../../nf-core/utils_nextflow_pipeline'
11+
include { UTILS_NFSCHEMA_PLUGIN } from '../../nf-core/utils_nfschema_plugin'
12+
include { paramsSummaryMap } from 'plugin/nf-schema'
13+
include { samplesheetToList } from 'plugin/nf-schema'
14+
include { completionEmail } from '../../nf-core/utils_nfcore_pipeline'
15+
include { completionSummary } from '../../nf-core/utils_nfcore_pipeline'
16+
include { imNotification } from '../../nf-core/utils_nfcore_pipeline'
17+
include { UTILS_NFCORE_PIPELINE } from '../../nf-core/utils_nfcore_pipeline'
18+
include { UTILS_NEXTFLOW_PIPELINE } from '../../nf-core/utils_nextflow_pipeline'
1919

2020
/*
2121
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -24,14 +24,13 @@ include { UTILS_NEXTFLOW_PIPELINE } from '../../nf-core/utils_nextflow_pipelin
2424
*/
2525

2626
workflow PIPELINE_INITIALISATION {
27-
2827
take:
29-
version // boolean: Display version and exit
30-
validate_params // boolean: Boolean whether to validate parameters against the schema at runtime
31-
monochrome_logs // boolean: Do not use coloured log outputs
28+
version // boolean: Display version and exit
29+
validate_params // boolean: Boolean whether to validate parameters against the schema at runtime
30+
monochrome_logs // boolean: Do not use coloured log outputs
3231
nextflow_cli_args // array: List of positional nextflow CLI args
33-
outdir // string: The output directory where the results will be saved
34-
input // string: Path to input samplesheet
32+
outdir // string: The output directory where the results will be saved
33+
input // string: Path to input samplesheet
3534

3635
main:
3736

@@ -40,38 +39,36 @@ workflow PIPELINE_INITIALISATION {
4039
//
4140
// Print version and exit if required and dump pipeline parameters to JSON file
4241
//
43-
UTILS_NEXTFLOW_PIPELINE (
42+
UTILS_NEXTFLOW_PIPELINE(
4443
version,
4544
true,
4645
outdir,
47-
workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1
46+
workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1,
4847
)
4948

5049
//
5150
// Validate parameters and generate parameter summary to stdout
5251
//
53-
UTILS_NFSCHEMA_PLUGIN (
52+
UTILS_NFSCHEMA_PLUGIN(
5453
workflow,
5554
validate_params,
56-
null
55+
null,
5756
)
5857

5958
//
6059
// Check config provided to the pipeline
6160
//
62-
UTILS_NFCORE_PIPELINE (
61+
UTILS_NFCORE_PIPELINE(
6362
nextflow_cli_args
6463
)
6564

6665
//
6766
// Create channel from input file provided through params.input
6867
//
6968

70-
Channel
71-
.fromList(samplesheetToList(params.input, "${projectDir}/assets/schema_input.json"))
72-
.map {
73-
meta, fasta ->
74-
return [ meta, [ fasta ] ]
69+
Channel.fromList(samplesheetToList(params.input, "${projectDir}/assets/schema_input.json"))
70+
.map { meta, fasta ->
71+
return [meta, fasta]
7572
}
7673
.map { samplesheet ->
7774
validateInputSamplesheet(samplesheet)
@@ -80,7 +77,7 @@ workflow PIPELINE_INITIALISATION {
8077

8178
emit:
8279
samplesheet = ch_samplesheet
83-
versions = ch_versions
80+
versions = ch_versions
8481
}
8582

8683
/*
@@ -90,15 +87,14 @@ workflow PIPELINE_INITIALISATION {
9087
*/
9188

9289
workflow PIPELINE_COMPLETION {
93-
9490
take:
95-
email // string: email address
96-
email_on_fail // string: email address sent on pipeline failure
91+
email // string: email address
92+
email_on_fail // string: email address sent on pipeline failure
9793
plaintext_email // boolean: Send plain-text email instead of HTML
98-
outdir // path: Path to output directory where results will be published
94+
outdir // path: Path to output directory where results will be published
9995
monochrome_logs // boolean: Disable ANSI colour codes in log output
100-
hook_url // string: hook URL for notifications
101-
multiqc_report // string: Path to MultiQC report
96+
hook_url // string: hook URL for notifications
97+
multiqc_report // string: Path to MultiQC report
10298

10399
main:
104100
summary_params = paramsSummaryMap(workflow, parameters_schema: "nextflow_schema.json")
@@ -127,7 +123,7 @@ workflow PIPELINE_COMPLETION {
127123
}
128124

129125
workflow.onError {
130-
log.error "Pipeline failed. Please refer to troubleshooting docs: https://nf-co.re/docs/usage/troubleshooting"
126+
log.error("Pipeline failed. Please refer to troubleshooting docs: https://nf-co.re/docs/usage/troubleshooting")
131127
}
132128
}
133129

@@ -150,30 +146,30 @@ def validateInputSamplesheet(input) {
150146
//
151147
def toolCitationText() {
152148
def citation_text = [
153-
"Tools used in the workflow included:",
154-
"Nextflow (Di Tommaso et al. 2017),",
155-
"nf-core (Ewels et al. 2020),",
156-
"Bioconda (Grüning et al. 2018),",
157-
"BioContainers (da Veiga Leprevost et al. 2017),",
158-
"MultiQC (Ewels et al. 2016),",
159-
"SeqKit (Shen 2016),",
160-
"Anaconda (Anaconda Software Distribution 2016),",
161-
"Docker (Merkel 2014),",
162-
"Singularity (Kurtzer et al. 2017)",
163-
"."
164-
].join(' ').trim()
149+
"Tools used in the workflow included:",
150+
"Nextflow (Di Tommaso et al. 2017),",
151+
"nf-core (Ewels et al. 2020),",
152+
"Bioconda (Grüning et al. 2018),",
153+
"BioContainers (da Veiga Leprevost et al. 2017),",
154+
"MultiQC (Ewels et al. 2016),",
155+
"SeqKit (Shen 2016),",
156+
"Anaconda (Anaconda Software Distribution 2016),",
157+
"Docker (Merkel 2014),",
158+
"Singularity (Kurtzer et al. 2017)",
159+
".",
160+
].join(' ').trim()
165161

166162
return citation_text
167163
}
168164

169165
def toolBibliographyText() {
170166
def reference_text = [
171-
"<li>Ewels, P., Magnusson, M., Lundin, S., & Käller, M. (2016). MultiQC: summarize analysis results for multiple tools and samples in a single report. Bioinformatics , 32(19), 3047–3048. doi: /10.1093/bioinformatics/btw354</li>",
172-
"<li>Shen W, Le S, Li Y, Hu F (2016) SeqKit: A Cross-Platform and Ultrafast Toolkit for FASTA/Q File Manipulation. PLoS ONE 11(10): e0163962. doi: https://doi.org/10.1371/journal.pone.0163962</li>",
173-
"<li>Anaconda Software Distribution. Computer software. Vers. 2-2.4.0. Anaconda, Nov. 2016. Web.</li>",
174-
"<li>Merkel, D. (2014). Docker: lightweight linux containers for consistent development and deployment. Linux Journal, 2014(239), 2. doi: https://10.5555/2600239.2600241.</li>",
175-
"<li>Kurtzer GM, Sochat V, Bauer MW. Singularity: Scientific containers for mobility of compute. PLoS One. 2017 May 11;12(5):e0177459. doi: https://10.1371/journal.pone.0177459. eCollection 2017. PubMed PMID: 28494014; PubMed Central PMCID: PMC5426675.</li>"
176-
].join(' ').trim()
167+
"<li>Ewels, P., Magnusson, M., Lundin, S., & Käller, M. (2016). MultiQC: summarize analysis results for multiple tools and samples in a single report. Bioinformatics , 32(19), 3047–3048. doi: /10.1093/bioinformatics/btw354</li>",
168+
"<li>Shen W, Le S, Li Y, Hu F (2016) SeqKit: A Cross-Platform and Ultrafast Toolkit for FASTA/Q File Manipulation. PLoS ONE 11(10): e0163962. doi: https://doi.org/10.1371/journal.pone.0163962</li>",
169+
"<li>Anaconda Software Distribution. Computer software. Vers. 2-2.4.0. Anaconda, Nov. 2016. Web.</li>",
170+
"<li>Merkel, D. (2014). Docker: lightweight linux containers for consistent development and deployment. Linux Journal, 2014(239), 2. doi: https://10.5555/2600239.2600241.</li>",
171+
"<li>Kurtzer GM, Sochat V, Bauer MW. Singularity: Scientific containers for mobility of compute. PLoS One. 2017 May 11;12(5):e0177459. doi: https://10.1371/journal.pone.0177459. eCollection 2017. PubMed PMID: 28494014; PubMed Central PMCID: PMC5426675.</li>",
172+
].join(' ').trim()
177173

178174
return reference_text
179175
}
@@ -195,7 +191,10 @@ def methodsDescriptionText(mqc_methods_yaml) {
195191
temp_doi_ref += "(doi: <a href=\'https://doi.org/${doi_ref.replace("https://doi.org/", "").replace(" ", "")}\'>${doi_ref.replace("https://doi.org/", "").replace(" ", "")}</a>), "
196192
}
197193
meta["doi_text"] = temp_doi_ref.substring(0, temp_doi_ref.length() - 2)
198-
} else meta["doi_text"] = ""
194+
}
195+
else {
196+
meta["doi_text"] = ""
197+
}
199198
meta["nodoi_text"] = meta.manifest_map.doi ? "" : "<li>If available, make sure to update the text to include the Zenodo DOI of version of the pipeline used. </li>"
200199

201200
// Tool references
@@ -205,9 +204,8 @@ def methodsDescriptionText(mqc_methods_yaml) {
205204

206205
def methods_text = mqc_methods_yaml.text
207206

208-
def engine = new groovy.text.SimpleTemplateEngine()
207+
def engine = new groovy.text.SimpleTemplateEngine()
209208
def description_html = engine.createTemplate(methods_text).make(meta)
210209

211210
return description_html.toString()
212211
}
213-

0 commit comments

Comments
 (0)