Commit 44e1cf7e authored by van den Berg's avatar van den Berg
Browse files

Use targets file as baitsfile if it is missing

Picard HsMetrics requires both a file containing the targets of the
capture, as well as the actual baits used in the capture. However,
Agilent is refusing to share the baits of their older capture kits.

A common workaround for this issue is to simply specify the targets
file to picard twice.
parent c4ea41c5
Pipeline #4136 passed with stages
in 24 minutes and 54 seconds
......@@ -43,6 +43,12 @@ def process_config():
msg = 'Invalid --configfile: "baitsfile" specified without "targetsfile"'
raise jsonschema.ValidationError(msg)
# If you specify a target file but no baitsfile, we use the targets as
# baits. This is needed because picard HsMetrics needs both a baitfile and
# targets file as input
if 'targetsfile' in config and 'baitsfile' not in config:
set_default('baitsfile', config['targetsfile'])
# A sample name cannot be a substring of another sample, since that breaks picard
# metrics parsing by multiqc
msg = 'Invalid --configfile: sample names should not overlap ("{s1}" is contained in "{s2}")'
"samples": {
"micro": {
"read_groups": {
"lib_01": {
"R1": "tests/data/fastq/micro_R1.fq.gz",
"R2": "tests/data/fastq/micro_R2.fq.gz"
"dbsnp": "tests/data/reference/database.vcf.gz",
"known_sites": ["tests/data/reference/database.vcf.gz"],
"targetsfile": "tests/data/reference/target_genes.bed"
......@@ -295,3 +295,14 @@
- 'BaseRecalibrator.* -L chrM '
- name: integration-targets-only
- integration
command: >
snakemake --use-singularity --singularity-args ' --containall --bind /tmp '
--jobs 1 -w 120 -r -p
--configfile tests/data/config/sample_config_targets_only.json
- path: 'micro/bams/micro.hs_metrics.txt'
- path: 'multiqc_report/multiqc_data/multiqc_picard_HsMetrics.json'
......@@ -47,6 +47,16 @@
- 'Invalid --configfile: "baitsfile" specified without "targetsfile"'
- name: sanity-targets-only
- sanity
command: >
snakemake -s Snakefile -n --configfile
- rule hs_metrics
- name: sanity-samples-overlapping-name
- sanity
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment