Skip to content

Commit

Permalink
Merge branch 'main' into version_4.86
Browse files Browse the repository at this point in the history
  • Loading branch information
northwestwitch authored Aug 22, 2024
2 parents 5a62b53 + 32b200f commit 8fdf860
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ About changelog [here](https://keepachangelog.com/en/1.0.0/)
- Variant links to ExAC, now pointing to gnomAD, since the ExAC browser is no longer available
- Style of HPO terms assigned to a case, now one phenotype per line
- RNA sashimi view rendering should work also if the gene track is user disabled
- Respect IGV tracks chosen by user in variant IGV settings

## [4.85]
### Added
Expand Down
12 changes: 5 additions & 7 deletions scout/server/blueprints/alignviewers/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from scout.utils.ensembl_rest_clients import EnsemblRestApiClient

LOG = logging.getLogger(__name__)
CUSTOM_TRACK_NAMES = ["Genes", "ClinVar", "ClinVar CNVs"]
DEFAULT_TRACK_NAMES = ["Genes", "ClinVar", "ClinVar CNVs"]


def check_session_tracks(resource):
Expand Down Expand Up @@ -247,9 +247,9 @@ def set_common_tracks(display_obj, build):
# Set up IGV tracks that are common for all cases:
display_obj["reference_track"] = HUMAN_REFERENCE[build] # Human reference is always present

# if user settings for igv tracks exist -> use these settings, otherwise display all tracks
# if user settings for igv tracks exist -> use these settings, otherwise display default tracks ---> Genes, ClinVar and ClinVar CNVs
custom_tracks_names = (
user_obj.get("igv_tracks") if "igv_tracks" in user_obj else CUSTOM_TRACK_NAMES
user_obj.get("igv_tracks") if "igv_tracks" in user_obj else DEFAULT_TRACK_NAMES
)

display_obj["custom_tracks"] = []
Expand Down Expand Up @@ -313,16 +313,14 @@ def set_config_custom_tracks(display_obj: dict, build: str):
"""Set up custom public or private tracks stored in a cloud bucket or locally. These tracks were those specified in the Scout config file.
Respect user's preferences."""
user_obj = store.user(email=current_user.email)
custom_tracks_names = user_obj.get("igv_tracks")

config_custom_tracks = []

if hasattr(config_igv_tracks, "tracks"):
build_tracks = config_igv_tracks.tracks.get(build, [])
for track in build_tracks:
# Do not display track if user doesn't want to see it
if custom_tracks_names and track["name"] not in custom_tracks_names:
continue
config_custom_tracks.append(track)
if "igv_tracks" not in user_obj or track["name"] in user_obj.get("igv_tracks"):
config_custom_tracks.append(track)
if config_custom_tracks:
display_obj["config_custom_tracks"] = config_custom_tracks
1 change: 1 addition & 0 deletions scout/server/blueprints/variant/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def update_tracks_settings():
# update user in database with custom tracks info
user_obj["igv_tracks"] = selected_tracks
store.update_user(user_obj)
setattr(current_user, "igv_tracks", selected_tracks)
return redirect(request.referrer)


Expand Down

0 comments on commit 8fdf860

Please sign in to comment.