Conversation
v2.0.6 Release PR
- module updates - faster bclconvert output handling - modified output structure, featuring qc reports per library and enhanced run QC - fastq output when aligner equals false, with falco report - per sample analysis definition for more flexibility
| "umi_aware": { | ||
| "meta": ["umi_aware"], | ||
| "type": "boolean", | ||
| "description": "Run markdup in UMI-aware mode. This applies to Samtools only and requires the UMI to be in the read name.", |
There was a problem hiding this comment.
Don't change this, but add another option
| "umi_aware": { | ||
| "meta": ["umi_aware"], | ||
| "type": "boolean", | ||
| "description": "Run markdup in UMI-aware mode. This applies to Samtools only and requires the UMI to be in the read name.", |
There was a problem hiding this comment.
Don't change this, but add another option
conf/modules.config
Outdated
| ext.prefix = { "${meta.id}.fgumi.unmapped" } | ||
| ext.args = { | ||
| [ | ||
| "--read-structures ${params.fgumi_read_structures}", |
There was a problem hiding this comment.
Avoid using pipeline wide params for sample specific settings, instead use meta values
conf/modules.config
Outdated
| //// FGUMI extract (step 1) | ||
| withName: '.*FASTQ_TO_CRAM:FGUMI_EXTRACT' { | ||
| cpus = 8 | ||
| memory = 32.GB |
| "${params.fgumi_snap_extra_args}", | ||
| ].join(" ").trim() | ||
| } | ||
| ext.args2 = { |
There was a problem hiding this comment.
Snap params should be equivalent to default alignment config
conf/modules.config
Outdated
| "--strategy ${params.fgumi_group_strategy}", | ||
| "--edits ${params.fgumi_group_edits}", | ||
| "--threads ${task.cpus}", | ||
| "--queue-memory ${params.fgumi_queue_memory}", |
There was a problem hiding this comment.
Should be handled in the module code and depend on process.memory
modules/local/fgumi/extract/main.nf
Outdated
| script: | ||
| def args = task.ext.args ?: '' | ||
| prefix = task.ext.prefix ?: "${meta.id}.fgumi.unmapped" | ||
| def sample_name = meta.samplename ?: meta.id |
There was a problem hiding this comment.
Assume meta.samplename and meta.library do not exist to make it portable to nf-core
modules/local/fgumi/extract/main.nf
Outdated
| prefix = task.ext.prefix ?: "${meta.id}.fgumi.unmapped" | ||
| def sample_name = meta.samplename ?: meta.id | ||
| def library_name = meta.library ?: meta.id | ||
| def input_files = (reads instanceof List ? reads : [reads]).collect { read -> "${read}" }.join(' ') |
There was a problem hiding this comment.
nextflow automatically parses lists, so this isn't needed
modules/local/fgumi/filter/main.nf
Outdated
| --ref ${fasta} \ | ||
| ${args} | ||
|
|
||
| fgumi sort \ |
| -o -sam - \ | ||
| -t ${task.cpus} \ | ||
| ${snap_args} \ | ||
| | samtools sort \ |
There was a problem hiding this comment.
Drop samtools, and let snap sort the output
|
|
||
| // MODULES | ||
| include { BIOBAMBAM_BAMSORMADUP } from "../../../modules/nf-core/biobambam/bamsormadup/main.nf" | ||
| include { FGUMI_DUPLEX_METRICS } from "../../../modules/local/fgumi/duplexmetrics/main.nf" |
There was a problem hiding this comment.
Put all of this in a subworkflow
| // ALIGNMENT([meta,fastq], index, sort) | ||
| ch_meta_reads_aligner_index_fasta_datatype.dna | ||
| .branch { meta, reads, aligner, index, fasta -> | ||
| umi: meta.umi_aware == true |
There was a problem hiding this comment.
Do not override existing settings, this will break samtools UMI handling
| .set { ch_cram_crai } | ||
| ch_cram_crai.dump(tag: "FASTQ_TO_CRAM: cram and crai", pretty: true) | ||
|
|
||
| // Keep a dedicated channel for UMI-aware sample CRAM outputs. |
tests/inputs/fgumi/grouped.bam
Outdated
There was a problem hiding this comment.
Don't add test data in the repo, use nf-cmgg/test-datasets or data available on S3
tests/inputs/test.yml
Outdated
| markdup: bamsormadup | ||
| umi_aware: true |
There was a problem hiding this comment.
This block is inherently wrong, bamsormadup does not support UMI markdup
conf/modules.config
Outdated
| "--read-structures ${params.fgumi_read_structures}", | ||
| params.fgumi_extract_umis_from_read_names ? "--extract-umis-from-read-names" : "", | ||
| "--read-structures ${meta.fgumi_read_structures ?: params.fgumi_read_structures}", | ||
| ((meta.fgumi_extract_umis_from_read_names != null ? meta.fgumi_extract_umis_from_read_names : params.fgumi_extract_umis_from_read_names) ? "--extract-umis-from-read-names" : ""), |
conf/modules.config
Outdated
| "-sa", | ||
| "-xf 2", | ||
| meta.readgroup ? "-R \"@RG\\t" + meta.readgroup.findResults { rg -> rg.value?.trim() ? "${rg.key}:${rg.value}" : null }.join("\\t") + "\"" : "", | ||
| "${params.fgumi_snap_extra_args}", |
There was a problem hiding this comment.
Drop this param, should go in modules.config
conf/modules.config
Outdated
| "--family-size-histogram ${meta.id}.fgumi.group.family_size_histogram.txt", | ||
| ].join(" ").trim() | ||
| } | ||
| ext.strategy = { params.fgumi_group_strategy } |
conf/modules.config
Outdated
| ext.prefix = { "${meta.id}.fgumi.filter" } | ||
| ext.args = { | ||
| [ | ||
| "--min-reads ${params.fgumi_filter_min_reads}", |
modules/local/fgumi/extract/main.nf
Outdated
| def library_name = meta.library ?: meta.id | ||
| def input_files = (reads instanceof List ? reads : [reads]).collect { read -> "${read}" }.join(' ') | ||
| // Keep module portable: only meta.id is assumed, with optional task.ext overrides. | ||
| def sample_name = task.ext.sample_name ?: meta.id |
There was a problem hiding this comment.
only ext.args is allowed, check out nf-core/modules for examples of complex module config
modules/local/fgumi/group/main.nf
Outdated
| fgumi group \ | ||
| --input ${bam} \ | ||
| --output ${prefix}.bam \ | ||
| --strategy ${strategy} \ |
There was a problem hiding this comment.
Anything that isn't resource related must be specified in modules.config under ext.args
modules/local/fgumi/sort/main.nf
Outdated
| fgumi sort \ | ||
| --input ${bam} \ | ||
| --output ${prefix}.bam \ | ||
| --order coordinate \ |
| FGUMI_SIMPLEX( | ||
| FGUMI_GROUP.out.bam | ||
| ) | ||
|
|
||
| FGUMI_DUPLEX_METRICS( | ||
| FGUMI_GROUP.out.bam | ||
| ) | ||
|
|
There was a problem hiding this comment.
How does the workflow differentiate between duplex and simplex?
| input[0] = [ | ||
| [id: "test"], | ||
| file("${projectDir}/tests/inputs/fgumi/grouped.bam", checkIfExists: true) | ||
| file("${projectDir}/tests/inputs/fgumi/template.bam", checkIfExists: true) |
There was a problem hiding this comment.
Also add test with data, not only stubs
workflows/preprocessing.nf
Outdated
| umi_filtered_consensus_bam = FASTQ_TO_CRAM.out.filtered_consensus_bam | ||
| umi_duplex_metrics = FASTQ_TO_CRAM.out.duplex_metrics | ||
| umi_crams = FASTQ_TO_CRAM.out.umi_cram_crai | ||
| umi_crams = FASTQ_TO_CRAM.out.cram_crai.filter { meta, _cram, _crai -> meta.fgumi_aware == true } |
There was a problem hiding this comment.
What's the point of separate outputs?
conf/modules.config
Outdated
There was a problem hiding this comment.
Still some params left over.
threads and memory need to go in to module code
conf/modules.config
Outdated
| "--strategy ${params.fgumi_group_strategy}", | ||
| "--edits ${params.fgumi_group_edits}", | ||
| "--compression-level ${params.fgumi_compression_level}", |
PR checklist
nf-core pipelines lint).nextflow run . -profile test,docker --outdir <OUTDIR>).nextflow run . -profile debug,test,docker --outdir <OUTDIR>).docs/usage.mdis updated.docs/output.mdis updated.CHANGELOG.mdis updated.README.mdis updated (including new tool citations and authors/contributors).