-
Notifications
You must be signed in to change notification settings - Fork 928
Add pbcpgtools/alignedbamtocpgscores module #9312
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
inemesb
wants to merge
3
commits into
nf-core:master
Choose a base branch
from
inemesb:add_pbcpgtools
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.
+478
−0
Open
Changes from all commits
Commits
Show all changes
3 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
7 changes: 7 additions & 0 deletions
7
modules/nf-core/pbcpgtools/alignedbamtocpgscores/environment.yml
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::pb-cpg-tools=3.0.0" |
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,61 @@ | ||||||
| process PBCPGTOOLS_ALIGNEDBAMTOCPGSCORES { | ||||||
| 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/pb-cpg-tools:3.0.0--h9ee0642_0': | ||||||
| 'biocontainers/pb-cpg-tools:3.0.0--h9ee0642_0' }" | ||||||
|
|
||||||
| input: | ||||||
| tuple val(meta), path(bam), path(bai) | ||||||
|
|
||||||
| output: | ||||||
| tuple val(meta), path("*.bed.gz"), emit: bed | ||||||
| tuple val(meta), path("*.bed.gz.tbi"), emit: bed_index | ||||||
| tuple val(meta), path("*.bw"), emit: bigwig | ||||||
| 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}" | ||||||
|
|
||||||
| """ | ||||||
| aligned_bam_to_cpg_scores \\ | ||||||
| --bam ${bam} \\ | ||||||
| --output-prefix ${prefix} \\ | ||||||
| --threads ${task.cpus} \\ | ||||||
| ${args} | ||||||
|
|
||||||
| cat <<-END_VERSIONS > versions.yml | ||||||
| "${task.process}": | ||||||
| pbcpgtools: \$(aligned_bam_to_cpg_scores --version | sed 's/aligned_bam_to_cpg_scores //') | ||||||
| END_VERSIONS | ||||||
| """ | ||||||
|
|
||||||
| stub: | ||||||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||||||
|
|
||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| """ | ||||||
|
|
||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| echo "" | gzip > ${prefix}.combined.bed.gz | ||||||
| touch ${prefix}.combined.bed.gz.tbi | ||||||
| touch ${prefix}.combined.bw | ||||||
|
|
||||||
| echo "" | gzip > ${prefix}.hap1.bed.gz | ||||||
| touch ${prefix}.hap1.bed.gz.tbi | ||||||
| touch ${prefix}.hap1.bw | ||||||
|
|
||||||
| echo "" | gzip > ${prefix}.hap2.bed.gz | ||||||
| touch ${prefix}.hap2.bed.gz.tbi | ||||||
| touch ${prefix}.hap2.bw | ||||||
|
|
||||||
| cat <<-END_VERSIONS > versions.yml | ||||||
| "${task.process}": | ||||||
| pbcpgtools: \$(aligned_bam_to_cpg_scores --version | sed 's/aligned_bam_to_cpg_scores //') | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| 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,77 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
| name: "pbcpgtools_alignedbamtocpgscores" | ||
| description: Converts aligned BAM files into CpG methylation scores using pb-cpg-tools. | ||
| keywords: | ||
| - methylation | ||
| - cpg | ||
| - pacbio | ||
| tools: | ||
| - "pbcpgtools": | ||
| description: "Collection of tools for the analysis of CpG data" | ||
| homepage: "https://github.com/PacificBiosciences/pb-CpG-tools" | ||
| documentation: "https://github.com/PacificBiosciences/pb-CpG-tools#readme" | ||
| tool_dev_url: "https://github.com/PacificBiosciences/pb-CpG-tools" | ||
| licence: ["Pacific Biosciences Software License Agreement"] | ||
|
|
||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - bam: | ||
| type: file | ||
| description: BAM/CRAM file | ||
| pattern: "*.{bam,cram}" | ||
| ontologies: [] | ||
| - bai: | ||
| type: file | ||
| description: Index of BAM/CRAM file | ||
| pattern: "*.{bai,crai,csi}" | ||
| ontologies: [] | ||
|
|
||
| output: | ||
| bed: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - "*.bed.gz": | ||
| type: file | ||
| description: Zipped BED file with CpG methylation scores | ||
| pattern: "*.{bed.gz}" | ||
| ontologies: [] | ||
| bed_index: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - "*.bed.gz.tbi": | ||
| type: file | ||
| description: Index of zipped BED file | ||
| pattern: "*.{.bed.gz.tbi}" | ||
| ontologies: [] | ||
| bigwig: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - "*.bw": | ||
| type: file | ||
| description: Bigwig file for visualization in IGV | ||
| pattern: "*.{bw}" | ||
| ontologies: [] | ||
| versions: | ||
| - "versions.yml": | ||
| type: file | ||
| description: File containing software versions | ||
| pattern: "versions.yml" | ||
| ontologies: [] | ||
|
|
||
| authors: | ||
| - "@inemesb" | ||
| maintainers: | ||
| - "@inemesb" |
88 changes: 88 additions & 0 deletions
88
modules/nf-core/pbcpgtools/alignedbamtocpgscores/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,88 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process PBCPGTOOLS_ALIGNEDBAMTOCPGSCORES" | ||
| script "../main.nf" | ||
| process "PBCPGTOOLS_ALIGNEDBAMTOCPGSCORES" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "pbcpgtools" | ||
| tag "pbcpgtools/alignedbamtocpgscores" | ||
|
|
||
| test("pacbio - bam - notphased") { | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
|
|
||
| input[0] = [ | ||
| [ id:'test'], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/NA037562_downsampled.pbmm2.repeats.bam', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/NA037562_downsampled.pbmm2.repeats.bam.bai', checkIfExists: true) | ||
|
|
||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(process.out).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("pacbio - bam - phased") { | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
|
|
||
| input[0] = [ | ||
| [ id:'test'], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/NA037562_downsampled.pbmm2.repeats.phased.bam', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/NA037562_downsampled.pbmm2.repeats.phased.bam.bai', checkIfExists: true) | ||
|
|
||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(process.out).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("pacbio - bam - phased - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
|
|
||
| input[0] = [ | ||
| [ id:'test'], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/NA037562_downsampled.pbmm2.repeats.phased.bam', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/NA037562_downsampled.pbmm2.repeats.phased.bam.bai', checkIfExists: true) | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(process.out).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| } |
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.