cg 83.20.2__py3-none-any.whl → 83.20.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cg/__init__.py +1 -1
- cg/services/sequencing_qc_service/quality_checks/utils.py +13 -35
- {cg-83.20.2.dist-info → cg-83.20.3.dist-info}/METADATA +1 -1
- {cg-83.20.2.dist-info → cg-83.20.3.dist-info}/RECORD +6 -6
- {cg-83.20.2.dist-info → cg-83.20.3.dist-info}/WHEEL +0 -0
- {cg-83.20.2.dist-info → cg-83.20.3.dist-info}/entry_points.txt +0 -0
cg/__init__.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
__title__ = "cg"
|
|
2
|
-
__version__ = "83.20.
|
|
2
|
+
__version__ = "83.20.3"
|
|
@@ -63,9 +63,6 @@ def express_sample_has_enough_reads(sample: Sample) -> bool:
|
|
|
63
63
|
Checks if given express sample has enough reads. Gets the threshold from the sample's
|
|
64
64
|
application version.
|
|
65
65
|
"""
|
|
66
|
-
if sample.is_external:
|
|
67
|
-
LOG.info(f"Sample {sample.internal_id} is external, skipping check.")
|
|
68
|
-
return True
|
|
69
66
|
express_reads_threshold: int = get_express_reads_threshold_for_sample(sample)
|
|
70
67
|
enough_reads: bool = sample.reads >= express_reads_threshold
|
|
71
68
|
if not enough_reads:
|
|
@@ -74,9 +71,6 @@ def express_sample_has_enough_reads(sample: Sample) -> bool:
|
|
|
74
71
|
|
|
75
72
|
|
|
76
73
|
def express_sample_has_enough_yield(sample: Sample) -> bool:
|
|
77
|
-
if sample.is_external:
|
|
78
|
-
LOG.info(f"Sample {sample.internal_id} is external, skipping check.")
|
|
79
|
-
return True
|
|
80
74
|
if not sample.hifi_yield:
|
|
81
75
|
LOG.debug(f"Sample {sample.internal_id} has no hifi yield.")
|
|
82
76
|
return False
|
|
@@ -142,34 +136,26 @@ def any_sample_in_case_has_reads(case: Case) -> bool:
|
|
|
142
136
|
def raw_data_case_pass_qc(case: Case) -> bool:
|
|
143
137
|
if is_case_ready_made_library(case):
|
|
144
138
|
return ready_made_library_case_pass_sequencing_qc(case)
|
|
145
|
-
if
|
|
139
|
+
if is_first_sample_yield_based_and_processed(case):
|
|
146
140
|
return all(sample_has_enough_hifi_yield(sample) for sample in case.samples)
|
|
147
|
-
elif
|
|
141
|
+
elif is_first_sample_reads_based_and_processed(case):
|
|
148
142
|
return all(sample_has_enough_reads(sample) for sample in case.samples)
|
|
149
|
-
elif are_all_samples_external(case):
|
|
150
|
-
LOG.info(f"All samples in case {case.internal_id} are external, QC passes.")
|
|
151
|
-
return True
|
|
152
143
|
LOG.warning(f"Not all samples for case {case.internal_id} have been post-processed.")
|
|
153
144
|
return False
|
|
154
145
|
|
|
155
146
|
|
|
156
|
-
def
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
)
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
def is_any_processed_sample_read_based(case: Case) -> bool:
|
|
165
|
-
return any(
|
|
166
|
-
any(metric.type == DeviceType.ILLUMINA for metric in sample.sample_run_metrics)
|
|
167
|
-
for sample in case.samples
|
|
168
|
-
)
|
|
147
|
+
def is_first_sample_yield_based_and_processed(case: Case) -> bool:
|
|
148
|
+
sample: Sample = case.samples[0]
|
|
149
|
+
if metrics := sample.sample_run_metrics:
|
|
150
|
+
return metrics[0].type == DeviceType.PACBIO
|
|
151
|
+
return False
|
|
169
152
|
|
|
170
153
|
|
|
171
|
-
def
|
|
172
|
-
|
|
154
|
+
def is_first_sample_reads_based_and_processed(case: Case) -> bool:
|
|
155
|
+
sample: Sample = case.samples[0]
|
|
156
|
+
if metrics := sample.sample_run_metrics:
|
|
157
|
+
return metrics[0].type == DeviceType.ILLUMINA
|
|
158
|
+
return False
|
|
173
159
|
|
|
174
160
|
|
|
175
161
|
def is_case_express_priority(case: Case) -> bool:
|
|
@@ -219,9 +205,6 @@ def sample_has_enough_reads(sample: Sample) -> bool:
|
|
|
219
205
|
"""
|
|
220
206
|
Check if the sample has more or equal reads than the expected reads for the sample.
|
|
221
207
|
"""
|
|
222
|
-
if sample.is_external:
|
|
223
|
-
LOG.info(f"Sample {sample.internal_id} is external, skipping check.")
|
|
224
|
-
return True
|
|
225
208
|
enough_reads: bool = sample.reads >= sample.expected_reads_for_sample
|
|
226
209
|
if not enough_reads:
|
|
227
210
|
LOG.warning(f"Sample {sample.internal_id} has too few reads.")
|
|
@@ -235,12 +218,7 @@ def sample_has_enough_hifi_yield(sample: Sample) -> bool:
|
|
|
235
218
|
Raises:
|
|
236
219
|
ApplicationDoesNotHaveHiFiYieldError if the sample doesn't have expected HiFi yield.
|
|
237
220
|
"""
|
|
238
|
-
if sample.
|
|
239
|
-
# An external sample will have None as yield in StatusDB
|
|
240
|
-
LOG.info(f"Sample {sample.internal_id} is external, skipping check.")
|
|
241
|
-
return True
|
|
242
|
-
|
|
243
|
-
if sample.expected_hifi_yield is None:
|
|
221
|
+
if not sample.expected_hifi_yield:
|
|
244
222
|
raise ApplicationDoesNotHaveHiFiYieldError(
|
|
245
223
|
f"Application for sample {sample.internal_id} does not have target HiFi yield."
|
|
246
224
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
cg/__init__.py,sha256=
|
|
1
|
+
cg/__init__.py,sha256=SYjJH-I0oik2cgySkcSsSP4me93_hWY-3zONHPfuiNc,41
|
|
2
2
|
cg/apps/__init__.py,sha256=pYf0vxo4iYQqURzFRYzqpOCdV8Cm9MWx0GHvJOz0EMg,315
|
|
3
3
|
cg/apps/coverage/__init__.py,sha256=dJtsmNf8tODE2-VEomMIoYA7ugLYZAk_upsfOQCZeF8,27
|
|
4
4
|
cg/apps/coverage/api.py,sha256=e_ozC3QeNKoEfpjjMaL-XjeBLtz-JySWccrtw0E9mLM,2940
|
|
@@ -853,7 +853,7 @@ cg/services/sample_run_metrics_service/sample_run_metrics_service.py,sha256=aQvO
|
|
|
853
853
|
cg/services/sample_run_metrics_service/utils.py,sha256=BwICxptnhGg8oBghCLhzHaMNu0LuEV40cSYz1e8mB0A,829
|
|
854
854
|
cg/services/sequencing_qc_service/__init__.py,sha256=OaL9dyyI6B8uRjopTIoD1zcX_H-SbGj46ZM-V-aoq6w,88
|
|
855
855
|
cg/services/sequencing_qc_service/quality_checks/checks.py,sha256=qdcHRwZD7uxrOmacyiAG4-EN6nG5z-r4rLxcReU5kSI,2593
|
|
856
|
-
cg/services/sequencing_qc_service/quality_checks/utils.py,sha256=
|
|
856
|
+
cg/services/sequencing_qc_service/quality_checks/utils.py,sha256=2WN7S4kYsN_9iYPx7d4coAYcWHeueQWrPP2pJ8ztMMc,8969
|
|
857
857
|
cg/services/sequencing_qc_service/sequencing_qc_service.py,sha256=QQHShCiq-OAobzHnTKQ1buQVyDIqGbVEPyPM4WEV9B0,2257
|
|
858
858
|
cg/services/sequencing_qc_service/utils.py,sha256=5WHJltBICfRODEzFVPFTdCbGNaMKCaVeOswHgIOGgFc,199
|
|
859
859
|
cg/services/slurm_service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -922,7 +922,7 @@ cg/utils/flask/enum.py,sha256=xwNVtFPkSzoloJctLHu7obRyxcng1GJrhkeYkqwf9tw,1052
|
|
|
922
922
|
cg/utils/mapping.py,sha256=oZpZW2kgsbtAP2FZ7RtRPELiEE1zZk_nAGisHGtCOUo,491
|
|
923
923
|
cg/utils/time.py,sha256=_VOglhrFEZ5cwHK1U1g36SdwzB7UvV-Nvlt4ymuZUho,1501
|
|
924
924
|
cg/utils/utils.py,sha256=RciI_UhWcnG_pMZrmQZ1ZYb-O1N0DweTYMmhE0SIRgQ,1410
|
|
925
|
-
cg-83.20.
|
|
926
|
-
cg-83.20.
|
|
927
|
-
cg-83.20.
|
|
928
|
-
cg-83.20.
|
|
925
|
+
cg-83.20.3.dist-info/METADATA,sha256=G5EW48rAnANU-r-OHcWpCiHdG76nYpwnYOVOP-Fk144,4940
|
|
926
|
+
cg-83.20.3.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
|
|
927
|
+
cg-83.20.3.dist-info/entry_points.txt,sha256=q5f47YQQGltzK_xnIq1mDopRXXEItr85Xe1BCtG-Wts,39
|
|
928
|
+
cg-83.20.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|