Example #1
0
 // Load appropriate user level for this gene.
 lovd_isAuthorized('gene', $sID);
 lovd_requireAUTH(LEVEL_CURATOR);
 require ROOT_PATH . 'class/object_genes.php';
 require ROOT_PATH . 'inc-lib-form.php';
 $_DATA = new LOVD_Gene();
 $zData = $_DATA->loadEntry($sID);
 // 2015-07-22; 3.0-14; Drop usage of CURRENT_PATH in favor of fixed $sID which may have a gene symbol with incorrect case.
 // Now fix possible issues with capitalization. inc-init.php does this for $_SESSION['currdb'], but we're using $sID.
 $sID = $zData['id'];
 $sPath = $_PE[0] . '?' . ACTION;
 if (GET) {
     require ROOT_PATH . 'inc-lib-genes.php';
     $aRefseqGenomic = array();
     // Get LRG if it exists
     if ($sLRG = lovd_getLRGbyGeneSymbol($sID)) {
         $aRefseqGenomic[] = $sLRG;
     }
     // Get NG if it exists
     if ($sNG = lovd_getNGbyGeneSymbol($sID)) {
         $aRefseqGenomic[] = $sNG;
     }
     // Get NC from LOVD
     $aRefseqGenomic[] = $_SETT['human_builds'][$_CONF['refseq_build']]['ncbi_sequences'][$zData['chromosome']];
     if (!isset($_SESSION['work'][$sPath])) {
         $_SESSION['work'][$sPath] = array();
     }
     while (count($_SESSION['work'][$sPath]) >= 5) {
         unset($_SESSION['work'][$sPath][min(array_keys($_SESSION['work'][$sPath]))]);
     }
     // Generate an unique workID that is sortable.
Example #2
0
     }
 }
 $aGenesWeCanMapTo = array_unique($aGenesWeCanMapTo);
 if ($aVariant['mapping_flags'] & MAPPING_ALLOW_CREATE_GENES && count($aGenesWeCanMapTo)) {
     // We may add extra genes to map this variant to. $aGenes contains genes we can map to.
     // Try the genes one by one.
     foreach ($aGenesWeCanMapTo as $sGene) {
         // Get information from HGNC.
         $aGeneInfoFromHgnc = lovd_getGeneInfoFromHgncOld($sGene, array('gd_hgnc_id', 'gd_app_sym', 'gd_app_name', 'gd_pub_chrom_map', 'gd_locus_type', 'gd_pub_eg_id', 'md_mim_id', 'gd_pub_refseq_ids', 'md_refseq_id'), true);
         if (empty($aGeneInfoFromHgnc)) {
             // Couldn't find this gene. Try the next.
             continue;
         }
         list($sHgncID, $sSymbol, $sGeneName, $sChromLocation, $sLocusType, $sEntrez, $sOmim, $sRefseq1, $sRefseq2) = array_values($aGeneInfoFromHgnc);
         // Get LRG if it exists.
         if (!($sRefseqGenomic = lovd_getLRGbyGeneSymbol($sSymbol))) {
             // No LRG, get NG if it exists.
             if (!($sRefseqGenomic = lovd_getNGbyGeneSymbol($sSymbol))) {
                 // Also no NG, use the NC instead.
                 $sRefseqGenomic = $_SETT['human_builds'][$_CONF['refseq_build']]['ncbi_sequences'][$sChromosome];
             }
         }
         // Get UD.
         try {
             $sRefseqUD = lovd_getUDForGene($_CONF['refseq_build'], $sSymbol);
             $sRef = $sRefseqUD;
         } catch (SoapFault $e) {
         }
         // Silent error.
         if (!is_string($sRefseqUD) || substr($sRefseqUD, 0, 3) != 'UD_') {
             $sRefseqUD = false;