Skip to content

Commit

Permalink
make relatedness check file downloadable (#4542)
Browse files Browse the repository at this point in the history
* upload relatedness check file to slack instead of adding the link

* whitespace

* add timeout s

* use downloadable link

* Update check_for_new_samples_from_pipeline.py

* Update communication_utils.py
  • Loading branch information
jklugherz authored Dec 19, 2024
1 parent 7c4a3ff commit bfe53b7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
1 change: 0 additions & 1 deletion reference_data/management/commands/utils/download_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,3 @@ def _get_remote_file_size(url):
except Exception:
# file size not yet implemented for FTP and other protocols, and HEAD not supported for all http requests
return 0

11 changes: 5 additions & 6 deletions seqr/management/commands/check_for_new_samples_from_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,13 @@ def _load_new_samples(cls, metadata_path, genome_version, dataset_type, run_vers
if split_pdos:
summary += f'\n\nSkipped samples in this project have been moved to {", ".join(split_pdos)}'

relatedness_check_message = (
f'\nRelatedness check results: {relatedness_check_file_path}'
if (relatedness_check_file_path and check == RELATEDNESS_CHECK_NAME)
else ''
)
if check == RELATEDNESS_CHECK_NAME and relatedness_check_file_path:
downloadable_link = f'https://storage.cloud.google.com/{relatedness_check_file_path[5:]}'
summary += f'\n\nRelatedness check results: {downloadable_link}'

safe_post_to_slack(
SEQR_SLACK_LOADING_NOTIFICATION_CHANNEL,
f'The following {len(failures)} families failed {check.replace("_", " ")} in {project}:\n{summary}{relatedness_check_message}'
f'The following {len(failures)} families failed {check.replace("_", " ")} in {project}:\n{summary}'
)

# Reload saved variant JSON
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ def test_command(self, mock_email, mock_airtable_utils):
mock.call(
'seqr_loading_notifications',
"""The following 1 families failed relatedness check in 1kg project nåme with uniçøde:
- 1: Sample NA19679 has expected relation "parent" to NA19675 but has coefficients [0.0, 0.8505002045292791, 0.14949979547072176, 0.5747498977353613]; Sample NA19678 has expected relation "sibling" to NA19675 but has coefficients [0.17424888135104177, 0.6041745754450025, 0.22157654320395614, 0.5236638309264574]\nRelatedness check results: gs://seqr-loading-temp/v3.1/GRCh38/SNV_INDEL/relatedness_check/test_callset_hash.tsv""",
- 1: Sample NA19679 has expected relation "parent" to NA19675 but has coefficients [0.0, 0.8505002045292791, 0.14949979547072176, 0.5747498977353613]; Sample NA19678 has expected relation "sibling" to NA19675 but has coefficients [0.17424888135104177, 0.6041745754450025, 0.22157654320395614, 0.5236638309264574]\n\nRelatedness check results: https://storage.cloud.google.com/seqr-loading-temp/v3.1/GRCh38/SNV_INDEL/relatedness_check/test_callset_hash.tsv""",
),
mock.call(
'seqr_loading_notifications',
Expand Down
1 change: 0 additions & 1 deletion seqr/utils/communication_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,3 @@ def set_email_message_stream(message, stream):
message.esp_extra = {
'MessageStream': stream,
}

0 comments on commit bfe53b7

Please sign in to comment.