Skip to content

Commit

Permalink
allow to input existing genomicsdb
Browse files Browse the repository at this point in the history
  • Loading branch information
FriederikeHanssen committed Jun 17, 2023
1 parent 58f9d99 commit bc204e1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ params {
ignore_soft_clipped_bases = false // no --dont-use-soft-clipped-bases for GATK Mutect2
wes = false // Set to true, if data is exome/targeted sequencing data. Used to use correct models in various variant callers
joint_germline = false // g.vcf & joint germline calling are not run by default if HaplotypeCaller is selected
genomicsdb_workspace = null // GenomicsDB Workspace

// Annotation
vep_out_format = 'vcf'
Expand Down
7 changes: 5 additions & 2 deletions subworkflows/local/bam_joint_calling_germline_gatk/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ workflow BAM_JOINT_CALLING_GERMLINE_GATK {
resource_snps_vcf
resource_snps_tbi
known_snps_vqsr
genomicsdb_workspace

main:
versions = Channel.empty()
Expand All @@ -36,10 +37,12 @@ workflow BAM_JOINT_CALLING_GERMLINE_GATK {
gendb_input = input
.map{ meta, gvcf, tbi, intervals -> [ [ id:'joint_variant_calling', intervals_name:intervals.simpleName, num_intervals:meta.num_intervals ], gvcf, tbi, intervals ] }
.groupTuple(by:[0, 3])
.map{ meta, gvcf, tbi, intervals -> [ meta, gvcf, tbi, intervals, [], [] ] }
.map{ meta, gvcf, tbi, intervals -> [ meta, gvcf, tbi, intervals, [] ] }
.combine(genomicsdb_workspace)

// Convert all sample vcfs into a genomicsdb workspace using genomicsdbimport
GATK4_GENOMICSDBIMPORT(gendb_input, false, false, false)
// If genomicsdb_workspace, then the boolean will evaluate to true, hacky work-around for the module
GATK4_GENOMICSDBIMPORT(gendb_input, false, genomicsdb_workspace, false)

genotype_input = GATK4_GENOMICSDBIMPORT.out.genomicsdb.map{ meta, genomicsdb -> [ meta, genomicsdb, [], [], [] ] }

Expand Down
4 changes: 3 additions & 1 deletion subworkflows/local/bam_variant_calling_germline_all/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ workflow BAM_VARIANT_CALLING_GERMLINE_ALL {
known_sites_snps_tbi
known_snps_vqsr
joint_germline // boolean: [mandatory] [default: false] joint calling of germline variants
genomicsdb_workspace

main:
versions = Channel.empty()
Expand Down Expand Up @@ -141,7 +142,8 @@ workflow BAM_VARIANT_CALLING_GERMLINE_ALL {
known_indels_vqsr,
known_sites_snps,
known_sites_snps_tbi,
known_snps_vqsr)
known_snps_vqsr,
genomicsdb_workspace)

vcf_haplotypecaller = BAM_JOINT_CALLING_GERMLINE_GATK.out.genotype_vcf
versions = versions.mix(BAM_JOINT_CALLING_GERMLINE_GATK.out.versions)
Expand Down
14 changes: 5 additions & 9 deletions workflows/sarek.nf
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,6 @@ if (params.tools && (params.tools.split(',').contains('ascat') || params.tools.s
}
}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IMPORT LOCAL MODULES/SUBWORKFLOWS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

// Initialize file channels based on params, defined in the params.genomes[params.genome] scope
ascat_alleles = params.ascat_alleles ? Channel.fromPath(params.ascat_alleles).collect() : Channel.empty()
ascat_loci = params.ascat_loci ? Channel.fromPath(params.ascat_loci).collect() : Channel.empty()
Expand Down Expand Up @@ -161,8 +155,9 @@ vep_genome = params.vep_genome ?: Channel.empty()
vep_species = params.vep_species ?: Channel.empty()

// Initialize files channels based on params, not defined within the params.genomes[params.genome] scope
snpeff_cache = params.snpeff_cache ? Channel.fromPath(params.snpeff_cache).collect() : []
vep_cache = params.vep_cache ? Channel.fromPath(params.vep_cache).collect() : []
genomicsdb_workspace = params.genomicsdb_workspace ? Channel.fromPath(params.genomicsdb_workspace).collect() : []
snpeff_cache = params.snpeff_cache ? Channel.fromPath(params.snpeff_cache).collect() : []
vep_cache = params.vep_cache ? Channel.fromPath(params.vep_cache).collect() : []

vep_extra_files = []

Expand Down Expand Up @@ -936,7 +931,8 @@ workflow SAREK {
known_sites_snps,
known_sites_snps_tbi,
known_snps_vqsr,
params.joint_germline)
params.joint_germline,
genomicsdb_workspace)

// TUMOR ONLY VARIANT CALLING
BAM_VARIANT_CALLING_TUMOR_ONLY_ALL(
Expand Down

0 comments on commit bc204e1

Please sign in to comment.