Skip to content

Commit

Permalink
added new reason resulting from discordance project (#91)
Browse files Browse the repository at this point in the history
added "remove flagged submission" action
  • Loading branch information
larrybabb authored Nov 21, 2024
1 parent 516c34e commit 17c0525
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 41 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ The chrome extension is used by the ClinGen curation workflow (link) ...

## Release Notes

### v1.16
* Issue #89 - add new flagging candidate reason resulting from discordance project
* Issue #90 - add new 'Remove Flagged Submission' action

### v1.15
* Fixed addeition minor UI changes related to EP and PG related VCVs from the 03.Jun.24 HTML updates from clinvar. see bug [#83](https://github.com/clingen-data-model/clinvar-curation-input-tool/issues/83) for more info.

Expand Down
3 changes: 2 additions & 1 deletion scvc/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ chrome.extension.onMessage.addListener(
new Date(), // Timestamp
request.submitter_id,
request.variation_id,
request.user_email
request.user_email,
request.review_status
]]};
}

Expand Down
2 changes: 1 addition & 1 deletion scvc/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ClinVar Curator",
"version": "1.15",
"version": "1.16",
"description": "Capture SCV annotations from ClinVar variant screen in a google sheet.",
"manifest_version": 2,
"key" : "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwC5g4vkDlMPFTsByPnG9WI9lY+IPWddES8SK3cxCuBQE5qSdgEgtDhrRLhXSvcIdUUCDwD7JzEPdQ0IhC3APwsKQJPQlDRweZvyFaTJOm6r5Blp3HvLphDuKZQwUoEzMuXK7IAby05kXPZTMSHas+0m00hHoR8ls//tqKoYt7N/lVj6Mry6nSpr5wFU17HPO8MksyxFlNDhu5OYcgOdTNjUiWthjZ8Xxd0ajdaR1QRoqVCQduUTSAzeptQ1+zYZtEX7+HF8jfZqc5BQDa5GoCuDyTvFvQAHl3Phz3zMWpvcGWR3jCMHD5zthiO8NKX+h2fXbGGrYhuwtQmHLWmTAsQIDAQAB",
Expand Down
1 change: 1 addition & 0 deletions scvc/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ <h6 id="name">Variant Name</h6>
<option selected value="">Choose...</option>
<option id="no-chg-opt" value="No Change">No Change</option>
<option id="non-contrib-opt" value="Flagging Candidate">Flagging Candidate</option>
<option id="non-contrib-opt" value="Remove Flagged Submission">Remove Flagged Submission</option>
</select>
</div>
</div>
Expand Down
89 changes: 50 additions & 39 deletions scvc/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ window.addEventListener('DOMContentLoaded', () => {
reason: document.getElementById("reason").value,
notes: document.getElementById("notes").value,
user_email: "",
vcv_interp: document.getElementById("vcv_interp").value
vcv_interp: document.getElementById("vcv_interp").value,
review_status: document.getElementById("review").value
}

if (!data.scv) {
Expand All @@ -69,8 +70,8 @@ window.addEventListener('DOMContentLoaded', () => {
return;
}

if (data.action == "Flagging Candidate" && !data.reason) {
alert("A reason is required for Flagging Candidates. Please select one from the dropdown before submitting.");
if (data.action != "No Change" && !data.reason) {
alert(`A reason is required for '{data.action}'. Please select one from the dropdown before submitting.`);
return;
}

Expand Down Expand Up @@ -172,7 +173,7 @@ window.addEventListener('DOMContentLoaded', () => {

document.getElementById("action").addEventListener("change", function() {

var nonContribtoryReasonOptions = {
var flaggingCandidateReasonOptions = {
'Submission errors': [
'New submission from submitter that appears to have been intended to update this older submission',
'Other submission error'],
Expand All @@ -184,53 +185,63 @@ window.addEventListener('DOMContentLoaded', () => {
'Older claim that does not account for recent evidence',
'Claim with insufficient supporting evidence',
'Outlier claim with insufficient supporting evidence',
'Conflicts with expert reviewed submission without evidence to support different classification']
'Conflicts with expert reviewed submission without evidence to support different classification',
'P/LP classification for a variant in a gene with insufficient evidence for a gene-disease relationship']
};
var flaggedSubmissionReasonOptions = {
'':[
'Other SCVs submitted for VCV record',
'Gene-disease relationship classification has changed',
'Discussion with submitter',
'Curation error'
]
};
var reasonsByAction = {
'Flagging Candidate': nonContribtoryReasonOptions
'Flagging Candidate': flaggingCandidateReasonOptions,
'Remove Flagged Submission': flaggedSubmissionReasonOptions,
};

function setReasonsByAction(action) {
var reason = document.getElementById('reason');
function setReasonsByAction(action) {
var reason = document.getElementById('reason');

// reset
reason.innerHTML = "";
var opt1 = document.createElement("option");
opt1.text = 'Choose...';
opt1.value = "";
opt1.selected = true;
reason.add(opt1);
// reset
reason.innerHTML = "";
var opt1 = document.createElement("option");
opt1.text = 'Choose...';
opt1.value = "";
opt1.selected = true;
reason.add(opt1);

//loop through reasonsByAction and add options reason selector
if (reasonsByAction[action])
Object.entries(reasonsByAction[action]).forEach(addOptGroup);
//loop through reasonsByAction and add options reason selector
if (reasonsByAction[action])
Object.entries(reasonsByAction[action]).forEach(addOptGroup);

// add "other"
var opt2 = document.createElement("option");
opt2.text = "Other";
opt2.value = "Other";
reason.add(opt2);
// add "other"
var opt2 = document.createElement("option");
opt2.text = "Other";
opt2.value = "Other";
reason.add(opt2);

function addOptGroup(grp, index) {
var optgroup;
function addOptGroup(grp, index) {
var optgroup;

if (grp[0]) {
optgroup = document.createElement("optgroup");
optgroup.label = grp[0];
reason.add(optgroup);
}
if (grp[0]) {
optgroup = document.createElement("optgroup");
optgroup.label = grp[0];
reason.add(optgroup);
}

for (let i = 0; i < grp[1].length; i++) {
var option = document.createElement("option");
option.text = grp[1][i];
option.value = grp[1][i];
if (optgroup)
optgroup.appendChild(option);
else
reason.add(option);
}
for (let i = 0; i < grp[1].length; i++) {
var option = document.createElement("option");
option.text = grp[1][i];
option.value = grp[1][i];
if (optgroup)
optgroup.appendChild(option);
else
reason.add(option);
}
}
}

var selectedVal = document.getElementById("action").value;

Expand Down

0 comments on commit 17c0525

Please sign in to comment.