cg 83.20.0__py3-none-any.whl → 83.20.2__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/server/admin.py +8 -2
- cg/services/sequencing_qc_service/quality_checks/utils.py +35 -13
- {cg-83.20.0.dist-info → cg-83.20.2.dist-info}/METADATA +1 -1
- {cg-83.20.0.dist-info → cg-83.20.2.dist-info}/RECORD +7 -7
- {cg-83.20.0.dist-info → cg-83.20.2.dist-info}/WHEEL +0 -0
- {cg-83.20.0.dist-info → cg-83.20.2.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.2"
|
cg/server/admin.py
CHANGED
|
@@ -911,6 +911,7 @@ class PacbioSmrtCellMetricsView(BaseView):
|
|
|
911
911
|
|
|
912
912
|
column_list = (
|
|
913
913
|
"internal_id",
|
|
914
|
+
"sequencing_run.run_name",
|
|
914
915
|
"sequencing_run.run_id",
|
|
915
916
|
"movie_name",
|
|
916
917
|
"well",
|
|
@@ -935,9 +936,14 @@ class PacbioSmrtCellMetricsView(BaseView):
|
|
|
935
936
|
"internal_id": view_pacbio_sample_sequencing_metrics_link,
|
|
936
937
|
"model": view_smrt_cell_model,
|
|
937
938
|
}
|
|
938
|
-
column_labels = {"sequencing_run.run_id": "Run ID"}
|
|
939
|
+
column_labels = {"sequencing_run.run_name": "Run Name", "sequencing_run.run_id": "Run ID"}
|
|
939
940
|
column_default_sort = ("completed_at", True)
|
|
940
|
-
column_searchable_list = [
|
|
941
|
+
column_searchable_list = [
|
|
942
|
+
"device.internal_id",
|
|
943
|
+
"movie_name",
|
|
944
|
+
"sequencing_run.run_id",
|
|
945
|
+
"sequencing_run.run_name",
|
|
946
|
+
]
|
|
941
947
|
column_sortable_list = [
|
|
942
948
|
("internal_id", "device.internal_id"),
|
|
943
949
|
"started_at",
|
|
@@ -63,6 +63,9 @@ 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
|
|
66
69
|
express_reads_threshold: int = get_express_reads_threshold_for_sample(sample)
|
|
67
70
|
enough_reads: bool = sample.reads >= express_reads_threshold
|
|
68
71
|
if not enough_reads:
|
|
@@ -71,6 +74,9 @@ def express_sample_has_enough_reads(sample: Sample) -> bool:
|
|
|
71
74
|
|
|
72
75
|
|
|
73
76
|
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
|
|
74
80
|
if not sample.hifi_yield:
|
|
75
81
|
LOG.debug(f"Sample {sample.internal_id} has no hifi yield.")
|
|
76
82
|
return False
|
|
@@ -136,26 +142,34 @@ def any_sample_in_case_has_reads(case: Case) -> bool:
|
|
|
136
142
|
def raw_data_case_pass_qc(case: Case) -> bool:
|
|
137
143
|
if is_case_ready_made_library(case):
|
|
138
144
|
return ready_made_library_case_pass_sequencing_qc(case)
|
|
139
|
-
if
|
|
145
|
+
if is_any_processed_sample_yield_based(case):
|
|
140
146
|
return all(sample_has_enough_hifi_yield(sample) for sample in case.samples)
|
|
141
|
-
elif
|
|
147
|
+
elif is_any_processed_sample_read_based(case):
|
|
142
148
|
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
|
|
143
152
|
LOG.warning(f"Not all samples for case {case.internal_id} have been post-processed.")
|
|
144
153
|
return False
|
|
145
154
|
|
|
146
155
|
|
|
147
|
-
def
|
|
148
|
-
sample
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
156
|
+
def is_any_processed_sample_yield_based(case: Case) -> bool:
|
|
157
|
+
"""Returns True if any sample has any sample sequencing metrics of Pacbio type."""
|
|
158
|
+
return any(
|
|
159
|
+
any(metric.type == DeviceType.PACBIO for metric in sample.sample_run_metrics)
|
|
160
|
+
for sample in case.samples
|
|
161
|
+
)
|
|
152
162
|
|
|
153
163
|
|
|
154
|
-
def
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
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
|
+
)
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def are_all_samples_external(case: Case) -> bool:
|
|
172
|
+
return all(sample.is_external for sample in case.samples)
|
|
159
173
|
|
|
160
174
|
|
|
161
175
|
def is_case_express_priority(case: Case) -> bool:
|
|
@@ -205,6 +219,9 @@ def sample_has_enough_reads(sample: Sample) -> bool:
|
|
|
205
219
|
"""
|
|
206
220
|
Check if the sample has more or equal reads than the expected reads for the sample.
|
|
207
221
|
"""
|
|
222
|
+
if sample.is_external:
|
|
223
|
+
LOG.info(f"Sample {sample.internal_id} is external, skipping check.")
|
|
224
|
+
return True
|
|
208
225
|
enough_reads: bool = sample.reads >= sample.expected_reads_for_sample
|
|
209
226
|
if not enough_reads:
|
|
210
227
|
LOG.warning(f"Sample {sample.internal_id} has too few reads.")
|
|
@@ -218,7 +235,12 @@ def sample_has_enough_hifi_yield(sample: Sample) -> bool:
|
|
|
218
235
|
Raises:
|
|
219
236
|
ApplicationDoesNotHaveHiFiYieldError if the sample doesn't have expected HiFi yield.
|
|
220
237
|
"""
|
|
221
|
-
if
|
|
238
|
+
if sample.is_external:
|
|
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:
|
|
222
244
|
raise ApplicationDoesNotHaveHiFiYieldError(
|
|
223
245
|
f"Application for sample {sample.internal_id} does not have target HiFi yield."
|
|
224
246
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
cg/__init__.py,sha256=
|
|
1
|
+
cg/__init__.py,sha256=BeY80I67U51q6aLgK7vrT1Z-paSugKRtXMtbF02Y5OY,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
|
|
@@ -466,7 +466,7 @@ cg/resources/rnafusion_bundle_filenames.yaml,sha256=hoXuTobKbjH7W7dld87rSF7X0r4K
|
|
|
466
466
|
cg/resources/taxprofiler_bundle_filenames.yaml,sha256=AULMEAYkMzADYUtVtuSmBj7UaAIlLGRDyBMEOO0xWz8,2871
|
|
467
467
|
cg/resources/tomte_bundle_filenames.yaml,sha256=lFxk9GssmCyKBUn5lbRBtBS9FS9cABaoVzb-e2zrJac,4144
|
|
468
468
|
cg/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
469
|
-
cg/server/admin.py,sha256=
|
|
469
|
+
cg/server/admin.py,sha256=65jyelYOwJXoltuTNM8NJXdZbam2ROMIq5m9qBN5T7c,30263
|
|
470
470
|
cg/server/app.py,sha256=WEULzx5JeC0aJHag3Vltzopd8r7tgHPr_1nbytS-AI8,6975
|
|
471
471
|
cg/server/app_config.py,sha256=8DaNtYtdp6A29FAuTFX-Lk7SLv7Zx-_f57ZU0-T_3ZI,1403
|
|
472
472
|
cg/server/auto.py,sha256=5DqokNScv483imZTvOYrJo6wV9-P7ZGnJaaHnfnNJLs,57
|
|
@@ -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=MkFUyQQz1RFHbgD9cyqEuOkYe0NYQlbkJkyy9BkOWQw,9844
|
|
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.2.dist-info/METADATA,sha256=UdpEj8WSTQ1TsybITznTSh8ak0oewz9hSw1rF31ijEA,4940
|
|
926
|
+
cg-83.20.2.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
|
|
927
|
+
cg-83.20.2.dist-info/entry_points.txt,sha256=q5f47YQQGltzK_xnIq1mDopRXXEItr85Xe1BCtG-Wts,39
|
|
928
|
+
cg-83.20.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|