Skip to content
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

Remove lib directory and replace with atomic subworkflows #213

Merged
merged 8 commits into from
Oct 11, 2023

Conversation

drpatelh
Copy link
Member

No description provided.

@github-actions
Copy link

github-actions bot commented Oct 11, 2023

nf-core lint overall result: Failed ❌

Posted for pipeline commit 2f68d1e

+| ✅ 134 tests passed       |+
#| ❔  13 tests were ignored |#
!| ❗   2 tests had warnings |!
-| ❌   4 tests failed       |-

❌ Test failures:

  • files_exist - File not found: lib/nfcore_external_java_deps.jar
  • files_exist - File not found: lib/NfcoreTemplate.groovy
  • files_exist - File not found: lib/Utils.groovy
  • files_exist - File not found: lib/WorkflowMain.groovy

❗ Test warnings:

  • files_exist - File not found: assets/multiqc_config.yml
  • pipeline_todos - TODO string in methods_description_template.yml: #Update the HTML below to your preferred methods description, e.g. add publication citation for this pipeline

❔ Tests ignored:

  • files_exist - File is ignored: .github/workflows/awsfulltest.yml
  • files_exist - File is ignored: .github/workflows/awstest.yml
  • files_exist - File is ignored: conf/igenomes.config
  • files_exist - File is ignored: conf/modules.config
  • files_exist - File is ignored: lib/WorkflowFetchngs.groovy
  • files_unchanged - File ignored due to lint config: .gitattributes
  • files_unchanged - File ignored due to lint config: assets/sendmail_template.txt
  • files_unchanged - File does not exist: lib/nfcore_external_java_deps.jar
  • files_unchanged - File ignored due to lint config: lib/NfcoreTemplate.groovy
  • files_unchanged - File ignored due to lint config: .gitignore or .prettierignore or pyproject.toml
  • actions_ci - actions_ci
  • actions_awstest - 'awstest.yml' workflow not found: /home/runner/work/fetchngs/fetchngs/.github/workflows/awstest.yml
  • multiqc_config - 'assets/multiqc_config.yml' not found

✅ Tests passed:

Run details

  • nf-core/tools version 2.10
  • Run at 2023-10-11 11:28:12

Comment on lines +60 to +61
include { PIPELINE_INITIALISATION } from './subworkflows/local/nf_core_fetchngs_utils'
include { PIPELINE_COMPLETION } from './subworkflows/local/nf_core_fetchngs_utils'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include statements should be near the top in one consistent place (i.e. like other programming languages).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'll fix it later

========================================================================================
*/

workflow NEXTFLOW_PIPELINE_UTILS {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better name than auxiliary 👍

Comment on lines +74 to +84
def dumpParametersToJSON(output_directory) {
def output_d = new File("${output_directory}/pipeline_info/")
if (!output_d.exists()) {
output_d.mkdirs()
}

def timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')
def output_pf = new File(output_d, "params_${timestamp}.json")
def jsonStr = JsonOutput.toJson(params)
output_pf.text = JsonOutput.prettyPrint(jsonStr)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about parameterising the output path directly rather than trying to create a new file with a fixed name:

!! UNTESTED !!

Suggested change
def dumpParametersToJSON(output_directory) {
def output_d = new File("${output_directory}/pipeline_info/")
if (!output_d.exists()) {
output_d.mkdirs()
}
def timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')
def output_pf = new File(output_d, "params_${timestamp}.json")
def jsonStr = JsonOutput.toJson(params)
output_pf.text = JsonOutput.prettyPrint(jsonStr)
}
def dumpParametersToJSON(output) {
def output_pf = new File(output)
def output_d = output.getParent()
if (!output_d.exists()) {
output_d.mkdirs()
}
def timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')
def jsonStr = JsonOutput.toJson(params)
output_pf.text = JsonOutput.prettyPrint(jsonStr)
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You would then need to use

def outfile = ${output_directory}/pipeline_info/params_${timestamp}.json
dumpParametersToJSON(outfile)

Comment on lines +29 to +48
NEXTFLOW_PIPELINE_UTILS (
params.version,
true,
params.outdir,
workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1
)

//
// Validate parameters and generate parameter summary to stdout
//
def pre_help_text = nfCoreLogo(getWorkflowVersion())
def post_help_text = '\n' + workflowCitation() + '\n' + dashedLine()
def String workflow_command = "nextflow run ${workflow.manifest.name} -profile <docker/singularity/.../institute> --input ids.csv --outdir <OUTDIR>"
NF_VALIDATION_PLUGIN_UTILS (
params.help,
workflow_command,
pre_help_text,
post_help_text,
params.validate_params
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like there's a lot going on here, it's difficult for my small brain to follow. Can we simplify the interface at all?

Comment on lines +114 to +130
workflow.onComplete {
if (email || email_on_fail) {
completionEmail(summary_params)
}

completionSummary()

if (hook_url) {
imNotification(summary_params)
}

if (input_type == 'sra') {
sraCurateSamplesheetWarn()
} else if (input_type == 'synapse') {
synapseCurateSamplesheetWarn()
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A controversial take, but we could move this to nextflow.config...(see the note at the end): https://www.nextflow.io/docs/edge/metadata.html#decoupling-metadata

include { CUSTOM_DUMPSOFTWAREVERSIONS } from '../../../modules/nf-core/custom/dumpsoftwareversions'
include { NEXTFLOW_PIPELINE_UTILS; getWorkflowVersion } from '../nextflow_pipeline_utils'
include { NF_VALIDATION_PLUGIN_UTILS } from '../nf_validation_plugin_utils'
include { NF_CORE_PIPELINE_UTILS; workflowCitation; nfCoreLogo; dashedLine; completionEmail; completionSummary; imNotification } from '../nf_core_pipeline_utils'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I like the mixing of functions and subworkflows in the same include statement. Since NF_CORE_PIPELINE_UTILS just runs the check Conda function, why not import that directly and use it? Simpler, easier to understand. We can always wrap it back up later.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreeing with @adamrtalbot on that, I'd rather we have each on a single line

Comment on lines +11 to +16
workflow NF_CORE_PIPELINE_UTILS {

main:
checkConfigProvided()

}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels a bit superfluous.

@maxulysse maxulysse merged commit 42e2814 into nf-core:refactor Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants