Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve/variant creation form #588

Open
wants to merge 99 commits into
base: release/3.5
Choose a base branch
from
Open
Changes from 3 commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
475c3ee
Add 'relative to' message to both DNA fields
loeswerkman Oct 6, 2021
998fd1b
Allow element data to be added into HTML via viewForm
loeswerkman Oct 7, 2021
eb3b9ea
Add genome build as element data into viewForm
loeswerkman Oct 7, 2021
1d121fd
Redo code to add source to variants using element data
loeswerkman Oct 7, 2021
2fc7097
Add map button to all DNA fields in variant data entry form
loeswerkman Oct 7, 2021
1d3dad7
Remove disabled method.
ifokkema Oct 8, 2021
e607423
When adding to the DNA field description, don't overwrite anything.
ifokkema Oct 8, 2021
77a3e86
Improved efficiency of variables a bit, shortening the code.
ifokkema Oct 8, 2021
68f4ff4
Clean up the code a bit, and simply selecting VOG/DNA fields in JS.
ifokkema Oct 8, 2021
a9dbc6d
Add IsHGVS function and Unit test
loeswerkman Oct 15, 2021
4e83069
Open checkHGVS dialogue in variant creation form
loeswerkman Jan 21, 2022
8949e05
Create and implement the isHGVS wrapper function
loeswerkman Jan 27, 2022
5ef4aeb
Merge branch 'release/3.5' into improve/variantCreationForm
loeswerkman Feb 10, 2022
d94faee
Add an '@' before the ob_end_flush()
loeswerkman Feb 10, 2022
2d9c9c7
Add 'supported_by_VV' to GBs in
loeswerkman Feb 10, 2022
b1ccf66
Fix spelling
loeswerkman Feb 10, 2022
e0b4d90
WIP: Redoing the mapping and validation through VV
loeswerkman Feb 10, 2022
63e05e5
Simplify and clean up code; shorten the output
loeswerkman Feb 21, 2022
fce7fb8
Document the fact that flush() does not work here
loeswerkman Feb 21, 2022
d7d5282
Replaced flush() calls with recursive calls
loeswerkman Feb 23, 2022
4f3e8e5
Allow variants which VV cannot validate into the DB
loeswerkman Feb 24, 2022
5227038
Clean up the output and accredit VariantValidator
loeswerkman Feb 24, 2022
723cd57
Remove redundant VV call for multiple transcripts
loeswerkman Feb 24, 2022
32cbf30
Change line separators from CRLF to LF
loeswerkman Feb 24, 2022
9915eda
Reset the output if the variant is an empty string
loeswerkman Feb 24, 2022
6e4e443
Handle exit as a statement instead of a function
loeswerkman Feb 24, 2022
ea1e4bd
Clean up bits of the code
loeswerkman Feb 25, 2022
4f57803
WIP: Save md5 translation of validated variants
loeswerkman Feb 26, 2022
4562560
WIP: Save md5 translation of validated variants
loeswerkman Feb 26, 2022
0ba1f0c
Fix bug when no transcripts are given
loeswerkman Mar 1, 2022
b0ffbbe
Fix issue causing blocked fields to not reach POST
loeswerkman Mar 1, 2022
a8afce5
Fix issue when setting the md5 key after validation
loeswerkman Mar 1, 2022
aa272d0
Merge branch 'improve/variantCreationForm' of github.com:LOVDnl/LOVD3…
loeswerkman Mar 1, 2022
07b52e6
Update documentation to better fit the code
loeswerkman Mar 1, 2022
7e75c35
Fix indentation
loeswerkman Mar 1, 2022
cc0dcda
Merge branch 'release/3.5' into gb/mapNewVariants
loeswerkman Mar 1, 2022
82abf86
Merge branch 'gb/mapNewVariants' into improve/variantCreationForm
loeswerkman Mar 1, 2022
fc90491
Fetch GB IDs using the data element and not SQL
loeswerkman Mar 2, 2022
afda306
Clean up code that checks refSeqs in description
loeswerkman Mar 2, 2022
20ea1e3
Stop blocking the 'Ignore this transcript' button
loeswerkman Mar 2, 2022
d9bf913
Fix bug and add comment to code which resets values
loeswerkman Mar 2, 2022
0a82e7f
Reset all values when the dialogue is called
loeswerkman Mar 3, 2022
a9f8773
Add the source of the variant when it is mapped
loeswerkman Mar 3, 2022
daee268
Trigger HGVS check when the chromosome is updated
loeswerkman Mar 3, 2022
ee315bb
Stop expiring the cache for inc-js-variants.php
loeswerkman Mar 3, 2022
3e3b691
Add css classes to the input fields to show status
loeswerkman Mar 3, 2022
fb3ce67
Fix bug when resetting the script
loeswerkman Mar 3, 2022
534d05f
Simplify code and add class to RNA&Protein fields
loeswerkman Mar 3, 2022
bc8b39c
Disable the Enter for all DNA fields
loeswerkman Mar 3, 2022
83b07f0
Fix all code that has to do with URL encoding
loeswerkman Mar 3, 2022
4fa5279
Reset all values based on whether mapping status
loeswerkman Mar 3, 2022
bb648a1
Make sure the dialog is closed if an error occurs
loeswerkman Mar 3, 2022
3ea60b2
Remove md5 key; Use checkFields to check input
loeswerkman Mar 3, 2022
186176b
Add documentation to the checkFields addition
loeswerkman Mar 3, 2022
c9cbda4
Get rid of the $_GET['chromosome'] usage
loeswerkman Mar 3, 2022
b4abbe2
Remove MD5 key function that is no longer used
loeswerkman Mar 4, 2022
6f154b2
Remove hidden codedVariants field (md5 key)
loeswerkman Mar 4, 2022
be5f3e6
Removing flush()
loeswerkman Mar 4, 2022
ca7a8e4
Take string, not int in update_images_per_step()
loeswerkman Mar 4, 2022
34b397e
Clean up code around update_dialogue() calls
loeswerkman Mar 4, 2022
e691e0e
Add documentation to the possible reset
loeswerkman Mar 4, 2022
4f976d6
Fix old typing in documentation
loeswerkman Mar 4, 2022
58e2165
Add and update documentation
loeswerkman Mar 4, 2022
0e983f3
Add addslashes() for safe keeping
loeswerkman Mar 4, 2022
88e9ba7
Remove old code related to the md5 key
loeswerkman Mar 4, 2022
3f9d7e3
Fix strange line separation
loeswerkman Mar 4, 2022
7a63d5e
Restore cache header
loeswerkman Mar 4, 2022
08cbb5f
Add documentation to lovd_checkHGVS()
loeswerkman Mar 4, 2022
4362e90
Update header
loeswerkman Mar 25, 2022
e9eea63
Clear up class name 'acc' to 'accept
loeswerkman Mar 25, 2022
b11ff02
Stop resetting values if an empty string is passed
loeswerkman Mar 25, 2022
f436950
Remove use of variables for buttons and images
loeswerkman Mar 25, 2022
aa1c715
Remove display:none and .show() for all imgs
loeswerkman Mar 25, 2022
9e450dc
Fix issue regarding oChromosome variable
loeswerkman Mar 25, 2022
e783dc0
Clean up the selection of an object by its data
loeswerkman Mar 25, 2022
ff584cf
Fill in fields that remained empty after mapping
loeswerkman Mar 25, 2022
752fd19
Use strpos instead of regex to find DNA fields
loeswerkman Mar 25, 2022
f626d4e
Fix and clean code that checks the variant format
loeswerkman Mar 25, 2022
ac3de94
Use 'https' instead of 'http' for the HGVS link
loeswerkman Mar 25, 2022
9436ec7
Fill and deactivate empty fields after mapping
loeswerkman Mar 25, 2022
2d443ac
Clarify message when VV threw a syntax/build
loeswerkman Mar 25, 2022
121a300
Remove RefSeq from description in OKCouldBeValid
loeswerkman Mar 25, 2022
6f9bef4
Fix concatenations of strings and strings
loeswerkman Mar 31, 2022
66f7a76
Get rid of negative selection to fill empty fields
loeswerkman Mar 31, 2022
5c3cc75
Fix code around strpos that finds 'DNA'
loeswerkman Mar 31, 2022
a96825a
Fix dates
loeswerkman Mar 31, 2022
a906b9c
Only reset values if the DB holds human GBs
loeswerkman Apr 8, 2022
e156a4e
Fix dates
loeswerkman Apr 8, 2022
a00ddfc
WIP: Only mapping GBs recognised by LOVD and VV
loeswerkman Apr 11, 2022
03c995a
Remove floating var_dump
loeswerkman Apr 12, 2022
03f5a4b
Remove refseq from not-accepted variants
loeswerkman Apr 12, 2022
3639e62
Update dates
loeswerkman Apr 12, 2022
b5d5c49
Use htmlspecialchars around all REQUEST variables
loeswerkman Apr 12, 2022
c89a307
Add documentation regarding REQUEST/POST/GET
loeswerkman Apr 12, 2022
eda072b
Make sure all variables in output are safe
loeswerkman Apr 13, 2022
8d6dfa0
Fix minor issue in refSeq ternary if
loeswerkman Apr 13, 2022
cd542ba
Update dates
loeswerkman Apr 13, 2022
6c9c5c2
Clarify error message that is thrown when VV fails
loeswerkman Apr 13, 2022
6a38123
Fix issues concerning URL en- & decoding
loeswerkman Jun 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 25 additions & 12 deletions src/ajax/check_hgvs_dialogue.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,15 @@
// We could not validate this variant, but the problem
// lies with us. We will accept this variant and the
// uncertainty that comes with it.
// Just to be sure, we remove the reference sequence here,
// because it might still be stuck to the variant
// description from the mapping process.
var oInput = $(\'input[name="' . $sFieldName . '"]\');
oInput.val("' . addslashes($sVariant) . '").attr("class", "warn");
oInput.val("' . substr(strstr(addslashes($sVariant), ':'), 1) . '").attr("class", "warn");
oInput.siblings("img:first").attr({src: "gfx/check_orange.png", title: "Your variant could not be (in)validated..."});
$(this).dialog("close");
}};
');
'); // Fixme; Use lovd_removeRefSeq once the necessary code has been pulled in (from the branch feat/checkHGVSTool)


