8000 Linting of patched module fails · Issue #3540 · nf-core/tools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Linting of patched module fails #3540

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

Open
mashehu opened this issue Apr 17, 2025 · 1 comment
Open

Linting of patched module fails #3540

mashehu opened this issue Apr 17, 2025 · 1 comment
Labels
bug Something isn't working linting

Comments

@mashehu
Copy link
Contributor
mashehu commented Apr 17, 2025

Description of the bug

Adding an additional input to deeptools/bamcoverage (in meta.yml and main.nf) and running nf-core modules patch breaks linting.
My hunch is that the patch is not applied correctly, because if I remove the .diff file, linting is only complaining about the differences to the remote file, not any missing inputs.

Command used and terminal output

-core modules lint deeptools/bamcoverage
]

                                          ,--./,-.
          ___     __   __   __   ___     /,-._.--~\
    |\ | |__  __ /  ` /  \ |__) |__         }  {
    | \| |       \__, \__/ |  \ |___     \`-._,-`-,
                                          `._,._,'

    nf-core/tools version 3.3.0.dev0 - https://nf-co.re


INFO     Linting pipeline: '.'
INFO     Linting module: 'deeptools/bamcoverage'

╭─ [!] 2 Module Test Warnings ──────────────────────────────────────────────────────────────────────────────────╮
│                        ╷                                          ╷                                           │
│ Module name            │ File path                                │ Test message                              │
│╶───────────────────────┼──────────────────────────────────────────┼──────────────────────────────────────────╴│
│ deeptools/bamcoverage  │ modules/nf-core/deeptools/bamcoverage/m… │ Conda update: bioconda::deeptools 3.5.5   │
│                        │                                          │ -> 3.5.6                                  │
│ deeptools/bamcoverage  │ modules/nf-core/deeptools/bamcoverage/m… │ Conda update: bioconda::samtools 1.20 ->  │
│                        │                                          │ 1.21                                      │
│                        ╵                                          ╵                                           │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ [✗] 2 Module Tests Failed ───────────────────────────────────────────────────────────────────────────────────╮
│                        ╷                                          ╷                                           │
│ Module name            │ File path                                │ Test message                              │
│╶───────────────────────┼──────────────────────────────────────────┼──────────────────────────────────────────╴│
│ deeptools/bamcoverage  │ modules/nf-core/deeptools/bamcoverage/m… │ Local copy of module does not match       │
│                        │                                          │ remote                                    │
│ deeptools/bamcoverage  │ modules/nf-core/deeptools/bamcoverage/m… │ Module meta.yml does not match main.nf.   │
│                        │                                          │ Inputs should contain: [['meta', 'input', │
│                        │                                          │ 'input_index'], ['fasta'], ['fasta_fai'], │
│                        │                                          │ ['blacklist']] Run nf-core modules lint   │
│                        │                                          │ --fix to update the meta.yml file.        │
│                        ╵                                          ╵                                           │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭───────────────────────╮

with the following diff file:

Changes in component 'nf-core/deeptools/bamcoverage'
'modules/nf-core/deeptools/bamcoverage/environment.yml' is unchanged
Changes in 'deeptools/bamcoverage/meta.yml':
--- modules/nf-core/deeptools/bamcoverage/meta.yml
+++ modules/nf-core/deeptools/bamcoverage/meta.yml
@@ -38,6 +38,9 @@
         type: file
         description: Index of the reference file (optional, but recommended)
         pattern: "*.{fai}"
+  - - blacklist:
+        type: file
+        description: Blacklist file
 output:
   - bigwig:
       - meta:

Changes in 'deeptools/bamcoverage/main.nf':
--- modules/nf-core/deeptools/bamcoverage/main.nf
+++ modules/nf-core/deeptools/bamcoverage/main.nf
@@ -1,6 +1,6 @@
 process DEEPTOOLS_BAMCOVERAGE {
     tag "$meta.id"
-    label 'process_low'
+    label 'process_medium'
 
     conda "${moduleDir}/environment.yml"
     container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
@@ -11,6 +11,7 @@
     tuple val(meta), path(input), path(input_index)
     path(fasta)
     path(fasta_fai)
+    path(blacklist)
 
     output:
     tuple val(meta), path("*.bigWig")   , emit: bigwig, optional: true
@@ -24,6 +25,7 @@
     def args      = task.ext.args ?: ''
     def prefix    = task.ext.prefix ?: "${meta.id}"
     def extension = args.contains("--outFileFormat bedgraph") || args.contains("-of bedgraph") ? "bedgraph" : "bigWig"
+    def blacklist_params = blacklist ? "--blackListFileName    st}" : ""
 
     // cram_input is currently not working with deeptools
     // therefore it's required to convert cram to bam first
@@ -39,6 +41,7 @@
         bamCoverage \\
             --bam $input_out \\
             $args \\
+            $blacklist_params \\
             --numberOfProcessors ${task.cpus} \\
             --outFileName ${prefix}.${extension}
 
@@ -54,6 +57,7 @@
         bamCoverage \\
             --bam $input_out \\
             $args \\
+            $blacklist_params \\
             --numberOfProcessors ${task.cpus} \\
             --outFileName ${prefix}.${extension}
 

'modules/nf-core/deeptools/bamcoverage/tests/main.nf.test.snap' is unchanged
'modules/nf-core/deeptools/bamcoverage/tests/main.nf.test' is unchanged
************************************************************

System information

No response

@mashehu mashehu added bug Something isn't working linting labels Apr 17, 2025
@awgymer
Copy link
Contributor
awgymer commented Apr 23, 2025
# Check if we have a patch file, get original file in that case
meta_yaml_content = read_meta_yml(module_lint_object, module)

It seems like for the meta_yml lint test we actually explicitly seek the un-patched content. The issue is that then when a check on the channels from the main.nf is done this uses the code in the patched file (logic is in the nfcore_component.py)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working linting
Projects
None yet
Development

No branches or pull requests

2 participants
0