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

Update libraries/scripts connecting to external tools #654

Merged
merged 4 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions src/ajax/mobidetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* LEIDEN OPEN VARIATION DATABASE (LOVD)
*
* Created : 2020-10-01
* Modified : 2024-05-07
* For LOVD : 3.0-30
* Modified : 2024-07-03
* For LOVD : 3.0-31
*
* Copyright : 2004-2024 Leiden University Medical Center; http://www.LUMC.nl/
* Programmer : Ivo F.A.C. Fokkema <[email protected]>
Expand Down Expand Up @@ -197,7 +197,7 @@
print('
$("#mobidetails_dialog").html("Error while requesting MobiDetails to annotate this variant.<BR>' .
implode(array_map(function ($sKey, $sVal) {
return $sKey . ': ' . $sVal . '<BR>';
return $sKey . ': ' . trim($sVal) . '<BR>';
}, array_keys($aJSON), array_values($aJSON))) . '");

// Select the right buttons.
Expand Down
13 changes: 10 additions & 3 deletions src/class/variant_validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* LEIDEN OPEN VARIATION DATABASE (LOVD)
*
* Created : 2020-03-09
* Modified : 2024-01-25
* For LOVD : 3.0-30
* Modified : 2024-07-03
* For LOVD : 3.0-31
*
* Copyright : 2004-2024 Leiden University Medical Center; http://www.LUMC.nl/
* Programmer : Ivo F.A.C. Fokkema <[email protected]>
Expand Down Expand Up @@ -131,7 +131,8 @@ private function addFault (&$aData, $sFault, $sVariant, $aVariantInfo = false)
// EREF error.
$aData['errors']['EREF'] = $sFault;
} elseif (strpos($sFault, 'is not associated with genome build') !== false
|| strpos($sFault, 'No transcript definition for') !== false) {
|| strpos($sFault, 'No transcript definition for') !== false
|| strpos($sFault, 'is not in our database. Please check the transcript') !== false) {
// EREFSEQ error.
$aData['errors']['EREFSEQ'] = $sFault;
} elseif (substr($sFault, 0, 5) == 'char '
Expand All @@ -152,6 +153,11 @@ private function addFault (&$aData, $sFault, $sVariant, $aVariantInfo = false)
$sFault, $aRegs)) {
// This is not that important, but we won't completely discard it, either.
$aData['messages']['IREFSEQUPDATED'] = 'Reference sequence ' . $aRegs[1] . ' can be updated to ' . $aRegs[2] . '.';
} elseif (preg_match(
'/^The following versions of the requested transcript are available in our database: (.+)$/',
$sFault, $aRegs)) {
// This is not that important, but we won't completely discard it, either.
$aData['messages']['IREFSEQUPDATED'] = 'Reference sequence can be updated to one of: ' . str_replace('|', ', ', $aRegs[1]) . '.';
} elseif (strpos($sFault, 'Caution should be used when reporting the displayed variant descriptions') !== false
|| strpos($sFault, 'The displayed variants may be artefacts of aligning') !== false) {
// Both these warnings are thrown at the same time when there are mismatches between the
Expand Down Expand Up @@ -199,6 +205,7 @@ private function callVV ($sMethod, $aArgs = array())
if (!$hCurl) {
$hCurl = curl_init();
curl_setopt($hCurl, CURLOPT_RETURNTRANSFER, true); // Return the result as a string.
curl_setopt($hCurl, CURLOPT_FOLLOWLOCATION, true); // Make sure we follow redirects.
if (!empty($_SETT['system']['version'])) {
curl_setopt($hCurl, CURLOPT_USERAGENT, 'LOVDv.' . $_SETT['system']['version']); // Return the result as a string.
}
Expand Down