Skip to content

Commit

Permalink
Merge pull request #372 from maxulysse/dev_cf_contamination
Browse files Browse the repository at this point in the history
feat: add contamination parameter for Control-FREEC
  • Loading branch information
maxulysse authored May 12, 2021
2 parents 4be42d6 + 3bc9356 commit 5e59844
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
16 changes: 11 additions & 5 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,14 @@ def helpMessage() {
Requires that --ascat_ploidy is set
--cf_coeff [str] Control-FREEC coefficientOfVariation
Default: ${params.cf_coeff}
--cf_contamination_adjustment[bool] Control-FREEC contaminationAdjustment
Default: Disabled
--cf_contamination [int] Control-FREEC contamination value
Default: Disabled
--cf_ploidy [str] Control-FREEC ploidy
Default: ${params.cf_ploidy}
--cf_window [int] Control-FREEC window size
Default: Disabled
--cf_contamination_adjustment[bool] Control-FREEC contaminationAdjustment
Default: Disabled
--generate_gvcf [bool] Enable g.vcf output from GATK HaplotypeCaller
--no_strelka_bp [bool] Will not use Manta candidateSmallIndels for Strelka (not recommended by Best Practices)
--pon [file] Panel-of-normals VCF (bgzipped) for GATK Mutect2 / Sentieon TNscope
Expand Down Expand Up @@ -429,10 +431,11 @@ if ('ascat' in tools) {

if ('controlfreec' in tools) {
summary['Control-FREEC'] = "Options"
if (params.cf_window) summary['window'] = params.cf_window
if (params.cf_coeff) summary['coefficientOfVariation'] = params.cf_coeff
if (params.cf_ploidy) summary['ploidy'] = params.cf_ploidy
if (params.cf_contamination) summary['contamination'] = params.cf_contamination
if (params.cf_contamination_adjustment) summary['contaminationAdjustment'] = params.cf_contamination_adjustment
if (params.cf_ploidy) summary['ploidy'] = params.cf_ploidy
if (params.cf_window) summary['window'] = params.cf_window
}

if ('haplotypecaller' in tools) summary['GVCF'] = params.generate_gvcf ? 'Yes' : 'No'
Expand Down Expand Up @@ -3365,6 +3368,7 @@ process ControlFREEC {
breakPointType = params.target_bed ? "4" : "2"
mappabilitystr = params.mappability ? "gemMappabilityFile = \${PWD}/${mappability}" : ""
contamination_adjustment = params.cf_contamination_adjustment ? "contaminationAdjustment = TRUE" : ""
contamination_value = params.cf_contamination ? "contamination = ${params.cf_contamination}" : ""
"""
touch ${config}
echo "[general]" >> ${config}
Expand All @@ -3383,6 +3387,7 @@ process ControlFREEC {
echo "${coeffvar}" >> ${config}
echo "${mappabilitystr}" >> ${config}
echo "${contamination_adjustment}" >> ${config}
echo "${contamination_value}" >> ${config}
echo "" >> ${config}
echo "[control]" >> ${config}
Expand Down Expand Up @@ -3450,7 +3455,7 @@ process ControlFREECSingle {
breakPointType = params.target_bed ? "4" : "2"
mappabilitystr = params.mappability ? "gemMappabilityFile = \${PWD}/${mappability}" : ""
contamination_adjustment = params.cf_contamination_adjustment ? "contaminationAdjustment = TRUE" : ""

contamination_value = params.cf_contamination ? "contamination = ${params.cf_contamination}" : ""
"""
touch ${config}
echo "[general]" >> ${config}
Expand All @@ -3469,6 +3474,7 @@ process ControlFREECSingle {
echo "${coeffvar}" >> ${config}
echo "${mappabilitystr}" >> ${config}
echo "${contamination_adjustment}" >> ${config}
echo "${contamination_value}" >> ${config}
echo "" >> ${config}
echo "[sample]" >> ${config}
Expand Down
3 changes: 2 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ params {
ascat_ploidy = null // Use default value
ascat_purity = null // Use default value
cf_coeff = "0.05" // default value for Control-FREEC
cf_contamination = null // by default not specified in Control-FREEC
cf_contamination_adjustment = null // by default we are not using this in Control-FREEC
cf_ploidy = "2" // you can use 2,3,4
cf_window = null // by default we are not using this in Control-FREEC
cf_contamination_adjustment = null // by default we are not using this in Control-FREEC
generate_gvcf = null // g.vcf are not produced by HaplotypeCaller by default
no_strelka_bp = null // Strelka will use Manta candidateSmallIndels if available
pon = false // No default PON (Panel of Normals) file for GATK Mutect2 / Sentieon TNscope
Expand Down
6 changes: 6 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,12 @@
"fa_icon": "fas fa-wrench",
"description": "Overwrite Control-FREEC contaminationAdjustement"
},
"cf_contamination": {
"type": "string",
"default": "null",
"fa_icon": "fas fa-wrench",
"description": "Design known contamination value for Control-FREEC"
},
"cf_ploidy": {
"type": "string",
"default": "2",
Expand Down

0 comments on commit 5e59844

Please sign in to comment.