scout-browser 4.82.2__py3-none-any.whl → 4.83__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.
Files changed (57) hide show
  1. scout/__version__.py +1 -1
  2. scout/adapter/client.py +1 -0
  3. scout/adapter/mongo/base.py +0 -1
  4. scout/adapter/mongo/case.py +15 -37
  5. scout/adapter/mongo/case_events.py +98 -2
  6. scout/adapter/mongo/hgnc.py +39 -22
  7. scout/adapter/mongo/institute.py +3 -9
  8. scout/adapter/mongo/panel.py +2 -1
  9. scout/adapter/mongo/variant.py +3 -2
  10. scout/adapter/mongo/variant_loader.py +92 -79
  11. scout/commands/base.py +1 -0
  12. scout/commands/update/case.py +10 -10
  13. scout/commands/update/individual.py +6 -1
  14. scout/constants/file_types.py +4 -0
  15. scout/load/__init__.py +0 -1
  16. scout/load/all.py +3 -4
  17. scout/load/panel.py +8 -4
  18. scout/load/setup.py +1 -0
  19. scout/models/case/case_loading_models.py +6 -16
  20. scout/parse/case.py +0 -1
  21. scout/parse/disease_terms.py +1 -0
  22. scout/parse/omim.py +1 -0
  23. scout/parse/panel.py +40 -15
  24. scout/resources/__init__.py +3 -0
  25. scout/server/app.py +4 -50
  26. scout/server/blueprints/alignviewers/controllers.py +15 -17
  27. scout/server/blueprints/alignviewers/templates/alignviewers/igv_viewer.html +13 -3
  28. scout/server/blueprints/alignviewers/views.py +10 -15
  29. scout/server/blueprints/cases/controllers.py +70 -73
  30. scout/server/blueprints/cases/templates/cases/case.html +37 -21
  31. scout/server/blueprints/cases/templates/cases/collapsible_actionbar.html +1 -1
  32. scout/server/blueprints/cases/templates/cases/phenotype.html +8 -6
  33. scout/server/blueprints/cases/templates/cases/utils.html +3 -3
  34. scout/server/blueprints/cases/views.py +8 -6
  35. scout/server/blueprints/variant/controllers.py +5 -5
  36. scout/server/blueprints/variant/templates/variant/acmg.html +25 -16
  37. scout/server/blueprints/variant/templates/variant/components.html +11 -6
  38. scout/server/blueprints/variant/views.py +5 -2
  39. scout/server/blueprints/variants/controllers.py +1 -1
  40. scout/server/blueprints/variants/views.py +1 -1
  41. scout/server/config.py +16 -4
  42. scout/server/extensions/__init__.py +4 -2
  43. scout/server/extensions/beacon_extension.py +1 -0
  44. scout/server/extensions/chanjo_extension.py +58 -0
  45. scout/server/extensions/phenopacket_extension.py +1 -0
  46. scout/server/static/bs_styles.css +18 -0
  47. scout/server/utils.py +16 -2
  48. scout/utils/acmg.py +33 -20
  49. scout/utils/track_resources.py +70 -0
  50. {scout_browser-4.82.2.dist-info → scout_browser-4.83.dist-info}/METADATA +1 -1
  51. {scout_browser-4.82.2.dist-info → scout_browser-4.83.dist-info}/RECORD +55 -55
  52. scout/load/case.py +0 -36
  53. scout/utils/cloud_resources.py +0 -61
  54. {scout_browser-4.82.2.dist-info → scout_browser-4.83.dist-info}/LICENSE +0 -0
  55. {scout_browser-4.82.2.dist-info → scout_browser-4.83.dist-info}/WHEEL +0 -0
  56. {scout_browser-4.82.2.dist-info → scout_browser-4.83.dist-info}/entry_points.txt +0 -0
  57. {scout_browser-4.82.2.dist-info → scout_browser-4.83.dist-info}/top_level.txt +0 -0
scout/load/case.py DELETED
@@ -1,36 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- import logging
3
-
4
- from scout.exceptions import IntegrityError
5
-
6
- logger = logging.getLogger(__name__)
7
-
8
-
9
- def load_case(adapter, case_obj, update=False):
10
- """Load a case into the database
11
-
12
- If the case already exists the function will exit.
13
- If the user want to load a case that is already in the database
14
- 'update' has to be 'True'
15
-
16
- Args:
17
- adapter (MongoAdapter): connection to the database
18
- case_obj (dict): case object to persist to the database
19
- update(bool): If existing case should be updated
20
-
21
- Returns:
22
- case_obj(dict): A dictionary with the builded case
23
- """
24
- logger.info("Loading case {} into database".format(case_obj["display_name"]))
25
-
26
- # Check if case exists in database
27
- existing_case = adapter.case(case_obj["_id"])
28
-
29
- if existing_case:
30
- if update:
31
- adapter.update_case(case_obj)
32
- else:
33
- raise IntegrityError("Case {0} already exists in database".format(case_obj["_id"]))
34
- else:
35
- adapter.add_case(case_obj)
36
- return case_obj
@@ -1,61 +0,0 @@
1
- # coding=UTF-8
2
- import logging
3
-
4
- LOG = logging.getLogger(__name__)
5
-
6
- REQUIRED_FIELDS = ["name", "type", "url"]
7
- TRACK_KEYS = ["name", "type", "format", "url", "indexURL"]
8
-
9
-
10
- class AlignTrackHandler:
11
- """Class collecting external IGV tracks stored in the cloud"""
12
-
13
- def init_app(self, app):
14
- self.public_tracks = self.set_public_tracks(app.config["CLOUD_IGV_TRACKS"])
15
-
16
- def track_template(self, track_info):
17
- """Provides the template for a VCF track object"""
18
- track = {}
19
-
20
- for key in TRACK_KEYS:
21
- if key in track_info:
22
- track[key] = track_info[key]
23
-
24
- # Save track only of it contains the minimal required keys
25
- if all(track.get(key) for key in REQUIRED_FIELDS):
26
- return track
27
-
28
- def set_public_tracks(self, bucket_list):
29
- """Return a list of public IGV tracks stored on the cloud
30
-
31
- Args:
32
- bucket_list(list): a list of cloud bucket dictionaries containing IGV tracks, can be public or private
33
-
34
- Returns:
35
- public_tracks(dict): a list of public access tracks stored on the cloud, where key is genome build
36
- """
37
- public_tracks = {}
38
- # Loop over the bucket list and collect all public tracks
39
- for bucket_obj in bucket_list:
40
- if bucket_obj.get("access") == "private" or None:
41
- continue
42
- for track in bucket_obj.get("tracks", []):
43
- build = track.get("build")
44
- if build not in ["37", "38"]:
45
- LOG.warning(
46
- f"One or more IGV cloud public tracks could not be used, Please provide a genome build ('37', '38') for it."
47
- )
48
- continue
49
- track_obj = self.track_template(track)
50
- if track_obj is None:
51
- LOG.warning(
52
- f"One or more IGV cloud public tracks could not be used, Please provide all required keys:{REQUIRED_FIELDS}"
53
- )
54
- continue
55
- if build in public_tracks:
56
- public_tracks[build].append(track_obj)
57
- else:
58
- public_tracks[build] = [track_obj]
59
-
60
- if public_tracks != {}:
61
- return public_tracks