Skip to content

Commit 2a32479

Browse files
authored
Merge pull request #880 from nf-core/nf-core-template-merge-2.6
Important! Template update for nf-core/tools v2.6
2 parents 4721317 + 04cebb5 commit 2a32479

File tree

14 files changed

+242
-15
lines changed

14 files changed

+242
-15
lines changed

.github/workflows/awsfulltest.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ jobs:
3030
"aligner": "${{ matrix.aligner }}"
3131
}
3232
profiles: test_full,aws_tower
33+
- uses: actions/upload-artifact@v3
34+
with:
35+
name: Tower debug log file
36+
path: tower_action_*.log

.github/workflows/awstest.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@ jobs:
2323
"outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/rnaseq/results-test-${{ github.sha }}"
2424
}
2525
profiles: test,aws_tower
26+
- uses: actions/upload-artifact@v3
27+
with:
28+
name: Tower debug log file
29+
path: tower_action_*.log

CITATION.cff

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ authors:
1313
given-names: Johannes
1414
- family-names: Wilm
1515
given-names: Andreas
16-
- family-names: Ulysse Garcia
17-
given-names: Maxime
16+
- family-names: Garcia
17+
given-names: Maxime Ulysse
1818
- family-names: Di Tommaso
1919
given-names: Paolo
2020
- family-names: Nahnsen
@@ -39,8 +39,8 @@ prefered-citation:
3939
given-names: Johannes
4040
- family-names: Wilm
4141
given-names: Andreas
42-
- family-names: Ulysse Garcia
43-
given-names: Maxime
42+
- family-names: Garcia
43+
given-names: Maxime Ulysse
4444
- family-names: Di Tommaso
4545
given-names: Paolo
4646
- family-names: Nahnsen

assets/adaptivecard.json

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"type": "message",
3+
"attachments": [
4+
{
5+
"contentType": "application/vnd.microsoft.card.adaptive",
6+
"contentUrl": null,
7+
"content": {
8+
"\$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
9+
"msteams": {
10+
"width": "Full"
11+
},
12+
"type": "AdaptiveCard",
13+
"version": "1.2",
14+
"body": [
15+
{
16+
"type": "TextBlock",
17+
"size": "Large",
18+
"weight": "Bolder",
19+
"color": "<% if (success) { %>Good<% } else { %>Attention<%} %>",
20+
"text": "nf-core/rnaseq v${version} - ${runName}",
21+
"wrap": true
22+
},
23+
{
24+
"type": "TextBlock",
25+
"spacing": "None",
26+
"text": "Completed at ${dateComplete} (duration: ${duration})",
27+
"isSubtle": true,
28+
"wrap": true
29+
},
30+
{
31+
"type": "TextBlock",
32+
"text": "<% if (success) { %>Pipeline completed successfully!<% } else { %>Pipeline completed with errors. The full error message was: ${errorReport}.<% } %>",
33+
"wrap": true
34+
},
35+
{
36+
"type": "TextBlock",
37+
"text": "The command used to launch the workflow was as follows:",
38+
"wrap": true
39+
},
40+
{
41+
"type": "TextBlock",
42+
"text": "${commandLine}",
43+
"isSubtle": true,
44+
"wrap": true
45+
}
46+
],
47+
"actions": [
48+
{
49+
"type": "Action.ShowCard",
50+
"title": "Pipeline Configuration",
51+
"card": {
52+
"type": "AdaptiveCard",
53+
"\$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
54+
"body": [
55+
{
56+
"type": "FactSet",
57+
"facts": [<% out << summary.collect{ k,v -> "{\"title\": \"$k\", \"value\" : \"$v\"}"}.join(",\n") %>
58+
]
59+
}
60+
]
61+
}
62+
}
63+
]
64+
}
65+
}
66+
]
67+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
id: "nf-core-rnaseq-methods-description"
2+
description: "Suggested text and references to use when describing pipeline usage within the methods section of a publication."
3+
section_name: "nf-core/rnaseq Methods Description"
4+
section_href: "https://github.com/nf-core/rnaseq"
5+
plot_type: "html"
6+
## TODO nf-core: Update the HTML below to your prefered methods description, e.g. add publication citation for this pipeline
7+
## You inject any metadata in the Nextflow '${workflow}' object
8+
data: |
9+
<h4>Methods</h4>
10+
<p>Data was processed using nf-core/rnaseq v${workflow.manifest.version} ${doi_text} of the nf-core collection of workflows (<a href="https://doi.org/10.1038/s41587-020-0439-x">Ewels <em>et al.</em>, 2020</a>).</p>
11+
<p>The pipeline was executed with Nextflow v${workflow.nextflow.version} (<a href="https://doi.org/10.1038/nbt.3820">Di Tommaso <em>et al.</em>, 2017</a>) with the following command:</p>
12+
<pre><code>${workflow.commandLine}</code></pre>
13+
<h4>References</h4>
14+
<ul>
15+
<li>Di Tommaso, P., Chatzou, M., Floden, E. W., Barja, P. P., Palumbo, E., & Notredame, C. (2017). Nextflow enables reproducible computational workflows. Nature Biotechnology, 35(4), 316-319. <a href="https://doi.org/10.1038/nbt.3820">https://doi.org/10.1038/nbt.3820</a></li>
16+
<li>Ewels, P. A., Peltzer, A., Fillinger, S., Patel, H., Alneberg, J., Wilm, A., Garcia, M. U., Di Tommaso, P., & Nahnsen, S. (2020). The nf-core framework for community-curated bioinformatics pipelines. Nature Biotechnology, 38(3), 276-278. <a href="https://doi.org/10.1038/s41587-020-0439-x">https://doi.org/10.1038/s41587-020-0439-x</a></li>
17+
</ul>
18+
<div class="alert alert-info">
19+
<h5>Notes:</h5>
20+
<ul>
21+
${nodoi_text}
22+
<li>The command above does not include parameters contained in any configs or profiles that may have been used. Ensure the config file is also uploaded with your publication!</li>
23+
<li>You should also cite all software used within this run. Check the "Software Versions" of this report to get version information.</li>
24+
</ul>
25+
</div>

