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

Parabricks alignment #1444

Closed
wants to merge 8 commits into from
Closed
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"]
},
"parabricks/fq2bam": {
"branch": "master",
"git_sha": "2fe1d9713a234768540b9fb0ee515e52dc613ddf",
"installed_by": ["modules"]
},
"samblaster": {
"branch": "master",
"git_sha": "310850152f3e1dec6ba28b28e1f1cb9ab8660a49",
Expand Down
90 changes: 90 additions & 0 deletions modules/nf-core/parabricks/fq2bam/main.nf

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

83 changes: 83 additions & 0 deletions modules/nf-core/parabricks/fq2bam/meta.yml

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

Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@ include { BWAMEM2_MEM } from '../../../modules/nf-core/bwamem2/mem/ma
include { BWA_MEM as BWAMEM1_MEM } from '../../../modules/nf-core/bwa/mem/main'
include { DRAGMAP_ALIGN } from '../../../modules/nf-core/dragmap/align/main'
include { SENTIEON_BWAMEM } from '../../../modules/nf-core/sentieon/bwamem/main'
include { PARABRICKS_FQ2BAM } from '../../../modules/nf-core/parabricks/fq2bam/main'

workflow FASTQ_ALIGN_BWAMEM_MEM2_DRAGMAP_SENTIEON {
take:
reads // channel: [mandatory] meta, reads
// interval_file // channel: [optional for parabricks] intervals_bed_combined
index // channel: [mandatory] index
sort // boolean: [mandatory] true -> sort, false -> don't sort
fasta
fasta_fai
// known_sites // channel [optional for parabricks] known_sites_indels

main:

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

Expand All @@ -28,6 +30,9 @@ workflow FASTQ_ALIGN_BWAMEM_MEM2_DRAGMAP_SENTIEON {
DRAGMAP_ALIGN(reads, index, [[id:'no_fasta'], []], sort) // If aligner is dragmap
// The sentieon-bwamem-module does sorting as part of the conversion from sam to bam.
SENTIEON_BWAMEM(reads, index, fasta, fasta_fai) // If aligner is sentieon-bwamem
// The parabricks-fq2bam module performs alignment and sorting as part of the conversion from fastq to bam.
// Additionally, it can perform mark duplicates and generate a bqsr table (input for parabricks-applybqsr module)
PARABRICKS_FQ2BAM(reads.map{meta, reads -> [meta, reads, []] } , fasta, index, [])

// Get the bam files from the aligner
// Only one aligner is run
Expand All @@ -36,8 +41,15 @@ workflow FASTQ_ALIGN_BWAMEM_MEM2_DRAGMAP_SENTIEON {
bam = bam.mix(BWAMEM2_MEM.out.bam)
bam = bam.mix(DRAGMAP_ALIGN.out.bam)
bam = bam.mix(SENTIEON_BWAMEM.out.bam_and_bai.map{ meta, bam, bai -> [ meta, bam ] })
bam = bam.mix(PARABRICKS_FQ2BAM.out.bam)

bai = SENTIEON_BWAMEM.out.bam_and_bai.map{ meta, bam, bai -> [ meta, bai ] }
bai = bai.mix(PARABRICKS_FQ2BAM.out.bai)

// Optional outputs for parabricks_fq2bam
qc_metrics = PARABRICKS_FQ2BAM.out.qc_metrics
bqsr_table = PARABRICKS_FQ2BAM.out.bqsr_table
duplicate_metrics = PARABRICKS_FQ2BAM.out.duplicate_metrics

// Gather reports of all tools used
reports = reports.mix(DRAGMAP_ALIGN.out.log)
Expand All @@ -47,10 +59,14 @@ workflow FASTQ_ALIGN_BWAMEM_MEM2_DRAGMAP_SENTIEON {
versions = versions.mix(BWAMEM2_MEM.out.versions)
versions = versions.mix(DRAGMAP_ALIGN.out.versions)
versions = versions.mix(SENTIEON_BWAMEM.out.versions)
versions = versions.mix(PARABRICKS_FQ2BAM.out.versions)

emit:
bam // channel: [ [meta], bam ]
bai // channel: [ [meta], bai ]
qc_metrics // file: qc_metrics/alignment.txt
bqsr_table // file: *.table
duplicate_metrics // file: duplicate-metrics.txt
reports
versions // channel: [ versions.yml ]
}
6 changes: 3 additions & 3 deletions workflows/sarek/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ workflow SAREK {
versions = versions.mix(FASTQ_ALIGN_BWAMEM_MEM2_DRAGMAP_SENTIEON.out.versions)
}

if (params.step in ['mapping', 'markduplicates']) {
if (params.step in ['mapping', 'markduplicates'] && !params.step in ['parabricks']) {

// ch_cram_no_markduplicates_restart = Channel.empty()
cram_markduplicates_no_spark = Channel.empty()
Expand Down Expand Up @@ -437,7 +437,7 @@ workflow SAREK {
else CHANNEL_MARKDUPLICATES_CREATE_CSV(ch_md_cram_for_restart, csv_subfolder, params.outdir, params.save_output_as_bam)
}

if (params.step in ['mapping', 'markduplicates', 'prepare_recalibration']) {
if (params.step in ['mapping', 'markduplicates', 'prepare_recalibration'] && !params.step in ['parabricks']) {

// Run if starting from step "prepare_recalibration"
if (params.step == 'prepare_recalibration') {
Expand Down Expand Up @@ -473,7 +473,7 @@ workflow SAREK {
}

// STEP 3: Create recalibration tables
if (!(params.skip_tools && params.skip_tools.split(',').contains('baserecalibrator'))) {
if (!(params.skip_tools && params.skip_tools.split(',').contains('baserecalibrator')) && !params.step in ['parabricks']) {

ch_table_bqsr_no_spark = Channel.empty()
ch_table_bqsr_spark = Channel.empty()
Expand Down
Loading