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

Feat/vqsr #183

Draft
wants to merge 7 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
45 changes: 45 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def enableOutput(state) {
"add_ped": params.add_ped,
"normalize": params.normalize,
"filter": params.filter,
"vqsr": params.vqsr,
"original": true
]

Expand Down Expand Up @@ -257,6 +258,50 @@ process {
] // SAVE
}

if(params.vqsr) {
withName: "^.*VCF_VQSR_GATK4:GATK4_VARIANTRECALIBRATOR_SNPS" {
// -an DP => This option is not advised for WES runs, see if this can somehow still be added to WGS runs
ext.args = [
"-an QD",
"-an MQ",
"-an MQRankSum",
"-an ReadPosRankSum",
"-an FS",
"-an SOR",
"-mode SNP"
].join(" ")
}

withName: "^.*VCF_VQSR_GATK4:GATK4_VARIANTRECALIBRATOR_INDELS" {
// -an DP => This option is not advised for WES runs, see if this can somehow still be added to WGS runs
ext.args = [
"-an QD",
"-an MQRankSum",
"-an ReadPosRankSum",
"-an FS",
"-an SOR",
"-mode INDEL"
].join(" ")
}

withName: "^.*VCF_VQSR_GATK4:GATK4_APPLYVQSR_SNPS" {
ext.args = "--truth-sensitivity-filter-level 99.9 -mode SNP"
ext.prefix = { "${meta.id}_snp" }
}

withName: "^.*VCF_VQSR_GATK4:GATK4_APPLYVQSR_INDELS" {
ext.args = "--truth-sensitivity-filter-level 99.9 -mode INDEL"
ext.prefix = enableOutput("vqsr") ? final_prefix : { "${meta.id}.vqsr" }
publishDir = [
enabled: enableOutput("vqsr"),
overwrite: true,
path: final_output,
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
] // SAVE
}
}

if(params.filter){
withName: "^.*CRAM_CALL_GENOTYPE_GATK4:VCF_FILTER_BCFTOOLS:FILTER_1\$" {
ext.prefix = { "${meta.id}_filtered_snps" }
Expand Down
35 changes: 35 additions & 0 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ params.alphamissense = getGenomeAttribute('alphamissense')
params.alphamissense_tbi = getGenomeAttribute('alphamissense_tbi')
params.vcfanno_resources = getGenomeAttribute('vcfanno_resources')
params.vcfanno_config = getGenomeAttribute('vcfanno_config')
params.hapmap = getGenomeAttribute('hapmap')
params.hapmap_tbi = getGenomeAttribute('hapmap_tbi')
params.omni_1000G = getGenomeAttribute('omni_1000G')
params.omni_1000G_tbi = getGenomeAttribute('omni_1000G_tbi')
params.snps_1000G = getGenomeAttribute('snps_1000G')
params.snps_1000G_tbi = getGenomeAttribute('snps_1000G_tbi')
params.indels_1000G = getGenomeAttribute('indels_1000G')
params.indels_1000G_tbi = getGenomeAttribute('indels_1000G_tbi')

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -80,6 +88,24 @@ if (params.output_suffix && callers.size() > 1) {
error("Cannot use --output_suffix with more than one caller")
}

if(params.vqsr) {
if(!params.hapmap || !params.hapmap_tbi) {
error("Please provide --hapmap and --hapmap_tbi when using --vqsr")
}
if(!params.omni_1000G || !params.omni_1000G_tbi) {
error("Please provide --omni_1000G and --omni_1000G_tbi when using --vqsr")
}
if(!params.snps_1000G || !params.snps_1000G_tbi) {
error("Please provide --snps_1000G and --snps_1000G_tbi when using --vqsr")
}
if(!params.indels_1000G || !params.indels_1000G_tbi) {
error("Please provide --indels_1000G and --indels_1000G_tbi when using --vqsr")
}
if(!params.dbsnp || !params.dbsnp_tbi) {
error("Please provide --dbsnp and --dbsnp_tbi when using --vqsr")
}
}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CONFIG FILES
Expand Down Expand Up @@ -150,6 +176,14 @@ workflow NFCMGG_GERMLINE {
params.automap_repeats,
params.automap_panel,
params.outdir,
params.hapmap,
params.hapmap_tbi,
params.omni_1000G,
params.omni_1000G_tbi,
params.snps_1000G,
params.snps_1000G_tbi,
params.indels_1000G,
params.indels_1000G_tbi,

// Boolean inputs
params.dragstr,
Expand All @@ -169,6 +203,7 @@ workflow NFCMGG_GERMLINE {
params.vep_mastermind,
params.vep_eog,
params.vep_alphamissense,
params.vqsr,

// Value inputs
params.genome,
Expand Down
10 changes: 10 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@
"installed_by": ["vcf_annotate_ensemblvep_snpeff"],
"patch": "modules/nf-core/ensemblvep/vep/ensemblvep-vep.diff"
},
"gatk4/applyvqsr": {
"branch": "master",
"git_sha": "cee8fe33d3ef1a220dee67dac75a32f7c872f63f",
"installed_by": ["modules"]
},
"gatk4/calibratedragstrmodel": {
"branch": "master",
"git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980",
Expand Down Expand Up @@ -111,6 +116,11 @@
"installed_by": ["modules"],
"patch": "modules/nf-core/gatk4/haplotypecaller/gatk4-haplotypecaller.diff"
},
"gatk4/variantrecalibrator": {
"branch": "master",
"git_sha": "d742e3143f2ccb8853c29b35cfcf50b5e5026980",
"installed_by": ["modules"]
},
"gawk": {
"branch": "master",
"git_sha": "dc3527855e7358c6d8400828754c0caa5f11698f",
Expand Down
7 changes: 7 additions & 0 deletions modules/nf-core/gatk4/applyvqsr/environment.yml

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

63 changes: 63 additions & 0 deletions modules/nf-core/gatk4/applyvqsr/main.nf

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

76 changes: 76 additions & 0 deletions modules/nf-core/gatk4/applyvqsr/meta.yml

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

5 changes: 5 additions & 0 deletions modules/nf-core/gatk4/applyvqsr/tests/allelspecificity.config

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

Loading
Loading