Ejemplo n.º 1
0
     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.
             $aMapping = array();
             try {
                 $oOutput = $_Mutalyzer->mappingInfo(array('LOVD_ver' => $_SETT['system']['version'], 'build' => $_CONF['refseq_build'], 'accNo' => $zTranscript['id_ncbi'], 'variant' => $aMatches[1]))->mappingInfoResult;
                 if (isset($oOutput->errorcode)) {
                     throw new Exception();
                 }
                 $aMapping = array('position_c_start' => $oOutput->startmain, 'position_c_start_intron' => $oOutput->startoffset, 'position_c_end' => $oOutput->endmain, 'position_c_end_intron' => $oOutput->endoffset);
             } catch (Exception $e) {
             }
             if (!$aMapping) {
                 $aMapping = array('position_c_start' => 0, 'position_c_start_intron' => 0, 'position_c_end' => 0, 'position_c_end_intron' => 0);
             }
             // Insert all the gathered information about the variant description into the database.
             $_DB->query('INSERT INTO ' . TABLE_VARIANTS_ON_TRANSCRIPTS . ' (id, transcriptid, position_c_start, position_c_start_intron, position_c_end, position_c_end_intron, effectid, `VariantOnTranscript/DNA`) VALUES (?, ?, ?, ?, ?, ?, ?, ?)', array($nID, $nTranscript, $aMapping['position_c_start'], $aMapping['position_c_start_intron'], $aMapping['position_c_end'], $aMapping['position_c_end_intron'], $_SETT['var_effect_default'], $aMatches[1]));
             $bAdded = true;
             $aGenesUpdated[] = $aTranscripts[$nTranscript];
             // Speed improvement: remove this value from the output from mutalyzer, so we will not check this one again with the next transcript that we will add.
             unset($aVariantDescriptions[$zTranscript['geneid']][$key]);