Skip to content
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

Bam index dir #387

Merged
merged 10 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Use institutional configs by default [#381](https://github.com/nf-core/rnafusion/pull/381)
- Remove redundant indexing in starfusion and qc workflows [#387](https://github.com/nf-core/rnafusion/pull/387)
- Output bai files in same directory as bam files [#387](https://github.com/nf-core/rnafusion/pull/387)

### Fixed

Expand Down
13 changes: 2 additions & 11 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -187,24 +187,15 @@ process {

withName: SAMTOOLS_INDEX_FOR_ARRIBA {
publishDir = [
path: { "${params.outdir}/samtools_index_for_arriba" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: SAMTOOLS_INDEX_FOR_QC {
ext.when = { !params.skip_qc && !params.fusioninspector_only && (params.starfusion || params.all)}
publishDir = [
path: { "${params.outdir}/samtools_index_for_qc" },
path: { "${params.outdir}/star_for_arriba" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: SAMTOOLS_INDEX_FOR_STARFUSION {
publishDir = [
path: { "${params.outdir}/samtools_index_for_starfusion" },
path: { "${params.outdir}/star_for_starfusion" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
Expand Down
15 changes: 5 additions & 10 deletions subworkflows/local/qc_workflow.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
//

include { QUALIMAP_RNASEQ } from '../../modules/nf-core/qualimap/rnaseq/main'
include { SAMTOOLS_INDEX as SAMTOOLS_INDEX_FOR_QC } from '../../modules/nf-core/samtools/index/main'
include { PICARD_COLLECTRNASEQMETRICS } from '../../modules/local/picard/collectrnaseqmetrics/main'
include { PICARD_MARKDUPLICATES } from '../../modules/nf-core/picard/markduplicates/main'

workflow QC_WORKFLOW {
take:
bam_sorted
ch_bam_sorted
ch_bam_sorted_indexed
ch_chrgtf
ch_refflat
ch_fasta
Expand All @@ -19,20 +19,15 @@ workflow QC_WORKFLOW {
main:
ch_versions = Channel.empty()

QUALIMAP_RNASEQ(bam_sorted, ch_chrgtf)
QUALIMAP_RNASEQ(ch_bam_sorted, ch_chrgtf)
ch_versions = ch_versions.mix(QUALIMAP_RNASEQ.out.versions)
ch_qualimap_qc = Channel.empty().mix(QUALIMAP_RNASEQ.out.results)

SAMTOOLS_INDEX_FOR_QC(bam_sorted)
ch_versions = ch_versions.mix(SAMTOOLS_INDEX_FOR_QC.out.versions)

bam_indexed = bam_sorted.join(SAMTOOLS_INDEX_FOR_QC.out.bai)

PICARD_COLLECTRNASEQMETRICS(bam_indexed, ch_refflat, ch_rrna_interval)
PICARD_COLLECTRNASEQMETRICS(ch_bam_sorted_indexed, ch_refflat, ch_rrna_interval)
ch_versions = ch_versions.mix(PICARD_COLLECTRNASEQMETRICS.out.versions)
ch_rnaseq_metrics = Channel.empty().mix(PICARD_COLLECTRNASEQMETRICS.out.metrics)

PICARD_MARKDUPLICATES(bam_sorted, ch_fasta, ch_fai)
PICARD_MARKDUPLICATES(ch_bam_sorted, ch_fasta, ch_fai)
ch_versions = ch_versions.mix(PICARD_MARKDUPLICATES.out.versions)
ch_duplicate_metrics = Channel.empty().mix(PICARD_MARKDUPLICATES.out.metrics)

Expand Down
5 changes: 3 additions & 2 deletions subworkflows/local/starfusion_workflow.nf
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ workflow STARFUSION_WORKFLOW {
emit:
fusions = ch_starfusion_fusions
star_stats = ch_star_stats
bam_sorted = ch_align
ch_bam_sorted = ch_align.ifEmpty([[],[]])
ch_bam_sorted_indexed = bam_sorted_indexed.ifEmpty([[],[],[]])
fevac marked this conversation as resolved.
Show resolved Hide resolved
versions = ch_versions.ifEmpty(null)
ch_bam_sorted_indexed = bam_sorted_indexed.ifEmpty(null)

}

5 changes: 3 additions & 2 deletions workflows/rnafusion.nf
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ workflow RNAFUSION {

//Run stringtie
STRINGTIE_WORKFLOW (
STARFUSION_WORKFLOW.out.bam_sorted,
STARFUSION_WORKFLOW.out.ch_bam_sorted,
ch_chrgtf
)
ch_versions = ch_versions.mix(STRINGTIE_WORKFLOW.out.versions.first().ifEmpty(null))
Expand Down Expand Up @@ -255,7 +255,8 @@ workflow RNAFUSION {

//QC
QC_WORKFLOW (
STARFUSION_WORKFLOW.out.bam_sorted,
STARFUSION_WORKFLOW.out.ch_bam_sorted,
STARFUSION_WORKFLOW.out.ch_bam_sorted_indexed,
ch_chrgtf,
ch_refflat,
ch_fasta,
Expand Down