Skip to content

Commit fe766bc

Browse files
authored
Merge pull request #1042 from broadinstitute/sample-qc-tdr-2-14
tdr updates for sample qc
2 parents cdca1d6 + 154fa90 commit fe766bc

File tree

2 files changed

+64
-12
lines changed

2 files changed

+64
-12
lines changed

v03_pipeline/lib/misc/terra_data_repository.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
BIGQUERY_METRICS = [
1313
'collaborator_sample_id',
1414
'predicted_sex',
15+
'contamination_rate',
16+
'percent_bases_at_20x',
17+
'mean_coverage',
1518
]
1619
BIGQUERY_RESOURCE = 'bigquery'
1720
TABLE_NAME_VALIDATION_REGEX = r'datarepo-\w+.datarepo_\w+'

v03_pipeline/lib/tasks/write_sex_check_table_test.py

Lines changed: 61 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from decimal import Decimal
12
from unittest.mock import Mock, patch
23

34
import google.cloud.bigquery
@@ -28,32 +29,80 @@ def test_snv_sex_check_table_task(
2829
iter(
2930
[
3031
google.cloud.bigquery.table.Row(
31-
('SM-NJ8MF', 'Unknown'),
32-
{'collaborator_sample_id': 0, 'predicted_sex': 1},
32+
(
33+
'SM-NJ8MF',
34+
'Unknown',
35+
Decimal('0'),
36+
Decimal('0'),
37+
Decimal('0'),
38+
),
39+
{
40+
'collaborator_sample_id': 0,
41+
'predicted_sex': 1,
42+
'contamination_rate': 2,
43+
'percent_bases_at_20x': 3,
44+
'mean_coverage': 4,
45+
},
3346
),
3447
google.cloud.bigquery.table.Row(
35-
('SM-MWOGC', 'Female'),
36-
{'collaborator_sample_id': 0, 'predicted_sex': 1},
48+
(
49+
'SM-MWOGC',
50+
'Female',
51+
Decimal('0'),
52+
Decimal('0'),
53+
Decimal('0'),
54+
),
55+
{
56+
'collaborator_sample_id': 0,
57+
'predicted_sex': 1,
58+
'contamination_rate': 2,
59+
'percent_bases_at_20x': 3,
60+
'mean_coverage': 4,
61+
},
3762
),
3863
google.cloud.bigquery.table.Row(
39-
('SM-MWKWL', 'Male'),
40-
{'collaborator_sample_id': 0, 'predicted_sex': 1},
64+
('SM-MWKWL', 'Male', Decimal('0'), Decimal('0'), Decimal('0')),
65+
{
66+
'collaborator_sample_id': 0,
67+
'predicted_sex': 1,
68+
'contamination_rate': 2,
69+
'percent_bases_at_20x': 3,
70+
'mean_coverage': 4,
71+
},
4172
),
4273
],
4374
),
4475
iter(
4576
[
4677
google.cloud.bigquery.table.Row(
47-
('SM-NGE65', 'Male'),
48-
{'collaborator_sample_id': 0, 'predicted_sex': 1},
78+
('SM-NGE65', 'Male', Decimal('0'), Decimal('0'), Decimal('0')),
79+
{
80+
'collaborator_sample_id': 0,
81+
'predicted_sex': 1,
82+
'contamination_rate': 2,
83+
'percent_bases_at_20x': 3,
84+
'mean_coverage': 4,
85+
},
4986
),
5087
google.cloud.bigquery.table.Row(
51-
('SM-NGE5G', 'Male'),
52-
{'collaborator_sample_id': 0, 'predicted_sex': 1},
88+
('SM-NGE5G', 'Male', Decimal('0'), Decimal('0'), Decimal('0')),
89+
{
90+
'collaborator_sample_id': 0,
91+
'predicted_sex': 1,
92+
'contamination_rate': 2,
93+
'percent_bases_at_20x': 3,
94+
'mean_coverage': 4,
95+
},
5396
),
5497
google.cloud.bigquery.table.Row(
55-
('SM-NC6LM', 'Male'),
56-
{'collaborator_sample_id': 0, 'predicted_sex': 1},
98+
('SM-NC6LM', 'Male', Decimal('0'), Decimal('0'), Decimal('0')),
99+
{
100+
'collaborator_sample_id': 0,
101+
'predicted_sex': 1,
102+
'contamination_rate': 2,
103+
'percent_bases_at_20x': 3,
104+
'mean_coverage': 4,
105+
},
57106
),
58107
],
59108
),

0 commit comments

Comments
 (0)