// Create a PHP function to easily update the dialogue.
Expand Down Expand Up @@ -409,7 +412,8 @@ function update_images_per_step($sStep, $sImage)
// We will have to allow these variants into the database.
update_images_per_step('statusMapping', 'gfx/cross.png');
update_dialogue(
'<br>Something went wrong on our side, which means we could not map nor validate your variant.',
'<br>This variant type is not supported by VariantValidator.' .
' Therefore, we can only check the syntax and not perform the mapping.',
'oButtonOKCouldBeValid'
);
exit;
Expand Down Expand Up @@ -575,17 +579,26 @@ function update_images_per_step($sStep, $sImage)
}


// Fill in all fields that remained empty.
// Fill and deactivate all fields that remained empty.
// Some fields might not have been filled after the mapping. Some
// unknown issues have occurred here, most likely concerning the
// reference sequence. Because we want to allow users to fill in
// these fields without that resulting in a reset of all values,
// we will deactivate the onChanges for these fields and warn the
// user.
print('
// Fill in all fields that remained empty.
$(\'#variantForm input[name*="VariantOnGenome"]\').each(function(e){
if($(this).val()==="") {
$(this).val("g.?");
}
});
$(\'#variantForm input[name*="VariantOnTranscript"]\').each(function(e){
if($(this).val()==="" && !$(this).attr("name").endsWith("Exon")) {
$(this).val("c.?");
$(\'#variantForm input[name*="VariantOn"]\').each(function(e){
sName = $(this).attr("name");
if ($(this).val() === ""
&& !(sName.endsWith("Exon") || sName.endsWith("DBID") || sName.endsWith("Reference"))) {
loeswerkman marked this conversation as resolved.
Show resolved Hide resolved
if (sName.includes("Genome")) {
$(this).val("g.?");
} else {
$(this).val((sName.endsWith("DNA")? "c" : (sName.endsWith("RNA")? "r" : "p")) + ".?");
}
$(this).off("change").attr("class", "warn");
$(this).siblings("img:first").attr({src: "gfx/check_orange.png", title: "Variant mapping failed! The HGVS check of this field is turned off to allow changes to be made freely. To turn the checks back on, refresh the page."});
}
});
');
Expand Down