-
Notifications
You must be signed in to change notification settings - Fork 1k
Add fgumi/extract
#11546
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
base: master
Are you sure you want to change the base?
Add fgumi/extract
#11546
Changes from 10 commits
62e1dae
58c621f
84e5bfc
a94cb40
eed6d94
517df53
545b8b5
045536e
f11e659
84535d0
c960d2e
8922890
6351f2c
c02000c
cfef819
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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::fgumi=0.2.0" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| process FGUMI_EXTRACT { | ||
| tag "${meta.id}" | ||
| label 'process_single' | ||
|
|
||
| conda "${moduleDir}/environment.yml" | ||
| container "${workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container | ||
| ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/a5/a510706f3481fae12ff6100d6e4ad298b8bf464a2d93a6afe35e9cf26542d080/data' | ||
| : 'community.wave.seqera.io/library/fgumi:0.2.0--fe028e7a64e5da27'}" | ||
|
|
||
| input: | ||
| tuple val(meta), path(reads) | ||
|
|
||
| output: | ||
| tuple val(meta), path("*.bam"), emit: bam | ||
| tuple val("${task.process}"), val('fgumi'), eval('fgumi --version | sed "s/^fgumi //"'), topic: versions, emit: versions_fgumi | ||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| if (!args.contains('--sample') || !args.contains('--library')) { | ||
| error("fgumi extract requires both --sample and --library to be supplied via task.ext.args") | ||
| } | ||
|
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. Hmm, if these are required arguments, they should probably be part of the input tuple.
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.
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. Thank you, I've incorporated this. |
||
|
|
||
| """ | ||
| fgumi extract \\ | ||
| --inputs ${reads.join(' ')} \\ | ||
| --output ${prefix}.bam \\ | ||
| ${args} | ||
| """ | ||
|
|
||
| stub: | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| """ | ||
| touch ${prefix}.bam | ||
| """ | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| name: fgumi_extract | ||
| description: Extract unique molecular indices (UMIs) from FASTQ files and write an unaligned BAM file. | ||
| keywords: | ||
| - umi | ||
| - extract | ||
| - fastq | ||
| - bam | ||
| tools: | ||
| - fgumi: | ||
| description: High-performance tools for working with UMI-tagged sequencing data. | ||
| homepage: https://github.com/fulcrumgenomics/fgumi | ||
| documentation: https://docs.rs/fgumi | ||
| tool_dev_url: https://github.com/fulcrumgenomics/fgumi | ||
| licence: ["MIT"] | ||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'test', single_end:false ] | ||
| - reads: | ||
| type: file | ||
| description: Input FASTQ files used for UMI extraction. | ||
| pattern: "*.fastq.gz" | ||
| ontologies: [] | ||
| output: | ||
| bam: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'test', single_end:false ] | ||
| - "*.bam": | ||
| type: file | ||
| description: Unaligned BAM with extracted UMIs in SAM tags. | ||
| pattern: "*.bam" | ||
| ontologies: [] | ||
| versions_fgumi: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The process the versions were collected from | ||
| - fgumi: | ||
| type: string | ||
| description: The tool name | ||
| - 'fgumi --version | sed "s/^fgumi //"': | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
|
|
||
| topics: | ||
| versions: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The process the versions were collected from | ||
| - fgumi: | ||
| type: string | ||
| description: The tool name | ||
| - 'fgumi --version | sed "s/^fgumi //"': | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
| authors: | ||
| - "@atrigila" | ||
| maintainers: | ||
| - "@atrigila" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process FGUMI_EXTRACT" | ||
| script "../main.nf" | ||
| process "FGUMI_EXTRACT" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "fgumi" | ||
| tag "fgumi/extract" | ||
|
|
||
| config "./nextflow.config" | ||
|
|
||
| test("homo_sapiens - [fastq1, fastq2]") { | ||
|
|
||
| when { | ||
| params { | ||
| module_args = '--library illumina' | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test' ], | ||
| [ | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test.umi_1.fastq.gz', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test.umi_2.fastq.gz', checkIfExists: true) | ||
| ] | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(sanitizeOutput(process.out)).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("homo_sapiens - [fastq1, fastq2] - missing library") { | ||
|
|
||
| when { | ||
| params { | ||
| module_args = '--read-structures +T +M' | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test' ], | ||
| [ | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test.umi_1.fastq.gz', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test.umi_2.fastq.gz', checkIfExists: true) | ||
| ] | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert !process.success }, | ||
| { assert process.errorReport.contains('fgumi extract requires both --sample and --library') } | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| test("homo_sapiens - [fastq1, fastq2] - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| params { | ||
| module_args = "--sample test --library test --read-structures +T +M" | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test' ], | ||
| [ | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test.umi_1.fastq.gz', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test.umi_2.fastq.gz', checkIfExists: true) | ||
| ] | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(sanitizeOutput(process.out)).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| { | ||
| "homo_sapiens - [fastq1, fastq2]": { | ||
| "content": [ | ||
| { | ||
| "bam": [ | ||
| [ | ||
| { | ||
| "id": "test" | ||
| }, | ||
| "test.bam:md5,9c2476e5c354f57bed109e582b8953be" | ||
| ] | ||
| ], | ||
| "versions_fgumi": [ | ||
| [ | ||
| "FGUMI_EXTRACT", | ||
| "fgumi", | ||
| "0.2.0" | ||
| ] | ||
| ] | ||
| } | ||
| ], | ||
| "timestamp": "2026-05-07T12:48:51.477812468", | ||
| "meta": { | ||
| "nf-test": "0.9.5", | ||
| "nextflow": "26.04.0" | ||
| } | ||
| }, | ||
| "homo_sapiens - [fastq1, fastq2] - stub": { | ||
| "content": [ | ||
| { | ||
| "bam": [ | ||
| [ | ||
| { | ||
| "id": "test" | ||
| }, | ||
| "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
| ] | ||
| ], | ||
| "versions_fgumi": [ | ||
| [ | ||
| "FGUMI_EXTRACT", | ||
| "fgumi", | ||
| "0.2.0" | ||
| ] | ||
| ] | ||
| } | ||
| ], | ||
| "timestamp": "2026-05-07T12:49:21.767581495", | ||
| "meta": { | ||
| "nf-test": "0.9.5", | ||
| "nextflow": "26.04.0" | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| process { | ||
| withName: FGUMI_EXTRACT { | ||
| ext.args = { "--sample ${meta.id} ${params.module_args}" } | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.