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

Sambamba #1368

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,11 @@
"git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5",
"installed_by": ["bam_ngscheckmate"]
},
"sambamba/markdup": {
"branch": "master",
"git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5",
"installed_by": ["modules"]
},
"samblaster": {
"branch": "master",
"git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5",
Expand Down
7 changes: 7 additions & 0 deletions modules/nf-core/sambamba/markdup/environment.yml

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

38 changes: 38 additions & 0 deletions modules/nf-core/sambamba/markdup/main.nf

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

41 changes: 41 additions & 0 deletions modules/nf-core/sambamba/markdup/meta.yml

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

48 changes: 48 additions & 0 deletions subworkflows/local/bam_markduplicates_sambamba/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//
// MARKDUPLICATES AND QC after mapping
//
// For all modules here:
// A when clause condition is defined in the conf/modules.config to determine if the module should be run

include { CRAM_QC_MOSDEPTH_SAMTOOLS } from '../cram_qc_mosdepth_samtools/main'
include { SAMBAMBA_MARKDUP } from '../../../modules/nf-core/sambamba/markdup/main'

workflow BAM_MARKDUPLICATES_SAMBAMBA {
take:
bam // channel: [mandatory] [ meta, bam ]
fasta // channel: [mandatory] [ fasta ]
fasta_fai // channel: [mandatory] [ fasta_fai ]
intervals_bed_combined // channel: [optional] [ intervals_bed ]

main:
versions = Channel.empty()
reports = Channel.empty()

// RUN MARKUPDUPLICATES
bam.view()
SAMBAMBA_MARKDUP(bam)

// bam = SAMBAMBA_MARKDUP.out.bam
// bam.view()

cram = bam
// Join with the crai file
// bam = SAMBAMBA_MARKDUP.out.bam.join(SAMBAMBA_MARKDUPLICATES.out.bai, failOnDuplicate: true, failOnMismatch: true)

// QC on CRAM
// CRAM_QC_MOSDEPTH_SAMTOOLS(bam, fasta, intervals_bed_combined)

// Gather all reports generated
// reports = reports.mix(SAMBAMBA_MARKDUP.out.metrics)
// reports = reports.mix(CRAM_QC_MOSDEPTH_SAMTOOLS.out.reports)

// Gather versions of all tools used
versions = versions.mix(SAMBAMBA_MARKDUP.out.versions)
// versions = versions.mix(CRAM_QC_MOSDEPTH_SAMTOOLS.out.versions)

emit:
cram
reports

versions // channel: [ versions.yml ]
}
20 changes: 19 additions & 1 deletion workflows/sarek.nf
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ include { SAMTOOLS_CONVERT as CRAM_TO_BAM_RECAL } from '../modules/nf-core

// Mark Duplicates (+QC)
include { BAM_MARKDUPLICATES } from '../subworkflows/local/bam_markduplicates/main'
include { BAM_MARKDUPLICATES_SAMBAMBA } from '../subworkflows/local/bam_markduplicates_sambamba/main'
include { BAM_MARKDUPLICATES_SPARK } from '../subworkflows/local/bam_markduplicates_spark/main'
include { BAM_SENTIEON_DEDUP } from '../subworkflows/local/bam_sentieon_dedup/main'

Expand Down Expand Up @@ -611,7 +612,24 @@ workflow SAREK {

// Gather used softwares versions
versions = versions.mix(BAM_SENTIEON_DEDUP.out.versions)
} else {
} else if (params.sambamba_dedup) {
BAM_MARKDUPLICATES_SAMBAMBA(
cram_for_markduplicates,
fasta,
fasta_fai,
intervals_for_preprocessing)

cram_markduplicates_no_spark = BAM_MARKDUPLICATES_SAMBAMBA.out.cram

// Gather QC reports
reports = reports.mix(BAM_MARKDUPLICATES_SAMBAMBA.out.reports.collect{ meta, report -> report })

// Gather used softwares versions
versions = versions.mix(BAM_MARKDUPLICATES_SAMBAMBA.out.versions)
}


else {
BAM_MARKDUPLICATES(
cram_for_markduplicates,
fasta,
Expand Down
Loading