-
Notifications
You must be signed in to change notification settings - Fork 941
adding homer merge peaks, and a peakcalling workflow #9172
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
cmatKhan
wants to merge
2
commits into
nf-core:master
Choose a base branch
from
cmatKhan:homer_peakcalling
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 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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,7 @@ | ||
| --- | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json | ||
| channels: | ||
| - conda-forge | ||
| - bioconda | ||
| dependencies: | ||
| - "bioconda::homer=5.1" |
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,47 @@ | ||
| process HOMER_MERGEPEAKS { | ||
| tag "$meta.id" | ||
| label 'process_single' | ||
|
|
||
| conda "${moduleDir}/environment.yml" | ||
| container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
| 'oras://community.wave.seqera.io/library/homer:5.1--586e112615c26ca1': | ||
| 'community.wave.seqera.io/library/homer:5.1--851c883b9d1473f9' }" | ||
|
|
||
| input: | ||
| tuple val(meta), path(peaks) // peaks can be a list of peak files | ||
|
|
||
| output: | ||
| tuple val(meta), path("*.txt"), emit: txt | ||
| path "versions.yml" , emit: versions | ||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" + "_merged_peaks" | ||
| def peak_files = peaks instanceof List ? peaks.join(' ') : peaks | ||
| """ | ||
| mergePeaks \\ | ||
| $args \\ | ||
| -prefix ${prefix} \\ | ||
| $peak_files \\ | ||
| > ${prefix}.txt | ||
|
|
||
| cat <<-END_VERSIONS > versions.yml | ||
| "${task.process}": | ||
| homer: \$(mergePeaks 2>&1 | grep -i "version" | sed 's/.*version //i' || echo "4.11") | ||
| END_VERSIONS | ||
| """ | ||
|
|
||
| stub: | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| """ | ||
| touch ${prefix}.txt | ||
|
|
||
| cat <<-END_VERSIONS > versions.yml | ||
| "${task.process}": | ||
| homer: 4.11 | ||
| END_VERSIONS | ||
| """ | ||
| } | ||
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,55 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
| name: "homer_mergepeaks" | ||
| description: Merge peak files from multiple experiments or replicates into a unified peak set | ||
| keywords: | ||
| - peaks | ||
| - merge | ||
| - chipseq | ||
| - chipexo | ||
| - consensus | ||
| tools: | ||
| - homer: | ||
| description: | | ||
| HOMER (Hypergeometric Optimization of Motif EnRichment) is a suite of tools for Motif Discovery and next-gen sequencing analysis. | ||
| homepage: "http://homer.ucsd.edu/homer/index.html" | ||
| documentation: "http://homer.ucsd.edu/homer/" | ||
| tool_dev_url: "http://homer.ucsd.edu/homer/ngs/peaks.html" | ||
| doi: 10.1016/j.molcel.2010.05.004. | ||
| licence: ["GPL-3.0-or-later"] | ||
| identifier: biotools:homer | ||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'merged_peaks' ] | ||
| - peaks: | ||
| type: file | ||
| description: Peak files from HOMER findPeaks in HOMER peak format (*.txt). Can be a single file or list of files. | ||
| pattern: "*.txt" | ||
|
|
||
| output: | ||
| txt: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'merged_peaks' ] | ||
| - "*.txt": | ||
| type: file | ||
| description: Merged peak file in HOMER peak format | ||
| pattern: "*.txt" | ||
| ontologies: | ||
| - edam: https://bioportal.bioontology.org/ontologies/EDAM?p=classes&conceptid=format_3475 # tsv | ||
| versions: | ||
| - versions.yml: | ||
| type: file | ||
| description: File containing software versions | ||
| pattern: "versions.yml" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_3750 # YAML | ||
|
|
||
| authors: | ||
| - "@cmatKhan" | ||
| maintainers: | ||
| - "@cmatKhan" |
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,124 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process HOMER_MERGEPEAKS" | ||
| script "../main.nf" | ||
| process "HOMER_MERGEPEAKS" | ||
| config "./nextflow.config" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "homer" | ||
| tag "homer/mergepeaks" | ||
| tag "homer/findpeaks" | ||
| tag "homer/maketagdirectory" | ||
|
|
||
| setup { | ||
| run("HOMER_MAKETAGDIRECTORY", alias: "MAKETAGDIR_SAMPLE1") { | ||
| script "../../maketagdirectory/main.nf" | ||
| config "../../maketagdirectory/tests/bed.config" | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'sample1' ], | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) | ||
| ] | ||
| input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| run("HOMER_MAKETAGDIRECTORY", alias: "MAKETAGDIR_SAMPLE2") { | ||
| script "../../maketagdirectory/main.nf" | ||
| config "../../maketagdirectory/tests/bed.config" | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'sample2' ], | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test2.bed', checkIfExists: true) | ||
| ] | ||
| input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| run("HOMER_FINDPEAKS", alias: "FINDPEAKS_SAMPLE1") { | ||
| script "../../findpeaks/main.nf" | ||
| config "./nextflow.config" | ||
| process { | ||
| """ | ||
| input[0] = MAKETAGDIR_SAMPLE1.out.tagdir | ||
| input[1] = [] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| run("HOMER_FINDPEAKS", alias: "FINDPEAKS_SAMPLE2") { | ||
| script "../../findpeaks/main.nf" | ||
| config "./nextflow.config" | ||
| process { | ||
| """ | ||
| input[0] = MAKETAGDIR_SAMPLE2.out.tagdir | ||
| input[1] = [] | ||
| """ | ||
| } | ||
| } | ||
| } | ||
|
|
||
| test("sarscov2 - bed - merge two peak files") { | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| peaks = Channel.empty() | ||
| .mix( | ||
| FINDPEAKS_SAMPLE1.out.txt.map { it[1] }, | ||
| FINDPEAKS_SAMPLE2.out.txt.map { it[1] } | ||
| ) | ||
| .collect() | ||
| .map { [ [id:'merged'], it ] } | ||
|
|
||
| input[0] = peaks | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| file(process.out.txt[0][1]).name, | ||
| process.out.versions | ||
| ).match() | ||
| } | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| test("sarscov2 - bed - merge two peak files - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| peaks = Channel.empty() | ||
| .mix( | ||
| FINDPEAKS_SAMPLE1.out.txt.map { it[1] }, | ||
| FINDPEAKS_SAMPLE2.out.txt.map { it[1] } | ||
| ) | ||
| .collect() | ||
| .map { [ [id:'merged'], it ] } | ||
|
|
||
| input[0] = peaks | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(process.out).match("stub") } | ||
| ) | ||
| } | ||
| } | ||
| } |
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 @@ | ||
| { | ||
| "sarscov2 - bed - merge two peak files": { | ||
| "content": [ | ||
| "merged_peaks.txt", | ||
| [ | ||
| "versions.yml:md5,a383523aae5048d4b28718f7ba1d8526" | ||
| ] | ||
| ], | ||
| "meta": { | ||
| "nf-test": "0.9.2", | ||
| "nextflow": "25.04.7" | ||
| }, | ||
| "timestamp": "2025-10-05T13:14:52.683370026" | ||
| }, | ||
| "stub": { | ||
| "content": [ | ||
| { | ||
| "0": [ | ||
| [ | ||
| { | ||
| "id": "merged" | ||
| }, | ||
| "merged_peaks.txt:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
| ] | ||
| ], | ||
| "1": [ | ||
| "versions.yml:md5,5985f7630d53ae0605c2f459e43439c2" | ||
| ], | ||
| "txt": [ | ||
| [ | ||
| { | ||
| "id": "merged" | ||
| }, | ||
| "merged_peaks.txt:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
| ] | ||
| ], | ||
| "versions": [ | ||
| "versions.yml:md5,5985f7630d53ae0605c2f459e43439c2" | ||
| ] | ||
| } | ||
| ], | ||
| "meta": { | ||
| "nf-test": "0.9.2", | ||
| "nextflow": "25.04.7" | ||
| }, | ||
| "timestamp": "2025-10-05T13:14:58.514229717" | ||
| } | ||
| } |
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,11 @@ | ||
| process { | ||
| withName: 'FINDPEAKS_SAMPLE1' { | ||
| ext.args = '-style factor' | ||
| } | ||
| withName: 'FINDPEAKS_SAMPLE2' { | ||
| ext.args = '-style factor' | ||
| } | ||
| withName: 'HOMER_MERGEPEAKS' { | ||
| ext.prefix = 'merged_peaks' | ||
| } | ||
| } |
Oops, something went wrong.
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.
The stub section uses a different default prefix pattern than the main script. The main script uses
${meta.id}_merged_peakswhile the stub uses just${meta.id}, which could cause inconsistent behavior between normal execution and stub mode.