-
Notifications
You must be signed in to change notification settings - Fork 1k
Add new component: deeptools/bamcompare #11572
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
oliverdrechsel
wants to merge
10
commits into
nf-core:master
Choose a base branch
from
oliverdrechsel:deeptools_bamcompare
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
531ef93
Add new component: deeptools/bamcompare
oliverdrechsel dbc6d48
Update modules/nf-core/deeptools/bamcompare/meta.yml
oliverdrechsel 5f1f8cf
Update modules/nf-core/deeptools/bamcompare/meta.yml
oliverdrechsel 0f50b0b
Update modules/nf-core/deeptools/bamcompare/meta.yml
oliverdrechsel 8684b7d
Update modules/nf-core/deeptools/bamcompare/meta.yml
oliverdrechsel 3572766
Update modules/nf-core/deeptools/bamcompare/meta.yml
oliverdrechsel 013bd15
Update modules/nf-core/deeptools/bamcompare/meta.yml
oliverdrechsel 485d722
Update modules/nf-core/deeptools/bamcompare/meta.yml
oliverdrechsel 89f575c
Update modules/nf-core/deeptools/bamcompare/main.nf
oliverdrechsel 4a33fb6
Update modules/nf-core/deeptools/bamcompare/main.nf
oliverdrechsel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| channels: | ||
| - conda-forge | ||
| - bioconda | ||
| dependencies: | ||
| - bioconda::deeptools=3.5.6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| // This module was written employing Seqera AI (https://seqera.io/ask-ai/chat-v2) | ||
| process DEEPTOOLS_BAMCOMPARE { | ||
| tag "$meta.id" | ||
| label 'process_medium' | ||
|
|
||
| conda "${moduleDir}/environment.yml" | ||
| container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
| 'https://depot.galaxyproject.org/singularity/deeptools:3.5.6--pyhdfd78af_0' : | ||
| 'quay.io/biocontainers/deeptools:3.5.6--pyhdfd78af_0' }" | ||
|
|
||
| input: | ||
| tuple val(meta), path(bam1), path(bai1), path(bam2), path(bai2) | ||
|
|
||
| output: | ||
| tuple val(meta), path("*.bigWig") , emit: bigwig , optional: true | ||
| tuple val(meta), path("*.bedgraph"), emit: bedgraph, optional: true | ||
| tuple val("${task.process}"), val('deeptools'), eval('bamCompare --version | sed "s/bamCompare //g"') , emit: versions_deeptools, topic: versions | ||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
|
|
||
| // Determine output format from args or default to bigwig | ||
| def format = args.contains('--outFileFormat bedgraph') ? 'bedgraph' : 'bigWig' | ||
| def output_file = "${prefix}.${format}" | ||
|
|
||
| """ | ||
| bamCompare \\ | ||
| --bamfile1 $bam1 \\ | ||
| --bamfile2 $bam2 \\ | ||
| --outFileName $output_file \\ | ||
| --numberOfProcessors $task.cpus \\ | ||
| $args | ||
| """ | ||
|
|
||
| stub: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| def format = args.contains('--outFileFormat bedgraph') ? 'bedgraph' : 'bigWig' | ||
| def output_file = "${prefix}.${format}" | ||
|
|
||
| """ | ||
| touch $output_file | ||
| """ | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| name: "deeptools_bamcompare" | ||
| description: Compares two BAM files based on the number of mapped reads and | ||
| generates a bigWig or bedGraph file with the log2 ratio, ratio, difference or | ||
| other operations. | ||
| keywords: | ||
| - bam | ||
| - bigwig | ||
| - bedgraph | ||
| - normalization | ||
| - comparison | ||
| tools: | ||
| - deeptools: | ||
| description: A set of user-friendly tools for normalization and | ||
| visualization of deep-sequencing data | ||
| homepage: https://deeptools.readthedocs.io/en/latest/ | ||
| documentation: https://deeptools.readthedocs.io/en/latest/content/tools/bamCompare.html | ||
| tool_dev_url: https://github.com/deeptools/deepTools | ||
| doi: "10.1093/nar/gkw257" | ||
| licence: | ||
| - "GPL v3" | ||
| identifier: biotools:deeptools | ||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'test' ] | ||
| - bam1: | ||
| type: file | ||
| description: Sorted BAM file 1 (usually treatment) | ||
| pattern: "*.{bam}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_2572" # BAM | ||
| - bai1: | ||
| type: file | ||
| description: BAM index file for BAM file 1 | ||
| pattern: "*.{bai}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3327" # BAI | ||
| - bam2: | ||
| type: file | ||
| description: Sorted BAM file 2 (usually control) | ||
| pattern: "*.{bam}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_2572" # BAM | ||
| - bai2: | ||
| type: file | ||
| description: BAM index file for BAM file 2 | ||
| pattern: "*.{bai}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3327" # BAI | ||
| output: | ||
| bigwig: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'test' ] | ||
| - "*.bigWig": | ||
| type: file | ||
| description: BigWig coverage file of comparison results | ||
| pattern: "*.{bigWig}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3006" # bigWig | ||
| bedgraph: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'test' ] | ||
| - "*.bedgraph": | ||
| type: file | ||
| description: BedGraph coverage file of comparison results | ||
| pattern: "*.{bedgraph}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3583" # BedGraph | ||
| versions_deeptools: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The name of the process | ||
| - deeptools: | ||
| type: string | ||
| description: The name of the tool | ||
| - bamCompare --version | sed "s/bamCompare //g": | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
| topics: | ||
| versions: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The name of the process | ||
| - deeptools: | ||
| type: string | ||
| description: The name of the tool | ||
| - bamCompare --version | sed "s/bamCompare //g": | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
| authors: | ||
| - "@seqeraai" | ||
| - "@oliverdrechsel" | ||
| maintainers: | ||
| - "@oliverdrechsel" | ||
103 changes: 103 additions & 0 deletions
103
modules/nf-core/deeptools/bamcompare/tests/main.nf.test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process DEEPTOOLS_BAMCOMPARE" | ||
| script "../main.nf" | ||
| process "DEEPTOOLS_BAMCOMPARE" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "deeptools" | ||
| tag "deeptools/bamcompare" | ||
|
|
||
| config "./nextflow.config" | ||
|
|
||
| test("sarscov2 - bam - bigwig") { | ||
|
|
||
| when { | ||
| params { | ||
| module_args = '' | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test' ], | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam.bai', checkIfExists: true) | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(process.out).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("sarscov2 - bam - bedgraph") { | ||
|
|
||
| when { | ||
| params { | ||
| module_args = '--outFileFormat bedgraph --binSize 10' | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test' ], | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam.bai', checkIfExists: true) | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| process.out.bedgraph, | ||
| process.out.versions | ||
| ).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("sarscov2 - bam - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| params { | ||
| module_args = '' | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test' ], | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam.bai', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.sorted.bam.bai', checkIfExists: true) | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(process.out).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| } |
114 changes: 114 additions & 0 deletions
114
modules/nf-core/deeptools/bamcompare/tests/main.nf.test.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| { | ||
| "sarscov2 - bam - stub": { | ||
| "content": [ | ||
| { | ||
| "0": [ | ||
| [ | ||
| { | ||
| "id": "test" | ||
| }, | ||
| "test.bigWig:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
| ] | ||
| ], | ||
| "1": [ | ||
|
|
||
| ], | ||
| "2": [ | ||
| [ | ||
| "DEEPTOOLS_BAMCOMPARE", | ||
| "deeptools", | ||
| "3.5.6" | ||
| ] | ||
| ], | ||
| "bedgraph": [ | ||
|
|
||
| ], | ||
| "bigwig": [ | ||
| [ | ||
| { | ||
| "id": "test" | ||
| }, | ||
| "test.bigWig:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
| ] | ||
| ], | ||
| "versions_deeptools": [ | ||
| [ | ||
| "DEEPTOOLS_BAMCOMPARE", | ||
| "deeptools", | ||
| "3.5.6" | ||
| ] | ||
| ] | ||
| } | ||
| ], | ||
| "timestamp": "2026-05-07T12:55:58.917296921", | ||
| "meta": { | ||
| "nf-test": "0.9.5", | ||
| "nextflow": "25.10.4" | ||
| } | ||
| }, | ||
| "sarscov2 - bam - bedgraph": { | ||
| "content": [ | ||
| [ | ||
| [ | ||
| { | ||
| "id": "test" | ||
| }, | ||
| "test.bedgraph:md5,63141eeba79301006699cdee4abf0ff1" | ||
| ] | ||
| ], | ||
| null | ||
| ], | ||
| "timestamp": "2026-05-07T12:55:08.239773859", | ||
| "meta": { | ||
| "nf-test": "0.9.5", | ||
| "nextflow": "25.10.4" | ||
| } | ||
| }, | ||
| "sarscov2 - bam - bigwig": { | ||
| "content": [ | ||
| { | ||
| "0": [ | ||
| [ | ||
| { | ||
| "id": "test" | ||
| }, | ||
| "test.bigWig:md5,c59753155328f9b0dc56746cca440d90" | ||
| ] | ||
| ], | ||
| "1": [ | ||
|
|
||
| ], | ||
| "2": [ | ||
| [ | ||
| "DEEPTOOLS_BAMCOMPARE", | ||
| "deeptools", | ||
| "3.5.6" | ||
| ] | ||
| ], | ||
| "bedgraph": [ | ||
|
|
||
| ], | ||
| "bigwig": [ | ||
| [ | ||
| { | ||
| "id": "test" | ||
| }, | ||
| "test.bigWig:md5,c59753155328f9b0dc56746cca440d90" | ||
| ] | ||
| ], | ||
| "versions_deeptools": [ | ||
| [ | ||
| "DEEPTOOLS_BAMCOMPARE", | ||
| "deeptools", | ||
| "3.5.6" | ||
| ] | ||
| ] | ||
| } | ||
| ], | ||
| "timestamp": "2026-05-07T12:54:16.387360777", | ||
| "meta": { | ||
| "nf-test": "0.9.5", | ||
| "nextflow": "25.10.4" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| process { | ||
| withName: 'DEEPTOOLS_BAMCOMPARE' { | ||
| ext.args = params.module_args ?: '' | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| deeptools/bamcompare: | ||
| - "modules/nf-core/deeptools/bamcompare/**" | ||
| - "tests/modules/nf-core/deeptools/bamcompare/**" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, we only allow for valid GitHub users by the moment, if you want you could raise it on slack to see what others think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.
I asked the Slack community and would wait a little to collect opinions.
I'd like to credit the AI somehow. The format is less important to me.