-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: mako module #12155
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
emmcauley
wants to merge
2
commits into
nf-core:master
Choose a base branch
from
fulcrumgenomics:em_fg_mako
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
feat: mako module #12155
Changes from all commits
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,8 @@ | ||
| --- | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json | ||
| channels: | ||
| - conda-forge | ||
| - bioconda | ||
| dependencies: | ||
| # renovate: datasource=conda depName=bioconda/fg-mako | ||
| - "bioconda::fg-mako=0.1.3" |
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,44 @@ | ||
| process MAKO { | ||
| tag "${meta.id}" | ||
| label 'process_medium' | ||
|
|
||
| conda "${moduleDir}/environment.yml" | ||
| container "${workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container | ||
| ? 'https://depot.galaxyproject.org/singularity/fg-mako:0.1.3--h7296c89_0' | ||
| : 'quay.io/biocontainers/fg-mako:0.1.3--h7296c89_0'}" | ||
|
|
||
| input: | ||
| tuple val(meta), path(bam) | ||
|
|
||
| output: | ||
| tuple val(meta), path("${prefix}.bam"), emit: bam | ||
| tuple val(meta), path("${prefix}.bam.bai"), emit: bai, optional: true | ||
| tuple val("${task.process}"), val('mako'), eval("mako --version | sed '1!d; s/^[^ ]* //; s/ .*//'"), topic: versions, emit: versions_mako | ||
| tuple val("${task.process}"), val('fgumi'), eval("mako --version | sed '2!d; s/.* //'"), topic: versions, emit: versions_fgumi | ||
|
Contributor
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. no fgumi here?
Contributor
Author
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. fgumi version is built into this command: |
||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
| prefix = task.ext.prefix ?: "${meta.id}" | ||
| if ("${prefix}.bam" == "${bam}") { | ||
| error("Input and output names are the same, set prefix in module configuration to disambiguate!") | ||
| } | ||
| """ | ||
| mako \\ | ||
| --input ${bam} \\ | ||
| --output ${prefix}.bam \\ | ||
| --threads ${task.cpus} \\ | ||
| ${args} | ||
| """ | ||
|
|
||
| stub: | ||
| def args = task.ext.args ?: '' | ||
| prefix = task.ext.prefix ?: "${meta.id}" | ||
| def create_index = args.contains('--write-index') ? "touch ${prefix}.bam.bai" : '' | ||
| """ | ||
| touch ${prefix}.bam | ||
| ${create_index} | ||
| """ | ||
| } | ||
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,104 @@ | ||
| name: mako | ||
| description: Sort SAM/BAM files by coordinate, queryname or template-coordinate using a fast external merge-sort | ||
| keywords: | ||
| - sort | ||
| - bam | ||
| - sam | ||
| - template-coordinate | ||
| - umi | ||
| tools: | ||
| - mako: | ||
| description: | | ||
| mako is a focused, single-purpose command-line tool for sorting SAM and BAM files. | ||
| It uses a high-performance external merge-sort (spilling to disk for inputs larger than | ||
| memory) with parallel radix sorting of in-memory chunks, and is a standalone packaging | ||
| of the fgumi sort command. | ||
| homepage: https://github.com/fg-labs/mako | ||
| documentation: https://github.com/fg-labs/mako | ||
| tool_dev_url: https://github.com/fg-labs/mako | ||
| licence: ["MIT"] | ||
| identifier: "" | ||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1', single_end:false ]` | ||
| - bam: | ||
| type: file | ||
| description: Input SAM/BAM file to sort | ||
| pattern: "*.{sam,bam}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_2572" # BAM | ||
| - edam: "http://edamontology.org/format_2573" # SAM | ||
| output: | ||
| bam: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1', single_end:false ]` | ||
| - "${prefix}.bam": | ||
| type: file | ||
| description: Sorted BAM file | ||
| pattern: "*.{bam}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_2572" # BAM | ||
| bai: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1', single_end:false ]` | ||
| - "${prefix}.bam.bai": | ||
| type: file | ||
| description: BAM index, written only for a coordinate sort with `--write-index` | ||
| pattern: "*.{bai}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3327" # BAI | ||
| versions_mako: | ||
| - - "${task.process}": | ||
| type: string | ||
| description: The name of the process | ||
| - "mako": | ||
| type: string | ||
| description: The name of the tool | ||
| - "mako --version | sed '1!d; s/^[^ ]* //; s/ .*//'": | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
| versions_fgumi: | ||
| - - "${task.process}": | ||
| type: string | ||
| description: The name of the process | ||
| - "fgumi": | ||
| type: string | ||
| description: The name of the underlying engine | ||
| - "mako --version | sed '2!d; s/.* //'": | ||
| type: eval | ||
| description: The expression to obtain the version of the underlying fgumi engine | ||
|
|
||
| topics: | ||
| versions: | ||
| - - "${task.process}": | ||
| type: string | ||
| description: The name of the process | ||
| - "mako": | ||
| type: string | ||
| description: The name of the tool | ||
| - "mako --version | sed '1!d; s/^[^ ]* //; s/ .*//'": | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
| - - "${task.process}": | ||
| type: string | ||
| description: The name of the process | ||
| - "fgumi": | ||
| type: string | ||
| description: The name of the underlying engine | ||
| - "mako --version | sed '2!d; s/.* //'": | ||
| type: eval | ||
| description: The expression to obtain the version of the underlying fgumi engine | ||
|
|
||
| authors: | ||
| - "@nh13" | ||
| maintainers: | ||
| - "@nh13" |
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,150 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process MAKO" | ||
| script "../main.nf" | ||
| process "MAKO" | ||
| config "./nextflow.config" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "mako" | ||
|
|
||
| test("sarscov2 - bam - coordinate sort") { | ||
|
|
||
| when { | ||
| params { | ||
| module_args = '--order coordinate' | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test', single_end:false ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.bam', checkIfExists: true) | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert bam(process.out.bam[0][1]).getHeader().any { it.contains("SO:coordinate") } }, | ||
| { assert snapshot( | ||
| bam(process.out.bam[0][1]).getReadsMD5(), | ||
| process.out.findAll { key, val -> key.startsWith("versions") } | ||
| ).match() } | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| test("sarscov2 - bam - queryname sort") { | ||
|
|
||
| when { | ||
| params { | ||
| module_args = '--order queryname' | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test', single_end:false ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.bam', checkIfExists: true) | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert bam(process.out.bam[0][1]).getHeader().any { it.contains("SO:queryname") } }, | ||
| { assert snapshot( | ||
| bam(process.out.bam[0][1]).getReadsMD5(), | ||
| process.out.findAll { key, val -> key.startsWith("versions") } | ||
| ).match() } | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| test("sarscov2 - bam - coordinate sort with index") { | ||
|
|
||
| when { | ||
| params { | ||
| module_args = '--order coordinate --write-index' | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test', single_end:false ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.bam', checkIfExists: true) | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert bam(process.out.bam[0][1]).getHeader().any { it.contains("SO:coordinate") } }, | ||
| { assert process.out.bai[0][1] ==~ /.*\.bam\.bai/ }, | ||
| { assert snapshot( | ||
| bam(process.out.bam[0][1]).getReadsMD5(), | ||
| process.out.findAll { key, val -> key.startsWith("versions") } | ||
| ).match() } | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| test("sarscov2 - bam - template-coordinate sort (default)") { | ||
|
|
||
| when { | ||
| params { | ||
| module_args = '' | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test', single_end:false ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.bam', checkIfExists: true) | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert bam(process.out.bam[0][1]).getHeader().any { it.contains("template-coordinate") } }, | ||
| { assert snapshot( | ||
| bam(process.out.bam[0][1]).getReadsMD5(), | ||
| process.out.findAll { key, val -> key.startsWith("versions") } | ||
| ).match() } | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| test("sarscov2 - bam - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| params { | ||
| module_args = '--order coordinate' | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test', single_end:false ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.bam', checkIfExists: true) | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(sanitizeOutput(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.
Can we have maybe have this in one tuple?
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.
not sure about combining the BAM and BAI, because the
.baiis optional: true but the.bamis always produced.