Skip to content

Commit 030ad48

Browse files
authored
fix changes to html in clinvar to capture VCV related data. (#94)
1 parent 43efe91 commit 030ad48

File tree

3 files changed

+11
-27
lines changed

3 files changed

+11
-27
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ The chrome extension is used by the ClinGen curation workflow (link) ...
77

88
## Release Notes
99

10+
### v3.1
11+
* ClinVar UI changes on Feb.24.2025 introduced issues with the top-level VCV information scraping from the html. This has been resolved.
12+
1013
### v3.0
1114
* This is a combination of merging and modifying v1.16 and v2.0.2 below.
1215
* Major update to the internal code and configuration based on Google chrome extension manifest v3 specifications.

scvc/content.js

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -40,38 +40,19 @@ function extractClinVarData() {
4040
vcv_eval_date: "",
4141
row: []
4242
};
43-
44-
var variantBox = document.evaluate("//div[@id='new-variant-details']//dl", document, null, XPathResult.ANY_TYPE, null );
45-
var variantBoxHTML = variantBox.iterateNext().innerHTML;
4643

47-
// for 3 and 4 start vcvs the review status and classification are found with the following
48-
var vcvClassificationText = document.evaluate("//div[@class='germline-section']//div[@class='classi-text']", document, null, XPathResult.ANY_TYPE, null );
49-
var vcvReviewStatus = document.evaluate("//div[@class='germline-section']//div[@class='review-text']", document, null, XPathResult.ANY_TYPE, null );
44+
var vcvClassificationText = document.evaluate("//div[@class='germline-section']//div[@class='single-item-value']/text()", document, null, XPathResult.STRING_TYPE, null).stringValue.trim();
45+
var vcvReviewStatus = document.evaluate("//div[@class='germline-section']//div[@id='germline-stars-icon']/p/text()", document, null, XPathResult.STRING_TYPE, null).stringValue.trim();
46+
vcvReviewStatus = vcvReviewStatus.replace(/\.$/g, '');
5047

51-
var vcvClassificationTextNode = vcvClassificationText.iterateNext();
52-
var vcvReviewStatusNode = vcvReviewStatus.iterateNext();
53-
54-
if (!vcvClassificationTextNode) {
55-
// for 2 star and below the vcvs review status and classifiction are found with the following
56-
vcvClassificationText = document.evaluate("//div[@class='germline-section']//div[@class='single-item-value']", document, null, XPathResult.ANY_TYPE, null );
57-
vcvReviewStatus = document.evaluate("//div[@class='germline-section']//div[@class='section-cnt']//span", document, null, XPathResult.ANY_TYPE, null );
58-
vcvClassificationTextNode = vcvClassificationText.iterateNext();
59-
vcvReviewStatusNode = vcvReviewStatus.iterateNext();
60-
}
61-
62-
if (!vcvClassificationTextNode) {
63-
// for vcv with no germline scvs there is no classification and review status
64-
vcvClassificationText = document.evaluate("//div[@class='germline-section']/p[@class='without-classification']", document, null, XPathResult.ANY_TYPE, null );
65-
vcvReviewStatus = document.evaluate("//div[@class='germline-section']/p[@class='without-classification']", document, null, XPathResult.ANY_TYPE, null );
66-
vcvClassificationTextNode = vcvClassificationText.iterateNext();
67-
vcvReviewStatusNode = vcvReviewStatus.iterateNext();
68-
}
48+
var variantBox = document.evaluate("//div[@id='new-variant-details']//dl", document, null, XPathResult.ANY_TYPE, null );
49+
var variantBoxHTML = variantBox.iterateNext().innerHTML;
6950

7051
clinvarData.name = document.querySelectorAll('#variant-details-table div div dl dd p')[0].innerText;
7152
clinvarData.vcv = getMatch(variantBoxHTML, vcv_accession_re, 1);
7253
clinvarData.variation_id = getMatch(variantBoxHTML, vcv_variation_id_re, 1);
73-
clinvarData.vcv_review = vcvReviewStatusNode.textContent.trim();
74-
clinvarData.vcv_interp = vcvClassificationTextNode.textContent.trim();
54+
clinvarData.vcv_review = vcvReviewStatus;
55+
clinvarData.vcv_interp = vcvClassificationText;
7556

7657
var timelineArray = document.querySelectorAll('table.timeline-table tbody tr td');
7758
clinvarData.vcv_most_recent = timelineArray[2].innerHTML;

scvc/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "ClinVar Curator (v3)",
4-
"version": "3.0",
4+
"version": "3.1",
55
"description": "Extract SCVs for annotation based on the ClinGen ClinVar Curation prolicies.",
66

77
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwC5g4vkDlMPFTsByPnG9WI9lY+IPWddES8SK3cxCuBQE5qSdgEgtDhrRLhXSvcIdUUCDwD7JzEPdQ0IhC3APwsKQJPQlDRweZvyFaTJOm6r5Blp3HvLphDuKZQwUoEzMuXK7IAby05kXPZTMSHas+0m00hHoR8ls//tqKoYt7N/lVj6Mry6nSpr5wFU17HPO8MksyxFlNDhu5OYcgOdTNjUiWthjZ8Xxd0ajdaR1QRoqVCQduUTSAzeptQ1+zYZtEX7+HF8jfZqc5BQDa5GoCuDyTvFvQAHl3Phz3zMWpvcGWR3jCMHD5zthiO8NKX+h2fXbGGrYhuwtQmHLWmTAsQIDAQAB",

0 commit comments

Comments
 (0)