From 6284bc1d5c3059d0c794479e20be318a4a90a3ea Mon Sep 17 00:00:00 2001 From: Susana Posada-Cespedes Date: Thu, 21 May 2020 11:38:36 +0200 Subject: [PATCH] Add user-configurable options in the contamination module --- rules/common.smk | 4 ++++ rules/contamination.smk | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/rules/common.smk b/rules/common.smk index f4adedfb2..00215acb5 100644 --- a/rules/common.smk +++ b/rules/common.smk @@ -132,11 +132,15 @@ class VpipeConfig(object): 'time': __RECORD__(value=235, type=int), 'threads': __RECORD__(value=0, type=int), 'conda': __RECORD__(value='', type=str), + + 'ref_panel': __RECORD__(value='references/5-Virus-Mix.fasta', type=str), }), ('coverage_QA', { 'mem': __RECORD__(value=1250, type=int), 'time': __RECORD__(value=235, type=int), 'conda': __RECORD__(value=f'{VPIPE_BASEDIR}/envs/smallgenomeutilities.yaml', type=str), + + 'target': __RECORD__(value='HXB2:6614-6812,7109-7217,7376-7478,7601-7634', type=str), }), ('msa', { 'mem': __RECORD__(value=10000, type=int), diff --git a/rules/contamination.smk b/rules/contamination.smk index bee2238ed..d266f28e8 100644 --- a/rules/contamination.smk +++ b/rules/contamination.smk @@ -10,7 +10,7 @@ __email__ = "v-pipe@bsse.ethz.ch" rule bwa_QA: input: patient_ref = "{dataset}/references/ref_{kind}.fasta", - virusmix_ref = "references/5-Virus-Mix.fasta", + virusmix_ref = config.bwa_QA['ref_panel'], FASTQ = input_align, output: SAM = temp("{dataset}/QA_alignments/bwa_QA_{kind}.sam"), @@ -63,6 +63,7 @@ rule coverage_QA: scratch = '1250', mem = config.coverage_QA['mem'], time = config.coverage_QA['time'], + TARGET = config.coverage_QA['target'], COV_STATS = config.applications['coverage_stats'], log: outfile = "{dataset}/QA_alignments/coverage_QA_{kind}.out.log", @@ -86,7 +87,7 @@ rule coverage_QA: # 2. collect coverage stats # we only collect statistics in the loop regions # of HIV-1 in order - {params.COV_STATS} -t HXB2:6614-6812,7109-7217,7376-7478,7601-7634 -i {input.BAM} -o {output} -m {input.MSA} --select "${{CONSENSUS_NAME}}" > {log.outfile} 2> >(tee {log.errfile} >&2) + {params.COV_STATS} -t {params.TARGET} -i {input.BAM} -o {output} -m {input.MSA} --select "${{CONSENSUS_NAME}}" > {log.outfile} 2> >(tee {log.errfile} >&2) """