cg 83.15.3__py3-none-any.whl → 83.16.0__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 CHANGED
@@ -1,2 +1,2 @@
1
1
  __title__ = "cg"
2
- __version__ = "83.15.3"
2
+ __version__ = "83.16.0"
cg/cli/base.py CHANGED
@@ -1,4 +1,4 @@
1
- """ Start of CLI """
1
+ """Start of CLI"""
2
2
 
3
3
  import logging
4
4
  import sys
@@ -28,16 +28,10 @@ from cg.cli.transfer import transfer_group
28
28
  from cg.cli.upload.base import upload
29
29
  from cg.cli.utils import CLICK_CONTEXT_SETTINGS
30
30
  from cg.cli.workflow.base import workflow as workflow_cmd
31
- from cg.constants.cli_options import FORCE
32
31
  from cg.constants.constants import FileFormat
33
32
  from cg.io.controller import ReadFile
34
33
  from cg.models.cg_config import CGConfig
35
- from cg.store.database import (
36
- create_all_tables,
37
- drop_all_tables,
38
- get_scoped_session_registry,
39
- get_tables,
40
- )
34
+ from cg.store.database import get_scoped_session_registry
41
35
 
42
36
  LOG = logging.getLogger(__name__)
43
37
  LEVELS = ["DEBUG", "INFO", "WARNING", "ERROR"]
