Skip to content

Commit

Permalink
Fix large comment block headers so they don't cause phantom merge con… (
Browse files Browse the repository at this point in the history
#6755)

* Fix large comment block headers so they don't cause phantom merge conflicts

* Apply suggestions from code review

* fix color code

---------

Co-authored-by: Júlia Mir Pedrol <mirp.julia@gmail.com>
  • Loading branch information
jfy133 and mirpedrol authored Oct 9, 2024
1 parent c577278 commit 9d05360
Show file tree
Hide file tree
Showing 6 changed files with 190 additions and 176 deletions.
10 changes: 5 additions & 5 deletions modules/nf-core/ensemblvep/filtervep/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
========================================================================================
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nextflow config file for running tests
========================================================================================
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
params {
vep_cache_version = "112"
vep_genome = "WBcel235"
vep_species = "caenorhabditis_elegans"
vep_cache_version = "112"
vep_genome = "WBcel235"
vep_species = "caenorhabditis_elegans"
}
8 changes: 4 additions & 4 deletions modules/nf-core/ensemblvep/filtervep/tests/tab.gz.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
========================================================================================
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nextflow config file for running tests
========================================================================================
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

process {
Expand All @@ -13,12 +13,12 @@ process {
}

withName: ENSEMBLVEP_VEP {
ext.args = '--tab'
ext.args = '--tab'
ext.prefix = { "${meta.id}_vep" }
}

withName: ENSEMBLVEP_FILTERVEP {
ext.args = '--filter "Feature_type is Transcript"'
ext.args = '--filter "Feature_type is Transcript"'
ext.suffix = "tab"
}
}
6 changes: 3 additions & 3 deletions modules/nf-core/ensemblvep/filtervep/tests/vcf.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
========================================================================================
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nextflow config file for running tests
========================================================================================
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

process {
Expand All @@ -13,7 +13,7 @@ process {
}

withName: ENSEMBLVEP_VEP {
ext.args = '--vcf'
ext.args = '--vcf'
ext.prefix = { "${meta.id}_vep" }
}

Expand Down
46 changes: 22 additions & 24 deletions subworkflows/nf-core/utils_nextflow_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
//

/*
========================================================================================
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SUBWORKFLOW DEFINITION
========================================================================================
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

workflow UTILS_NEXTFLOW_PIPELINE {

take:
print_version // boolean: print version
dump_parameters // boolean: dump parameters
Expand All @@ -22,7 +21,7 @@ workflow UTILS_NEXTFLOW_PIPELINE {
// Print workflow version and exit on --version
//
if (print_version) {
log.info "${workflow.manifest.name} ${getWorkflowVersion()}"
log.info("${workflow.manifest.name} ${getWorkflowVersion()}")
System.exit(0)
}

Expand All @@ -45,9 +44,9 @@ workflow UTILS_NEXTFLOW_PIPELINE {
}

/*
========================================================================================
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FUNCTIONS
========================================================================================
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

//
Expand All @@ -72,11 +71,11 @@ def getWorkflowVersion() {
// Dump pipeline parameters to a JSON file
//
def dumpParametersToJSON(outdir) {
def timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')
def filename = "params_${timestamp}.json"
def temp_pf = new File(workflow.launchDir.toString(), ".${filename}")
def jsonStr = groovy.json.JsonOutput.toJson(params)
temp_pf.text = groovy.json.JsonOutput.prettyPrint(jsonStr)
def timestamp = new java.util.Date().format('yyyy-MM-dd_HH-mm-ss')
def filename = "params_${timestamp}.json"
def temp_pf = new File(workflow.launchDir.toString(), ".${filename}")
def jsonStr = groovy.json.JsonOutput.toJson(params)
temp_pf.text = groovy.json.JsonOutput.prettyPrint(jsonStr)

nextflow.extension.FilesEx.copyTo(temp_pf.toPath(), "${outdir}/pipeline_info/params_${timestamp}.json")
temp_pf.delete()
Expand All @@ -91,9 +90,14 @@ def checkCondaChannels() {
try {
def config = parser.load("conda config --show channels".execute().text)
channels = config.channels
} catch(NullPointerException | IOException e) {
log.warn "Could not verify conda channel configuration."
return
}
catch (NullPointerException e) {
log.warn("Could not verify conda channel configuration.")
return null
}
catch (IOException e) {
log.warn("Could not verify conda channel configuration.")
return null
}

// Check that all channels are present
Expand All @@ -106,19 +110,13 @@ def checkCondaChannels() {

required_channels_in_order.eachWithIndex { channel, index ->
if (index < required_channels_in_order.size() - 1) {
channel_priority_violation |= !(channels.indexOf(channel) < channels.indexOf(required_channels_in_order[index+1]))
channel_priority_violation |= !(channels.indexOf(channel) < channels.indexOf(required_channels_in_order[index + 1]))
}
}

if (channels_missing | channel_priority_violation) {
log.warn "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
" There is a problem with your Conda configuration!\n\n" +
" You will need to set-up the conda-forge and bioconda channels correctly.\n" +
" Please refer to https://bioconda.github.io/\n" +
" The observed channel order is \n" +
" ${channels}\n" +
" but the following channel order is required:\n" +
" ${required_channels_in_order}\n" +
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
log.warn(
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" + " There is a problem with your Conda configuration!\n\n" + " You will need to set-up the conda-forge and bioconda channels correctly.\n" + " Please refer to https://bioconda.github.io/\n" + " The observed channel order is \n" + " ${channels}\n" + " but the following channel order is required:\n" + " ${required_channels_in_order}\n" + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
)
}
}
Loading

0 comments on commit 9d05360

Please sign in to comment.