Esempio n. 1
0
define('ROOT_PATH', '../');
require ROOT_PATH . 'inc-init.php';
session_write_close();
$aGenes = lovd_getGeneList();
if (empty($_GET['variant']) || !preg_match('/^([A-Z]{2}_\\d{6,9}\\.\\d{1,2}(\\([A-Za-z0-9-]+_v\\d{3}\\))?:[cn])|(chr.{0,2}:[gm])\\..+$/', $_GET['variant']) || empty($_GET['gene']) || !in_array($_GET['gene'], $aGenes)) {
    die(AJAX_DATA_ERROR);
}
// Requires at least LEVEL_SUBMITTER, anything lower has no $_AUTH whatsoever.
if (!$_AUTH) {
    // If not authorized, die with error message.
    die(AJAX_NO_AUTH);
}
require ROOT_PATH . 'class/soap_client.php';
$_Mutalyzer = new LOVD_SoapClient();
$sGene = $_GET['gene'];
// If the gene is defined in the mito_genes_aliases in inc-init.php, use the NCBI gene symbol.
if (isset($_SETT['mito_genes_aliases'][$_GET['gene']])) {
    $sGene = $_SETT['mito_genes_aliases'][$_GET['gene']];
}
try {
    $oOutput = $_Mutalyzer->numberConversion(array('build' => $_CONF['refseq_build'], 'variant' => $_GET['variant'], 'gene' => $sGene))->numberConversionResult;
} catch (SoapFault $e) {
    // FIXME: Perhaps indicate an error? Like in the check_hgvs script?
    die(AJAX_FALSE);
}
if ($oOutput && isset($oOutput->string)) {
    $sVariants = implode(';', $oOutput->string);
    die($sVariants);
} else {
    die(AJAX_FALSE);
}
Esempio n. 2
0
 $aToRemove = array();
 $aVariantDescriptions = array();
 require ROOT_PATH . 'class/soap_client.php';
 $_Mutalyzer = new LOVD_SoapClient();
 $aGenesUpdated = array();
 foreach ($_POST['transcripts'] as $nTranscript) {
     if ($nTranscript && !isset($aCurrentTranscripts[$nTranscript])) {
         // If the transcript is not already present in the database connected to this variant, we will add it now.
         $aNewTranscripts[] = $nTranscript;
         // Gather all necessary info from this transcript.
         $zTranscript = $_DB->query('SELECT id, geneid, name, id_ncbi FROM ' . TABLE_TRANSCRIPTS . ' WHERE id = ?', array($nTranscript))->fetchAssoc();
         // Call the numberConversion module of mutalyzer to get the VariantOnTranscript/DNA value for this variant on this transcript.
         // Check if we already have the converted positions for this gene, if so, we won't have to call mutalyzer again for this information.
         if (!array_key_exists($zTranscript['geneid'], $aVariantDescriptions)) {
             try {
                 $oOutput = $_Mutalyzer->numberConversion(array('build' => $_CONF['refseq_build'], 'variant' => 'chr' . $zData['chromosome'] . ':' . $zData['VariantOnGenome/DNA'], 'gene' => $zTranscript['geneid']))->numberConversionResult;
             } catch (Exception $e) {
             }
             if (isset($oOutput) && isset($oOutput->string)) {
                 $aVariantDescriptions[$zTranscript['geneid']] = $oOutput->string;
             } else {
                 $aVariantDescriptions[$zTranscript['geneid']] = array();
             }
         }
         $bAdded = false;
         if (count($aVariantDescriptions[$zTranscript['geneid']])) {
             // Loop through the mutalyzer output for this gene, see if we can find this transcript.
             foreach ($aVariantDescriptions[$zTranscript['geneid']] as $key => $sVariant) {
                 // Check if our transcript is in the variant description for each value returned by mutalyzer.
                 if (!empty($sVariant) && preg_match('/^' . preg_quote($zTranscript['id_ncbi']) . ':([cn]\\..+)$/', $sVariant, $aMatches)) {
                     // Call the mappingInfo module of mutalyzer to get the start & stop positions of this variant on the transcript.