@@ -82,26 +76,6 @@ def base(
82
76
  context.call_on_close(teardown_session)
83
77
 
84
78
 
85
- @base.command()
86
- @click.option("--reset", is_flag=True, help="Reset database before setting up tables")
87
- @FORCE
88
- @click.pass_obj
89
- def init(context: CGConfig, reset: bool, force: bool):
90
- """Setup the database."""
91
- existing_tables: list[str] = get_tables()
92
- if force or reset:
93
- if existing_tables and not force:
94
- message = f"Delete existing tables? [{', '.join(existing_tables)}]"
95
- click.confirm(click.style(message, fg="yellow"), abort=True)
96
- drop_all_tables()
97
- elif existing_tables:
98
- LOG.error("Database already exists, use '--reset'")
99
- raise click.Abort
100
-
101
- create_all_tables()
102
- LOG.info(f"Success! New tables: {', '.join(get_tables())}")
103
-
104
-
105
79
  def find_commands(group, query: str) -> list[str]:
106
80
  """Recursively find commands in a group that match the query.
107
81
  Args:
cg/store/models.py CHANGED
@@ -851,6 +851,13 @@ class Sample(Base, PriorityMixin):
851
851
  """Return the sample run metrics for the sample."""
852
852
  return self._sample_run_metrics
853
853
 
854
+ @property
855
+ def device_type(self) -> DeviceType | None:
856
+ """Return the device type the sample was sequenced on."""
857
+ if self._sample_run_metrics:
858
+ return self._sample_run_metrics[0].type
859
+ return None
860
+
854
861
  def to_dict(self, links: bool = False) -> dict:
855
862
  """Represent as dictionary"""
856
863
  data = to_dict(model_instance=self)
@@ -858,6 +865,10 @@ class Sample(Base, PriorityMixin):
858
865
  data["customer"] = self.customer.to_dict()
859
866
  data["application_version"] = self.application_version.to_dict()
860
867
  data["application"] = self.application_version.application.to_dict()
868
+ data["hifi_yield"] = self.hifi_yield
869
+ data["uses_reads"] = True
870
+ if self.device_type == DeviceType.PACBIO:
871
+ data["uses_reads"] = False
861
872
  if links:
862
873
  data["links"] = [link_obj.to_dict(family=True, parents=True) for link_obj in self.links]
863
874
  return data
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cg
3
- Version: 83.15.3
3
+ Version: 83.16.0
4
4
  Summary: Clinical Genomics command center
5
5
  Requires-Python: >=3.11,<3.13
6
6
  Classifier: Programming Language :: Python
@@ -1,4 +1,4 @@
1
- cg/__init__.py,sha256=wv-WioAcstp0tI-e4BA-fOP5yyUjNNdpVHMGeppa8R0,41
1
+ cg/__init__.py,sha256=VGXZH8PBR91D3KpgHWvDCflZAEo93QE2i1onU6Ey7cY,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
@@ -72,7 +72,7 @@ cg/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
72
72
  cg/cli/add.py,sha256=hNW79Nrr7kbmv5DNDjZh_JsAGxZSQp_cLFh1gT8qAe0,11935
73
73
  cg/cli/archive.py,sha256=0P1KCMDHSHQIm-z3ONkF7JkmHvx0cziUJodYG-Z-pN8,4411
74
74
  cg/cli/backup.py,sha256=TBLF3yLstEI_bcrGoCo79CcClBqa2-Lk-54rofmo57I,11229
75
- cg/cli/base.py,sha256=j5og_6HL_Ef4WzqsGqBD0Bfi-RGGf82gvD8YnT_TQzs,5105
75
+ cg/cli/base.py,sha256=x0dWVQrY5HnTjMEXMQIP4mmoo7wHCR1tfalAGFkEUdo,4287
76
76
  cg/cli/clean.py,sha256=uKpRYl9__VIrFQ5sFJeV8QwxkBBMLUZ3nB0vnsArlFU,7854
77
77
  cg/cli/compress/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
78
78
  cg/cli/compress/base.py,sha256=GSBDojXXz4yn6LzXj3RvmosIg3z1bjcPsv3r2ubQpWU,2344
@@ -904,7 +904,7 @@ cg/store/filters/status_panel_filters.py,sha256=qMYhIsrF9G3mjCvL9b9O2l_cmD3SfPWh
904
904
  cg/store/filters/status_pool_filters.py,sha256=XcYqe2z5k_q09xpp4cleDMQ4Q3o2y7UPCkB0QUkl1ck,4308
905
905
  cg/store/filters/status_sample_filters.py,sha256=mRpt_ik7niMjBo9K7pP8cmdfDMdr0B3I6Tt2MWXkLoc,9656
906
906
  cg/store/filters/status_user_filters.py,sha256=sMwKeWqgEtqv8gyhbN_Uf5huPUxbOt5qEqMWVu67Zys,1328
907
- cg/store/models.py,sha256=dSJRWdvqFmgIbYTlQbsZD8utH10BIjbtUKERybnlssI,43915
907
+ cg/store/models.py,sha256=WuTbEtqRdcUsuQpOsSjhUMNovfDQYbPeff3Qo_wjERs,44321
908
908
  cg/store/store.py,sha256=mz1TfKPlanH2uQyhZdwe_8VKg0IdFolmromKLu668IY,630
909
909
  cg/utils/__init__.py,sha256=gGjdV2l_hfWFCTybU6dwDk_FcItM88EIHNPaX6g1qUk,30
910
910
  cg/utils/calculations.py,sha256=zLVJO6nNw6n7AW7fHZI56UnQ23lqJrShB4Hh2ow6-TQ,349
@@ -923,7 +923,7 @@ cg/utils/flask/enum.py,sha256=xwNVtFPkSzoloJctLHu7obRyxcng1GJrhkeYkqwf9tw,1052
923
923
  cg/utils/mapping.py,sha256=oZpZW2kgsbtAP2FZ7RtRPELiEE1zZk_nAGisHGtCOUo,491
924
924
  cg/utils/time.py,sha256=_VOglhrFEZ5cwHK1U1g36SdwzB7UvV-Nvlt4ymuZUho,1501
925
925
  cg/utils/utils.py,sha256=RciI_UhWcnG_pMZrmQZ1ZYb-O1N0DweTYMmhE0SIRgQ,1410
926
- cg-83.15.3.dist-info/METADATA,sha256=K9yyPr_YAzs94GM0SsE9un_FRwjmtkggZjBGalpq_r4,4940
927
- cg-83.15.3.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
928
- cg-83.15.3.dist-info/entry_points.txt,sha256=q5f47YQQGltzK_xnIq1mDopRXXEItr85Xe1BCtG-Wts,39
929
- cg-83.15.3.dist-info/RECORD,,
926
+ cg-83.16.0.dist-info/METADATA,sha256=HzX6a5Bovk5Z1Qn2joM4a-pO_C_CFO6sIJx9jdv9uCs,4940
927
+ cg-83.16.0.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
928
+ cg-83.16.0.dist-info/entry_points.txt,sha256=q5f47YQQGltzK_xnIq1mDopRXXEItr85Xe1BCtG-Wts,39
929
+ cg-83.16.0.dist-info/RECORD,,
File without changes