Merge branch 'CW-5911' into 'dev'

Output BAMS in all cases apart from transcriptome-source precomputed [CW-5911]

Closes CW-5911

See merge request epi2melabs/workflows/wf-transcriptomes!209
This commit is contained in:
Sarah Griffiths 2025-04-03 12:57:58 +00:00
commit cd97c1398e
3 changed files with 9 additions and 11 deletions

View File

@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- `all_gene_counts.tsv` contained the DE counts results. - `all_gene_counts.tsv` contained the DE counts results.
- Reduced memory usage of the report workflow process. - Reduced memory usage of the report workflow process.
- Output BAM alignments in all cases unless the workflow is run with `transcriptome_source` set to `precomputed`.
- The merged transcriptome generated for differential expression analysis now only contains the exons and not the full genomic sequence. - The merged transcriptome generated for differential expression analysis now only contains the exons and not the full genomic sequence.
- Output the gene name annotated differential expression analysis count files only. - Output the gene name annotated differential expression analysis count files only.
- Only use full length reads in the differential expression analysis. - Only use full length reads in the differential expression analysis.

12
main.nf
View File

@ -659,7 +659,7 @@ workflow pipeline {
results = Channel.empty() results = Channel.empty()
// Define BAM output Directory // Define BAM output Directory
String publish_bams = "BAMS" String publish_prefix_bams = "BAMS"
software_versions = getVersions() software_versions = getVersions()
workflow_params = getParams() workflow_params = getParams()
input_reads = reads.map{ meta, samples, index, stats -> [meta, samples]} input_reads = reads.map{ meta, samples, index, stats -> [meta, samples]}
@ -680,7 +680,7 @@ workflow pipeline {
if (params.transcriptome_source != "precomputed"){ if (params.transcriptome_source != "precomputed"){
build_minimap_index(ref_genome) build_minimap_index(ref_genome)
log.info("Doing reference based transcript analysis") log.info("Doing reference based transcript analysis")
assembly = reference_assembly(build_minimap_index.out.index, ref_genome, full_len_reads) assembly = reference_assembly(build_minimap_index.out.index, ref_genome, full_len_reads, publish_prefix_bams)
assembly_stats = assembly.stats.map{ it -> it[1]}.collect() assembly_stats = assembly.stats.map{ it -> it[1]}.collect()
@ -716,9 +716,6 @@ workflow pipeline {
merge_gff = merge_gff_bundles.out.gff.map{ it -> it[1]}.collect() merge_gff = merge_gff_bundles.out.gff.map{ it -> it[1]}.collect()
// Output BAMS in a dedicated directory
bam_results = assembly.bam.map{
sample_id, bam, bai -> [bam, bai]}.flatten().map{ [it, publish_bams] }
} }
else{ else{
gff_compare = OPTIONAL_FILE gff_compare = OPTIONAL_FILE
@ -878,8 +875,8 @@ workflow pipeline {
| toSortedList | toSortedList
| map { list -> list.collect{ | map { list -> list.collect{
[ [
"$publish_bams/${it}_reads_aln_sorted.bam", "$publish_prefix_bams/${it}_reads_aln_sorted.bam",
"$publish_bams/${it}_reads_aln_sorted.bam.bai" "$publish_prefix_bams/${it}_reads_aln_sorted.bam.bai"
] ]
} } } }
| concat (igv_ref) | concat (igv_ref)
@ -898,7 +895,6 @@ workflow pipeline {
) )
results = results.concat(igv_conf.map{ [it, null]}) results = results.concat(igv_conf.map{ [it, null]})
results = results.concat(bam_results)
} }

View File

@ -7,10 +7,10 @@ process map_reads{
label "isoforms" label "isoforms"
cpus params.threads cpus params.threads
memory "31 GB" memory "31 GB"
publishDir path: "${params.out_dir}/${publish_prefix_bams}", mode: 'copy', pattern: "${sample_id}_reads_aln_sorted.bam*", overwrite: true
input: input:
tuple val(sample_id), path (fastq_reads), path(index), path(reference) tuple val(sample_id), path (fastq_reads), path(index), path(reference)
val publish_prefix_bams
output: output:
tuple val(sample_id), tuple val(sample_id),
path("${sample_id}_reads_aln_sorted.bam"), path("${sample_id}_reads_aln_sorted.bam"),
@ -51,8 +51,9 @@ workflow reference_assembly {
index index
reference reference
fastq_reads fastq_reads
publish_prefix_bams
main: main:
map_reads(fastq_reads.combine(index).combine(reference)) map_reads(fastq_reads.combine(index).combine(reference), publish_prefix_bams)
emit: emit:
bam = map_reads.out.bam bam = map_reads.out.bam
stats = map_reads.out.stats stats = map_reads.out.stats