diff --git a/src/common/clinvar_interface.py b/src/common/clinvar_interface.py
index f001064b..305f3447 100644
--- a/src/common/clinvar_interface.py
+++ b/src/common/clinvar_interface.py
@@ -158,6 +158,7 @@ def get_postable_consensus_classification(self, variant, selected_gene, clinvar_
"data": {"content": data}
}]
}
+ print(postable_data)
return postable_data
def post_consensus_classification(self, variant, selected_gene, clinvar_accession):
@@ -233,4 +234,5 @@ def get_clinvar_submission_status(self, submission_id):
clinvar_submission_message = ';'.join(clinvar_submission_messages)
submission_status['message'] = clinvar_submission_message
- return submission_status
\ No newline at end of file
+ return submission_status
+
diff --git a/src/common/db_IO.py b/src/common/db_IO.py
index d216e40e..f4f0acae 100644
--- a/src/common/db_IO.py
+++ b/src/common/db_IO.py
@@ -1447,9 +1447,10 @@ def update_consensus_classification_needs_heredicare_upload(self, consensus_clas
self.conn.commit()
def update_consensus_classification_needs_clinvar_upload(self, consensus_classification_id):
- command = "UPDATE consensus_classification SET needs_clinvar_upload = 0 WHERE id = %s"
- self.cursor.execute(command, (consensus_classification_id, ))
- self.conn.commit()
+ if consensus_classification_id is not None:
+ command = "UPDATE consensus_classification SET needs_clinvar_upload = 0 WHERE id = %s"
+ self.cursor.execute(command, (consensus_classification_id, ))
+ self.conn.commit()
def get_variant_ids_which_need_heredicare_upload(self, variant_ids_oi = None):
# excludes structural variants and intergenic variants and variants of unfinished submissions
@@ -3791,7 +3792,7 @@ def get_heredicare_queue_entries(self, publish_queue_ids: list, variant_id):
if len(publish_queue_ids) == 0:
return []
placeholders = self.get_placeholders(len(publish_queue_ids))
- command = "SELECT id, status, requested_at, finished_at, message, vid, variant_id, submission_id, consensus_classification_id from publish_heredicare_queue WHERE publish_queue_id IN " + placeholders + " AND variant_id = %s"
+ command = "SELECT id, status, requested_at, finished_at, message, vid, variant_id, submission_id, consensus_classification_id, publish_queue_id from publish_heredicare_queue WHERE publish_queue_id IN " + placeholders + " AND variant_id = %s"
actual_information = tuple(publish_queue_ids) + (variant_id, )
self.cursor.execute(command, actual_information)
result = self.cursor.fetchall()
@@ -3860,11 +3861,24 @@ def get_publish_requests_page(self, page, page_size):
- def insert_publish_clinvar_request(self, publish_queue_id, variant_id):
- command = "INSERT INTO publish_clinvar_queue (publish_queue_id, variant_id) VALUES (%s, %s)"
- self.cursor.execute(command, (publish_queue_id, variant_id))
+ def insert_publish_clinvar_request(self, publish_queue_id, variant_id, manually_added = False):
+ command = "INSERT INTO publish_clinvar_queue (publish_queue_id, variant_id, manually_added) VALUES (%s, %s, %s)"
+ self.cursor.execute(command, (publish_queue_id, variant_id, manually_added))
self.conn.commit()
return self.get_last_insert_id()
+
+ def is_manual_publish_clinvar_queue(self, publish_queue_id):
+ command = "SELECT EXISTS (SELECT * FROM publish_clinvar_queue WHERE id = %s AND manually_added = 1)"
+ self.cursor.execute(command, (publish_queue_id, ))
+ result = self.cursor.fetchone()[0]
+ if result == 1:
+ return True
+ return False
+
+ #def delete_manual_publish_clinvar_queue(self, publish_clinvar_queue_id):
+ # command = "DELETE FROM publish_clinvar_queue WHERE manually_added = 1 AND id = %s"
+ # self.cursor.execute(command, (publish_clinvar_queue_id, ))
+ # self.conn.commit()
def update_publish_clinvar_queue_celery_task_id(self, publish_clinvar_queue_id, celery_task_id):
command = "UPDATE publish_clinvar_queue SET celery_task_id = %s WHERE id = %s"
@@ -3903,21 +3917,24 @@ def update_publish_clinvar_queue_status(self, publish_clinvar_queue_id, status,
def get_most_recent_publish_queue_ids_clinvar(self, variant_id):
- command = "SELECT DISTINCT publish_queue_id FROM publish_clinvar_queue WHERE variant_id = %s AND id >= (SELECT MAX(id) FROM publish_clinvar_queue WHERE variant_id = %s AND status != 'skipped')"
+ command = "SELECT DISTINCT publish_queue_id FROM publish_clinvar_queue WHERE variant_id = %s AND id >= (SELECT MAX(id) FROM publish_clinvar_queue WHERE variant_id = %s AND status != 'skipped' AND status != 'deleted')"
self.cursor.execute(command, (variant_id, variant_id))
result = self.cursor.fetchall()
if len(result) == 0:
- command = "SELECT DISTINCT publish_queue_id from publish_clinvar_queue WHERE variant_id = %s AND status = 'skipped'"
+ command = "SELECT DISTINCT publish_queue_id from publish_clinvar_queue WHERE variant_id = %s AND status = 'skipped' AND status != 'deleted'"
self.cursor.execute(command, (variant_id, ))
result = self.cursor.fetchall()
return [x[0] for x in result]
def get_clinvar_queue_entries(self, publish_queue_ids: list, variant_id):
- if len(publish_queue_ids) == 0:
- return []
- placeholders = self.get_placeholders(len(publish_queue_ids))
- command = "SELECT id, publish_queue_id, requested_at, status, message, submission_id, accession_id, last_updated, celery_task_id, consensus_classification_id FROM publish_clinvar_queue WHERE publish_queue_id IN " + placeholders + " AND variant_id = %s"
- actual_information = tuple(publish_queue_ids) + (variant_id, )
+ command = "SELECT id, publish_queue_id, requested_at, status, message, submission_id, accession_id, last_updated, celery_task_id, consensus_classification_id, manually_added FROM publish_clinvar_queue WHERE variant_id = %s"
+ actual_information = (variant_id, )
+ if publish_queue_ids is not None:
+ if len(publish_queue_ids) == 0:
+ return []
+ placeholders = self.get_placeholders(len(publish_queue_ids))
+ command += " AND publish_queue_id IN " + placeholders
+ actual_information += tuple(publish_queue_ids)
self.cursor.execute(command, actual_information)
result = self.cursor.fetchall()
return result
diff --git a/src/frontend_celery/webapp/tasks.py b/src/frontend_celery/webapp/tasks.py
index 75d1829f..cd187dcd 100644
--- a/src/frontend_celery/webapp/tasks.py
+++ b/src/frontend_celery/webapp/tasks.py
@@ -412,6 +412,28 @@ def skip_hg38(variant) -> bool:
return False
+def is_sv(variant) -> bool:
+ ref_19 = functions.none2default(variant.get('REF_HG19'), "")
+ alt_19 = functions.none2default(variant.get('ALT_HG19'), "")
+ ref_38 = functions.none2default(variant.get('REF_HG38'), "")
+ alt_38 = functions.none2default(variant.get('ALT_HG38'), "")
+
+ sv_indicators = ["<", ">"]
+ unallowed_sv_indicators = ["g."]
+
+ if any([indicator in ref_19 for indicator in sv_indicators]) and not any([indicator in ref_19 for indicator in unallowed_sv_indicators]):
+ return True
+ if any([indicator in alt_19 for indicator in sv_indicators]) and not any([indicator in alt_19 for indicator in unallowed_sv_indicators]):
+ return True
+ if any([indicator in ref_38 for indicator in sv_indicators]) and not any([indicator in ref_38 for indicator in unallowed_sv_indicators]):
+ return True
+ if any([indicator in alt_38 for indicator in sv_indicators]) and not any([indicator in alt_38 for indicator in unallowed_sv_indicators]):
+ return True
+ if any([len(seq) > 1000 for seq in [ref_19, alt_19, ref_38, alt_38]]):
+ return True
+
+ return False
+
# this is the main add variant from heredicare function! -> sanitizes and inserts variant
def map_hg38(variant, user_id, conn:Connection, insert_variant = True, perform_annotation = True, external_ids = None): # the task worker
@@ -421,6 +443,12 @@ def map_hg38(variant, user_id, conn:Connection, insert_variant = True, perform_a
allowed_sequence_letters = "ACGT"
+ if is_sv(variant): # skip structural variants
+ status = "error"
+ message = "Structural variants are not supported for import from HerediCaRe"
+ return status, message
+
+
# first check if the hg38 information is there
chrom = variant.get('CHROM')
pos = variant.get('POS_HG38')
diff --git a/src/frontend_celery/webapp/templates/main/changelog.html b/src/frontend_celery/webapp/templates/main/changelog.html
index 1a97dae1..65f1b3e7 100644
--- a/src/frontend_celery/webapp/templates/main/changelog.html
+++ b/src/frontend_celery/webapp/templates/main/changelog.html
@@ -9,6 +9,116 @@
{% block title %} Changelog {% endblock %}
+
+
v 1.13.6 (16.08.2024)
+
+ General changes:
+
+
Improved API security
+
Added variant upload and variant check through api
+
+ Bugfixes:
+
+
Fixed a visual bug when the request to start a new upload to HerediCaRe task was erroneous, but the ClinVar upload was successful
+
+
+
+
+
v 1.13.5 (15.08.2024)
+
+ Bugfixes:
+
+
When using a non-default redis port background tasks would not work correctly. This was resolved.
+
Fixed a bug when uploading variants to HerediCaRe that are unknown by HerediCaRe
+
+
+
+
v 1.13.4 (25.07.2024)
+
+ General changes:
+
+
Added full import of HerediCaRe VIDs button to admin dashboard alongside the preexisting incremental update
+
Updated HerediClassify to v1.0.4
+
Improved admin dashboard variant import summary page. It now loads way faster
+
+ Bugfixes:
+
+
Fixed a rare bug where HerediCaRe VIDs were inconsistently annotated
+
pm2_pp + 1x pvs now correctly classifies as likely benign in ATM v1.3.0 scheme
+
Fixed a bug that the annotation would fail when the consequence annotation tool would not get any consequences from ensembl
+
Very large variants would fail to recieve literature from litvar2 which would result in an erroneous annotation
+
+
+
+
v 1.13.3 (23.07.2024)
+
+ Bugfixes:
+
+
Searching for specific variants would not apply filters correctly
+
+
+
+
v 1.13.2 (22.07.2024)
+
+ General changes:
+
+
Added retry import button for single failed HerediCaRe VIDs
+
Improved HerediCaRe VID information page
+
Added more fine grained variant type search: added insertion, deletion and delins. Small variants are now single nucleotide variants.
+
+ Bugfixes:
+
+
Fixed a bug that CrossMap could not be invoked when lifting between genome versions
+
Variant annotation would fail when the HerediCaRe API returned a bad status code
+
Fixed a bug where variants could not be hidden
+
+
+
+
v 1.13.1 (18.07.2024)
+
+ General changes:
+
+
Updated ClinVar to version 2024-07-16
+
Updated HerediClassify to version 1.0.3
+
Improved security for flashed messages
+
Added HerediVar link to variant banner on multiple pages
+
+ Bugfixes:
+
+
Fixed a bug where users were unable to add variants to lists from public editable databases created by another user
+
+
+
+
v 1.13 (05.07.2024)
+
+ General changes:
+
+
Publish and insert queue history pages are now paginated for better scalability
+
Improved single HerediCaRe VID import
+
Updated PFAM protein domain external links to link to InterPro
+
Increased login idle timer
+
Now the REVEL score of the best transcript is shown first
+
Enabled HerediCaRe uploads
+
+ Bugfixes:
+
+
Resolved an issue where the consensus classification needs upload warning sign was shown on requested publish status
+
The ClinVar and HerediCaRe status showed status requesting when any variant was uploaded to heredicare/clinvar
+
The ClinVar and HerediCaRe status pills did not show the error message in specific cases
+
Fixed a bug that caused dynamically generated VCFs to not show the download diaglogue
+
Removed wrong chromosome from check variants page
+
Classification criteria were not wrapping properly on the variant history page
+
In specific cases the cancerhotspots annotations were incorrect
+
Fixed an issue when two criteria had the same mutually exclusive criterion target and both were selected. If the use would unselect one of them the mutually exclusive criterion would be enabled for selection even though it shouldn't
+
When a variant was not annotated or did not have any consequences the "no scheme" would be preselected on the variant classify page. Now, the correct selected default classification scheme is selected
+
Fixed an issue where the previous status of ClinVar and HerediCaRe uploads would be shown on the variant display page upon status updates
+
Fixed a bug where sometimes wrong COSMIC links would be generated
+
+
+
+
+
+
v 1.12 (17.06.2024)
General changes:
diff --git a/src/frontend_celery/webapp/templates/main/documentation.html b/src/frontend_celery/webapp/templates/main/documentation.html
index 2e2fe197..ecfee8f3 100644
--- a/src/frontend_celery/webapp/templates/main/documentation.html
+++ b/src/frontend_celery/webapp/templates/main/documentation.html
@@ -9,113 +9,6 @@
{% block title %} Welcome to the HerediVar Wiki {% endblock %}
-
v 1.13.6 (16.08.2024)
-
- General changes:
-
-
Improved API security
-
Added variant upload and variant check through api
-
- Bugfixes:
-
-
Fixed a visual bug when the request to start a new upload to HerediCaRe task was erroneous, but the ClinVar upload was successful
-
-
-
-
-
v 1.13.5 (15.08.2024)
-
- Bugfixes:
-
-
When using a non-default redis port background tasks would not work correctly. This was resolved.
-
Fixed a bug when uploading variants to HerediCaRe that are unknown by HerediCaRe
-
-
-
-
v 1.13.4 (25.07.2024)
-
- General changes:
-
-
Added full import of HerediCaRe VIDs button to admin dashboard alongside the preexisting incremental update
-
Updated HerediClassify to v1.0.4
-
Improved admin dashboard variant import summary page. It now loads way faster
-
- Bugfixes:
-
-
Fixed a rare bug where HerediCaRe VIDs were inconsistently annotated
-
pm2_pp + 1x pvs now correctly classifies as likely benign in ATM v1.3.0 scheme
-
Fixed a bug that the annotation would fail when the consequence annotation tool would not get any consequences from ensembl
-
Very large variants would fail to recieve literature from litvar2 which would result in an erroneous annotation
-
-
-
-
v 1.13.3 (23.07.2024)
-
- Bugfixes:
-
-
Searching for specific variants would not apply filters correctly
-
-
-
-
v 1.13.2 (22.07.2024)
-
- General changes:
-
-
Added retry import button for single failed HerediCaRe VIDs
-
Improved HerediCaRe VID information page
-
Added more fine grained variant type search: added insertion, deletion and delins. Small variants are now single nucleotide variants.
-
- Bugfixes:
-
-
Fixed a bug that CrossMap could not be invoked when lifting between genome versions
-
Variant annotation would fail when the HerediCaRe API returned a bad status code
-
Fixed a bug where variants could not be hidden
-
-
-
-
v 1.13.1 (18.07.2024)
-
- General changes:
-
-
Updated ClinVar to version 2024-07-16
-
Updated HerediClassify to version 1.0.3
-
Improved security for flashed messages
-
Added HerediVar link to variant banner on multiple pages
-
- Bugfixes:
-
-
Fixed a bug where users were unable to add variants to lists from public editable databases created by another user
-
-
-
-
v 1.13 (05.07.2024)
-
- General changes:
-
-
Publish and insert queue history pages are now paginated for better scalability
-
Improved single HerediCaRe VID import
-
Updated PFAM protein domain external links to link to InterPro
-
Increased login idle timer
-
Now the REVEL score of the best transcript is shown first
-
Enabled HerediCaRe uploads
-
- Bugfixes:
-
-
Resolved an issue where the consensus classification needs upload warning sign was shown on requested publish status
-
The ClinVar and HerediCaRe status showed status requesting when any variant was uploaded to heredicare/clinvar
-
The ClinVar and HerediCaRe status pills did not show the error message in specific cases
-
Fixed a bug that caused dynamically generated VCFs to not show the download diaglogue
-
Removed wrong chromosome from check variants page
-
Classification criteria were not wrapping properly on the variant history page
-
In specific cases the cancerhotspots annotations were incorrect
-
Fixed an issue when two criteria had the same mutually exclusive criterion target and both were selected. If the use would unselect one of them the mutually exclusive criterion would be enabled for selection even though it shouldn't
-
When a variant was not annotated or did not have any consequences the "no scheme" would be preselected on the variant classify page. Now, the correct selected default classification scheme is selected
-
Fixed an issue where the previous status of ClinVar and HerediCaRe uploads would be shown on the variant display page upon status updates
-
Fixed a bug where sometimes wrong COSMIC links would be generated
+
+
+ {% for clinvar_submission in clinvar_submissions %}
+
+
{{clinvar_submission[2]}}
+
{{clinvar_submission[7]}}
+
{{clinvar_submission[5]}}
+
{{clinvar_submission[6]}}
+
{{clinvar_submission[3]}}
+
{{clinvar_submission[4]}}
+
{{clinvar_submission[10]}}
+
+ {% endfor %}
+
+
+
+
+
+
+
+
Add ClinVar submission:
+
+ WARNING: Only manually add ClinVar submissions when HerediVar does not know about a specific ClinVar submission. This happens when a submission was done outside of HerediVar through the same organization (eg. the ClinVar submission portal).
+
+ HerediVar shows an error message upon submitting the same variant to ClinVar that was uploaded elsewhere before. The message is similar to this: "This record is submitted as novel but it should be submitted as an update, including the SCV accession, because your organization previously submitted SCV0000000000 for the same variant and condition."
+
+ You can use the following form to add this unknown ClinVar submission and retry the upload afterwards.
+
+
+
+
+
+
+
+
Delete ClinVar submission:
+
+ WARNING: Only do this if a manually added ClinVar submission was added falsely
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{% endblock %}
+
+{% block special_scripts %}
+{% endblock%}
\ No newline at end of file
diff --git a/src/frontend_celery/webapp/templates/variant/variant.html b/src/frontend_celery/webapp/templates/variant/variant.html
index 8be0452c..addb5431 100644
--- a/src/frontend_celery/webapp/templates/variant/variant.html
+++ b/src/frontend_celery/webapp/templates/variant/variant.html
@@ -35,7 +35,7 @@
{% if clinvar_queue_entry_summary["status"] not in ["skipped", "unknown"] %}
{% set mrcc = variant.get_recent_consensus_classification() %}
{% if mrcc is not none %}
- {% if mrcc.needs_clinvar_upload and clinvar_queue_entry_summary["status"] not in ["progress", "processing", "submitted", "pending", "waiting", "requesting"] %}
+ {% if mrcc.needs_clinvar_upload and clinvar_queue_entry_summary["status"] not in ["progress", "processing", "submitted", "pending", "waiting", "requesting", "multiple stati"] %}
{{macros.draw_exclamation_mark("The consensus classification needs to be uploaded to ClinVar!")}}
{% endif %}
{% endif %}
@@ -87,7 +87,7 @@
{% if heredicare_queue_entry_summary["status"] not in ["skipped", "unknown"] %}
{% set mrcc = variant.get_recent_consensus_classification() %}
{% if mrcc is not none %}
- {% if mrcc.needs_heredicare_upload and heredicare_queue_entry_summary["status"] in ["error", "api_error", "success", "waiting", "requested"] %}
+ {% if mrcc.needs_heredicare_upload and heredicare_queue_entry_summary["status"] in ["error", "api_error", "success", "waiting", "requested", "multiple stati"] %}
{{macros.draw_exclamation_mark("The consensus classification needs to be uploaded to HerediCaRe!")}}
{% endif %}
{% endif %}
@@ -154,8 +154,16 @@
+
+ {% if 'super_user' in session['user']['roles'] %}
+