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

Add readgroup level stats config option for Picard metrics #910

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.27.3
current_version = 1.27.4
commit = True
tag = False

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ permissions:
contents: read

env:
VERSION: 1.27.3
VERSION: 1.27.4

jobs:
docker:
Expand Down
1 change: 1 addition & 0 deletions configs/defaults/seqr_loader.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ indel_filter_level = 99.0
[cramqc]
assume_sorted = true
num_pcs = 4
readgroup_metrics = false

[qc_thresholds.genome.min]
"MEDIAN_COVERAGE" = 10
Expand Down
10 changes: 8 additions & 2 deletions cpg_workflows/jobs/picard.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from hailtop.batch.job import Job

from cpg_utils import Path
from cpg_utils.config import get_config, image_path, reference_path
from cpg_utils.config import config_retrieve, get_config, image_path, reference_path
from cpg_utils.hail_batch import command, fasta_res_group
from cpg_workflows.filetypes import CramPath
from cpg_workflows.resources import (
Expand Down Expand Up @@ -297,6 +297,12 @@ def picard_collect_metrics(
sorted_output = get_config()['cramqc']['assume_sorted']

assert cram_path.index_path

if config_retrieve(['cramqc', 'readgroup_metrics'], default=False):
readgroup_metrics = "METRIC_ACCUMULATION_LEVEL=READ_GROUP"
else:
readgroup_metrics = "METRIC_ACCUMULATION_LEVEL=SAMPLE"

cmd = f"""\
CRAM=$BATCH_TMPDIR/{cram_path.path.name}
CRAI=$BATCH_TMPDIR/{cram_path.index_path.name}
Expand All @@ -319,7 +325,7 @@ def picard_collect_metrics(
PROGRAM=CollectBaseDistributionByCycle \\
PROGRAM=CollectQualityYieldMetrics \\
METRIC_ACCUMULATION_LEVEL=null \\
METRIC_ACCUMULATION_LEVEL=SAMPLE
{readgroup_metrics}

ls $BATCH_TMPDIR/
cp $BATCH_TMPDIR/prefix.alignment_summary_metrics {j.out_alignment_summary_metrics}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
setup(
name='cpg-workflows',
# This tag is automatically updated by bumpversion
version='1.27.3',
version='1.27.4',
description='CPG workflows for Hail Batch',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
Expand Down