Skip to content

Commit

Permalink
Merge pull request #962 from drpatelh/fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
drpatelh committed Mar 16, 2023
2 parents 4656b56 + 192dcb9 commit 9851365
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 115 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Enhancements & fixes

- [[#878](https://github.com/nf-core/rnaseq/pull/878)] - Allow tabs in fasta header when creating decoys for salmon index
- [[#931](https://github.com/nf-core/rnaseq/pull/931)] - Save transcriptome BAM files when using `--save_umi_intermeds` / `--save_align_intermeds`
- [[#934](https://github.com/nf-core/rnaseq/pull/934)] - Union of `ext.args` and `params.extra_star_align_args` prevents parameter clashes in the STAR module
- [[#940](https://github.com/nf-core/rnaseq/issues/940)] - Bugfix in `salmon_summarizedexperiment.r` to ensure `rbind` doesn't fail when `rowdata` has no `tx` column. See ([[#941](https://github.com/nf-core/rnaseq/pull/941)]) for details.
- [[#944](https://github.com/nf-core/rnaseq/issues/944)] - Read clipping using clip_r1, clip_r2, three_prime_clip_r1, three_prime_clip_r2 disabled in 3.10
- [[#956](https://github.com/nf-core/rnaseq/pull/956)] - Implement 'auto' as default strandedness argument in `fastq_dir_to_samplesheet.py` script
- [[#960](https://github.com/nf-core/rnaseq/pull/960)] - Failure with awsbatch when running processes that are using `executor: local`
- Remove HISAT2 from automated AWS full-sized tests

### Software dependencies
Expand Down
100 changes: 59 additions & 41 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,6 @@ if (!params.skip_trimming) {
]
]
}

withName: 'MULTIQC_TSV_FAIL_TRIMMED' {
publishDir = [
path: { "${params.outdir}/multiqc" },
enabled: false
]
}
}
}

Expand Down Expand Up @@ -517,17 +510,6 @@ if (!params.skip_alignment) {
}
}
}

if (params.aligner.contains('star')) {
process {
withName: 'MULTIQC_TSV_FAIL_MAPPED' {
publishDir = [
path: { "${params.outdir}/multiqc" },
enabled: false
]
}
}
}
}

//
Expand Down Expand Up @@ -613,39 +595,70 @@ if (!params.skip_alignment && params.aligner == 'star_salmon') {
ext.prefix = { "${meta.id}.umi_dedup.transcriptome" }
publishDir = [
path: { "${params.outdir}/${params.aligner}" },
enabled: false
mode: params.publish_dir_mode,
pattern: '*.bam',
enabled: (
params.save_align_intermeds ||
params.save_umi_intermeds
)
]
}

withName: 'NFCORE_RNASEQ:RNASEQ:UMITOOLS_PREPAREFORSALMON' {
ext.prefix = { "${meta.id}.umi_dedup.transcriptome.filtered" }
publishDir = [
path: { "${params.outdir}/${params.aligner}/umitools/log" },
mode: params.publish_dir_mode,
pattern: '*.log'
[
path: { "${params.outdir}/${params.aligner}/umitools/log" },
mode: params.publish_dir_mode,
pattern: '*.log'
],
[
path: { "${params.outdir}/${params.aligner}" },
mode: params.publish_dir_mode,
pattern: '*.bam',
enabled: (
params.save_align_intermeds ||
params.save_umi_intermeds
)
]
]
}

withName: 'NFCORE_RNASEQ:RNASEQ:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_SORT' {
ext.prefix = { "${meta.id}.transcriptome.sorted" }
publishDir = [
path: { "${params.outdir}/${params.aligner}" },
enabled: false
mode: params.publish_dir_mode,
pattern: '*.bam',
enabled: (
params.save_align_intermeds ||
params.save_umi_intermeds
)
]
}

withName: 'NFCORE_RNASEQ:RNASEQ:BAM_SORT_STATS_SAMTOOLS:SAMTOOLS_INDEX' {
publishDir = [
path: { "${params.outdir}/${params.aligner}" },
enabled: false
mode: params.publish_dir_mode,
pattern: '*.bai',
enabled: (
params.save_align_intermeds ||
params.save_umi_intermeds
)
]
}

withName: 'NFCORE_RNASEQ:RNASEQ:BAM_SORT_STATS_SAMTOOLS:BAM_STATS_SAMTOOLS:.*' {
ext.prefix = { "${meta.id}.transcriptome.sorted.bam" }
publishDir = [
path: { "${params.outdir}/${params.aligner}" },
enabled: false
path: { "${params.outdir}/${params.aligner}/samtools_stats" },
mode: params.publish_dir_mode,
pattern: '*.{stats,flagstat,idxstats}',
enabled: (
params.save_align_intermeds ||
params.save_umi_intermeds
)
]
}

Expand All @@ -657,16 +670,32 @@ if (!params.skip_alignment && params.aligner == 'star_salmon') {
].join(' ').trim() }
ext.prefix = { "${meta.id}.umi_dedup.transcriptome.sorted" }
publishDir = [
path: { "${params.outdir}/${params.aligner}/umitools" },
mode: params.publish_dir_mode,
pattern: '*.tsv'
[
path: { "${params.outdir}/${params.aligner}/umitools" },
mode: params.publish_dir_mode,
pattern: '*.tsv'
],
[
path: { "${params.outdir}/${params.aligner}" },
mode: params.publish_dir_mode,
pattern: '*.bam',
enabled: (
params.save_align_intermeds ||
params.save_umi_intermeds
)
]
]
}

withName: '.*:BAM_DEDUP_STATS_SAMTOOLS_UMITOOLS_TRANSCRIPTOME:SAMTOOLS_INDEX' {
publishDir = [
path: { "${params.outdir}/${params.aligner}" },
enabled: false
mode: params.publish_dir_mode,
pattern: '*.bai',
enabled: (
params.save_align_intermeds ||
params.save_umi_intermeds
)
]
}

Expand Down Expand Up @@ -1042,17 +1071,6 @@ if (!params.skip_alignment && !params.skip_qc) {
}
}
}

if (!params.skip_rseqc && rseqc_modules) {
process {
withName: 'MULTIQC_TSV_STRAND_CHECK' {
publishDir = [
path: { "${params.outdir}/multiqc" },
enabled: false
]
}
}
}
}

if (!params.skip_multiqc) {
Expand Down
16 changes: 15 additions & 1 deletion lib/WorkflowRnaseq.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,18 @@ class WorkflowRnaseq {
return yaml_file_text
}

//
// Create MultiQC tsv custom content from a list of values
//
public static String multiqcTsvFromList(tsv_data, header) {
def tsv_string = ""
if (tsv_data.size() > 0) {
tsv_string += "${header.join('\t')}\n"
tsv_string += tsv_data.join('\n')
}
return tsv_string
}

public static String methodsDescriptionText(run_workflow, mqc_methods_yaml) {
// Convert to a named map so can be used as with familar NXF ${workflow} variable syntax in the MultiQC YML file
def meta = [:]
Expand All @@ -288,7 +300,9 @@ class WorkflowRnaseq {
def description_html = engine.createTemplate(methods_text).make(meta)

return description_html
}//
}

//
// Exit pipeline if incorrect --genome key provided
//
private static void genomeExistsError(params, log) {
Expand Down
2 changes: 1 addition & 1 deletion modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
},
"salmon/index": {
"branch": "master",
"git_sha": "94b06f1683ddf893cf06525f6e7f0573ad8fbf83",
"git_sha": "cfef21995228c66af535b14c5efae1461ffb8981",
"installed_by": ["fastq_subsample_fq_salmon"]
},
"salmon/quant": {
Expand Down
28 changes: 0 additions & 28 deletions modules/local/multiqc_tsv_from_list.nf

This file was deleted.

9 changes: 5 additions & 4 deletions modules/nf-core/salmon/index/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 33 additions & 40 deletions workflows/rnaseq.nf
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ include { DUPRADAR } from '../modules/local/dupradar'
include { MULTIQC } from '../modules/local/multiqc'
include { MULTIQC_CUSTOM_BIOTYPE } from '../modules/local/multiqc_custom_biotype'
include { UMITOOLS_PREPAREFORRSEM as UMITOOLS_PREPAREFORSALMON } from '../modules/local/umitools_prepareforrsem.nf'
include { MULTIQC_TSV_FROM_LIST as MULTIQC_TSV_FAIL_MAPPED } from '../modules/local/multiqc_tsv_from_list'
include { MULTIQC_TSV_FROM_LIST as MULTIQC_TSV_FAIL_TRIMMED } from '../modules/local/multiqc_tsv_from_list'
include { MULTIQC_TSV_FROM_LIST as MULTIQC_TSV_STRAND_CHECK } from '../modules/local/multiqc_tsv_from_list'

//
// SUBWORKFLOW: Consisting of a mix of local and nf-core/modules
Expand Down Expand Up @@ -309,14 +306,13 @@ workflow RNASEQ {
return [ "$meta.id\t$num_reads" ]
}
}
.set { ch_num_trimmed_reads }

MULTIQC_TSV_FAIL_TRIMMED (
ch_num_trimmed_reads.collect(),
["Sample", "Reads after trimming"],
'fail_trimmed_samples'
)
.set { ch_fail_trimming_multiqc }
.collect()
.map {
tsv_data ->
def header = ["Sample", "Reads after trimming"]
WorkflowRnaseq.multiqcTsvFromList(tsv_data, header)
}
.set { ch_fail_trimming_multiqc }
}

//
Expand Down Expand Up @@ -581,16 +577,15 @@ workflow RNASEQ {
}
.set { ch_pass_fail_mapped }

def header = [
"Sample",
"STAR uniquely mapped reads (%)"
]
MULTIQC_TSV_FAIL_MAPPED (
ch_pass_fail_mapped.fail.collect(),
header,
'fail_mapped_samples'
)
.set { ch_fail_mapping_multiqc }
ch_pass_fail_mapped
.fail
.collect()
.map {
tsv_data ->
def header = ["Sample", "STAR uniquely mapped reads (%)"]
WorkflowRnaseq.multiqcTsvFromList(tsv_data, header)
}
.set { ch_fail_mapping_multiqc }
}

//
Expand Down Expand Up @@ -751,22 +746,20 @@ workflow RNASEQ {
.map { meta, strandedness, sense, antisense, undetermined ->
[ "$meta.id\t$meta.strandedness\t$strandedness\t$sense\t$antisense\t$undetermined" ]
}
.set { ch_fail_strand }

def header = [
"Sample",
"Provided strandedness",
"Inferred strandedness",
"Sense (%)",
"Antisense (%)",
"Undetermined (%)"
]
MULTIQC_TSV_STRAND_CHECK (
ch_fail_strand.collect(),
header,
'fail_strand_check'
)
.set { ch_fail_strand_multiqc }
.collect()
.map {
tsv_data ->
def header = [
"Sample",
"Provided strandedness",
"Inferred strandedness",
"Sense (%)",
"Antisense (%)",
"Undetermined (%)"
]
WorkflowRnaseq.multiqcTsvFromList(tsv_data, header)
}
.set { ch_fail_strand_multiqc }
}
}

Expand Down Expand Up @@ -824,9 +817,9 @@ workflow RNASEQ {
ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml'),
ch_methods_description.collectFile(name: 'methods_description_mqc.yaml'),
ch_multiqc_logo.collect().ifEmpty([]),
ch_fail_trimming_multiqc.ifEmpty([]),
ch_fail_mapping_multiqc.ifEmpty([]),
ch_fail_strand_multiqc.ifEmpty([]),
ch_fail_trimming_multiqc.collectFile(name: 'fail_trimmed_samples_mqc.tsv').ifEmpty([]),
ch_fail_mapping_multiqc.collectFile(name: 'fail_mapped_samples_mqc.tsv').ifEmpty([]),
ch_fail_strand_multiqc.collectFile(name: 'fail_strand_check_mqc.tsv').ifEmpty([]),
FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.fastqc_zip.collect{it[1]}.ifEmpty([]),
FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.trim_zip.collect{it[1]}.ifEmpty([]),
FASTQ_FASTQC_UMITOOLS_TRIMGALORE.out.trim_log.collect{it[1]}.ifEmpty([]),
Expand Down

0 comments on commit 9851365

Please sign in to comment.