Skip to content

Commit

Permalink
Merge pull request #654 from LOVDnl/update-external-tools
Browse files Browse the repository at this point in the history
Update libraries/scripts connecting to external tools.
  • Loading branch information
ifokkema authored Jul 3, 2024
2 parents 1c720aa + 4b4f533 commit c337be6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
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

0 comments on commit c337be6

Please sign in to comment.