assets/multiqc_config.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ report_comment: >
33
analysis pipeline. For information about how to interpret these results, please see the
44
<a href="https://nf-co.re/rnaseq" target="_blank">documentation</a>.
55
report_section_order:
6-
software_versions:
6+
"nf-core-rnaseq-methods-description":
77
order: -1000
8-
nf-core-rnaseq-summary:
8+
software_versions:
99
order: -1001
10+
"nf-core-rnaseq-summary":
11+
order: -1002
1012

1113
export_plots: true
1214

docs/usage.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,14 @@ See the main [Nextflow documentation](https://www.nextflow.io/docs/latest/config
296296
297297
If you have any questions or issues please send us a message on [Slack](https://nf-co.re/join/slack) on the [`#configs` channel](https://nfcore.slack.com/channels/configs).
298298
299+
## Azure Resource Requests
300+
301+
To be used with the `azurebatch` profile by specifying the `-profile azurebatch`.
302+
We recommend providing a compute `params.vm_type` of `Standard_D16_v3` VMs by default but these options can be changed if required.
303+
304+
Note that the choice of VM size depends on your quota and the overall workload during the analysis.
305+
For a thorough list, please refer the [Azure Sizes for virtual machines in Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/sizes).
306+
299307
## Running in the background
300308
301309
Nextflow handles job submissions and supervises the running jobs. The Nextflow process must run until the pipeline is finished.

lib/NfcoreTemplate.groovy

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,61 @@ class NfcoreTemplate {
150150
output_tf.withWriter { w -> w << email_txt }
151151
}
152152

153+
//
154+
// Construct and send adaptive card
155+
// https://adaptivecards.io
156+
//
157+
public static void adaptivecard(workflow, params, summary_params, projectDir, log) {
158+
def hook_url = params.hook_url
159+
160+
def summary = [:]
161+
for (group in summary_params.keySet()) {
162+
summary << summary_params[group]
163+
}
164+
165+
def misc_fields = [:]
166+
misc_fields['start'] = workflow.start
167+
misc_fields['complete'] = workflow.complete
168+
misc_fields['scriptfile'] = workflow.scriptFile
169+
misc_fields['scriptid'] = workflow.scriptId
170+
if (workflow.repository) misc_fields['repository'] = workflow.repository
171+
if (workflow.commitId) misc_fields['commitid'] = workflow.commitId
172+
if (workflow.revision) misc_fields['revision'] = workflow.revision
173+
misc_fields['nxf_version'] = workflow.nextflow.version
174+
misc_fields['nxf_build'] = workflow.nextflow.build
175+
misc_fields['nxf_timestamp'] = workflow.nextflow.timestamp
176+
177+
def msg_fields = [:]
178+
msg_fields['version'] = workflow.manifest.version
179+
msg_fields['runName'] = workflow.runName
180+
msg_fields['success'] = workflow.success
181+
msg_fields['dateComplete'] = workflow.complete
182+
msg_fields['duration'] = workflow.duration
183+
msg_fields['exitStatus'] = workflow.exitStatus
184+
msg_fields['errorMessage'] = (workflow.errorMessage ?: 'None')
185+
msg_fields['errorReport'] = (workflow.errorReport ?: 'None')
186+
msg_fields['commandLine'] = workflow.commandLine
187+
msg_fields['projectDir'] = workflow.projectDir
188+
msg_fields['summary'] = summary << misc_fields
189+
190+
// Render the JSON template
191+
def engine = new groovy.text.GStringTemplateEngine()
192+
def hf = new File("$projectDir/assets/adaptivecard.json")
193+
def json_template = engine.createTemplate(hf).make(msg_fields)
194+
def json_message = json_template.toString()
195+
196+
// POST
197+
def post = new URL(hook_url).openConnection();
198+
post.setRequestMethod("POST")
199+
post.setDoOutput(true)
200+
post.setRequestProperty("Content-Type", "application/json")
201+
post.getOutputStream().write(json_message.getBytes("UTF-8"));
202+
def postRC = post.getResponseCode();
203+
if (! postRC.equals(200)) {
204+
log.warn(post.getErrorStream().getText());
205+
}
206+
}
207+
153208
//
154209
// Print pipeline summary on completion
155210
//

lib/Utils.groovy

100755100644
Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,26 @@ class Utils {
2121
}
2222

2323
// Check that all channels are present
24-
def required_channels = ['conda-forge', 'bioconda', 'defaults']
25-
def conda_check_failed = !required_channels.every { ch -> ch in channels }
24+
// This channel list is ordered by required channel priority.
25+
def required_channels_in_order = ['conda-forge', 'bioconda', 'defaults']
26+
def channels_missing = ((required_channels_in_order as Set) - (channels as Set)) as Boolean
2627

2728
// Check that they are in the right order
28-
conda_check_failed |= !(channels.indexOf('conda-forge') < channels.indexOf('bioconda'))
29-
conda_check_failed |= !(channels.indexOf('bioconda') < channels.indexOf('defaults'))
29+
def channel_priority_violation = false
30+
def n = required_channels_in_order.size()
31+
for (int i = 0; i < n - 1; i++) {
32+
channel_priority_violation |= !(channels.indexOf(required_channels_in_order[i]) < channels.indexOf(required_channels_in_order[i+1]))
33+
}
3034

31-
if (conda_check_failed) {
35+
if (channels_missing | channel_priority_violation) {
3236
log.warn "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
3337
" There is a problem with your Conda configuration!\n\n" +
3438
" You will need to set-up the conda-forge and bioconda channels correctly.\n" +
35-
" Please refer to https://bioconda.github.io/user/install.html#set-up-channels\n" +
36-
" NB: The order of the channels matters!\n" +
39+
" Please refer to https://bioconda.github.io/\n" +
40+
" The observed channel order is \n" +
41+
" ${channels}\n" +
42+
" but the following channel order is required:\n" +
43+
" ${required_channels_in_order}\n" +
3744
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
3845
}
3946
}

lib/WorkflowRnaseq.groovy

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// This file holds several functions specific to the workflow/rnaseq.nf in the nf-core/rnaseq pipeline
33
//
44

5+
import groovy.text.SimpleTemplateEngine
6+
57
class WorkflowRnaseq {
68

79
//
@@ -250,6 +252,23 @@ class WorkflowRnaseq {
250252
yaml_file_text += "data: |\n"
251253
yaml_file_text += "${summary_section}"
252254
return yaml_file_text
255+
}
256+
257+
public static String methodsDescriptionText(run_workflow, mqc_methods_yaml) {
258+
// Convert to a named map so can be used as with familar NXF ${workflow} variable syntax in the MultiQC YML file
259+
def meta = [:]
260+
meta.workflow = run_workflow.toMap()
261+
meta["manifest_map"] = run_workflow.manifest.toMap()
262+
263+
meta["doi_text"] = meta.manifest_map.doi ? "(doi: <a href=\'https://doi.org/${meta.manifest_map.doi}\'>${meta.manifest_map.doi}</a>)" : ""
264+
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>"
265+
266+
def methods_text = mqc_methods_yaml.text
267+
268+
def engine = new SimpleTemplateEngine()
269+
def description_html = engine.createTemplate(methods_text).make(meta)
270+
271+
return description_html
253272
}//
254273
// Exit pipeline if incorrect --genome key provided
255274
//

0 commit comments

Comments
 (0)