Esempio n. 1
0
    // - Locations of variants (exon and intron numbers)?
    // - Variants in this gene reported in individuals with which diseases?
    //   * Too bad we don't know if these variants cause this disease. Search for pathogenicity only? YES
    // We need to create the DIV containers, the Graph object will fill it in.
    // To save ourselves a lot of code, we'll build the DIV containers as templates.
    $aGraphs = array('Variant type (DNA level, all ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'variants)' => array('variantsTypeDNA_all' => 'All ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'variants', 'variantsTypeDNA_unique' => 'Unique ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'variants'), 'Variant type (DNA level, all ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'pathogenic variants)' => array('variantsTypeDNA_all_pathogenic' => 'All ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'pathogenic variants', 'variantsTypeDNA_unique_pathogenic' => 'Unique ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'pathogenic variants'), 'Variant type (Protein level, all ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'variants) (note: numbers are sums for all transcripts of this gene)' => array('variantsTypeProtein_all' => 'All ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'variants', 'variantsTypeProtein_unique' => 'Unique ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'variants'), 'Variant type (Protein level, all ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'pathogenic variants) (note: numbers are sums for all transcripts of this gene)' => array('variantsTypeProtein_all_pathogenic' => 'All ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'pathogenic variants', 'variantsTypeProtein_unique_pathogenic' => 'Unique ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'pathogenic variants'), 'Variant location (DNA level, all ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'variants) (note: numbers are sums for all transcripts of this gene)' => array('variantsLocations_all' => 'All ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'variants', 'variantsLocations_unique' => 'Unique ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'variants'), 'Variant type (DNA level, all ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'pathogenic variants) (note: numbers are sums for all transcripts of this gene)' => array('variantsLocations_all_pathogenic' => 'All ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'pathogenic variants', 'variantsLocations_unique_pathogenic' => 'Unique ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'pathogenic variants'));
    foreach ($aGraphs as $sCategory => $aCategory) {
        print '      <H5>' . $sCategory . '</H5>' . "\n" . '      <TABLE border="0" cellpadding="2" cellspacing="0" width="900" style="height : 320px;">' . "\n" . '        <TR valign="top">';
        foreach ($aCategory as $sGraphID => $sTitle) {
            print "\n" . '          <TD width="50%">' . "\n" . '            <B>' . $sTitle . '</B><BR>' . "\n" . '            <DIV id="' . $sGraphID . '" style="width : 325px; height : 250px;"><IMG src="gfx/lovd_loading.gif" alt="Loading..."></DIV><BR><DIV id="' . $sGraphID . '_hover">&nbsp;</DIV></TD>';
        }
        print '</TR></TABLE>' . "\n\n";
    }
    flush();
    $_T->printFooter(false);
    $_G->variantsTypeDNA('variantsTypeDNA_all', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, false);
    $_G->variantsTypeDNA('variantsTypeDNA_unique', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, true);
    $_G->variantsTypeDNA('variantsTypeDNA_all_pathogenic', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, false, true);
    $_G->variantsTypeDNA('variantsTypeDNA_unique_pathogenic', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, true, true);
    $_G->variantsTypeProtein('variantsTypeProtein_all', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, false, false);
    $_G->variantsTypeProtein('variantsTypeProtein_unique', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, true, false);
    $_G->variantsTypeProtein('variantsTypeProtein_all_pathogenic', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, false, true);
    $_G->variantsTypeProtein('variantsTypeProtein_unique_pathogenic', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, true, true);
    $_G->variantsLocations('variantsLocations_all', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, false);
    $_G->variantsLocations('variantsLocations_unique', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, true);
    $_G->variantsLocations('variantsLocations_all_pathogenic', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, false, true);
    $_G->variantsLocations('variantsLocations_unique_pathogenic', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, true, true);
    print '</BODY>' . "\n" . '</HTML>' . "\n";
    exit;
}
if (PATH_COUNT == 2 && preg_match('/^[a-z][a-z0-9#@-]*$/i', rawurldecode($_PE[1])) && in_array(ACTION, array('authorize', 'sortCurators'))) {
Esempio n. 2
0
print '      <I>Current time: ' . date('r') . '</I><BR><BR>' . "\n\n";
require ROOT_PATH . 'class/graphs.php';
$_G = new LOVD_Graphs();
lovd_includeJS('lib/flot/jquery.flot.min.js');
lovd_includeJS('lib/flot/jquery.flot.pie.min.js');
print '      <!--[if lte IE 8]><SCRIPT type="text/javascript" src="lib/flot/excanvas.min.js"></SCRIPT><![endif]-->' . "\n\n";
// Statistics about genes:
$nGenes = $_DB->query('SELECT COUNT(*) FROM ' . TABLE_GENES)->fetchColumn();
// Genes, how many variants found? || Genes, how many diseases linked?
print '      <H5>Genes (' . $nGenes . ')</H5>' . "\n" . '      <TABLE border="0" cellpadding="2" cellspacing="0" width="900" style="height : 300px; border-bottom : 3px double #CCC;">' . "\n" . '        <TR valign="top">' . "\n" . '          <TD width="50%">' . "\n" . '            <B>' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? 'V' : 'Public v') . 'ariants per gene</B><BR>' . "\n" . '            <DIV id="genesNumberOfVariants" style="width : 325px; height : 250px;"><IMG src="gfx/lovd_loading.gif" alt="Loading..."></DIV><DIV id="genesNumberOfVariants_hover">&nbsp;</DIV></TD>' . "\n" . '          <TD width="50%">' . "\n" . '            <B>Linked diseases per gene</B><BR>' . "\n" . '            <DIV id="genesLinkedDiseases" style="width : 325px; height : 250px;"><IMG src="gfx/lovd_loading.gif" alt="Loading..."></DIV><DIV id="genesLinkedDiseases_hover">&nbsp;</DIV></TD></TR></TABLE><BR>' . "\n\n";
// Variant types (DNA level), whole database.
print '      <H5>Variant type (DNA level)</H5>' . "\n" . '      <TABLE border="0" cellpadding="2" cellspacing="0" width="900" style="height : 320px;">' . "\n" . '        <TR valign="top">' . "\n" . '          <TD width="50%">' . "\n" . '            <B>All ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . ' variants</B><BR>' . "\n" . '            <DIV id="variantsTypeDNA_all" style="width : 325px; height : 250px;"><IMG src="gfx/lovd_loading.gif" alt="Loading..."></DIV><DIV id="variantsTypeDNA_all_hover">&nbsp;</DIV></TD>' . "\n" . '          <TD width="50%">' . "\n" . '            <B>Unique ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'variants</B><BR>' . "\n" . '            <DIV id="variantsTypeDNA_unique" style="width : 325px; height : 250px;"><IMG src="gfx/lovd_loading.gif" alt="Loading..."></DIV><DIV id="variantsTypeDNA_unique_hover">&nbsp;</DIV></TD></TR></TABLE>' . "\n\n";
$_T->printFooter(false);
$_G->genesNumberOfVariants('genesNumberOfVariants', '*', $_AUTH['level'] >= LEVEL_COLLABORATOR);
$_G->genesLinkedDiseases('genesLinkedDiseases', '*');
$_G->variantsTypeDNA('variantsTypeDNA_all', '*', $_AUTH['level'] >= LEVEL_COLLABORATOR, false);
$_G->variantsTypeDNA('variantsTypeDNA_unique', '*', $_AUTH['level'] >= LEVEL_COLLABORATOR, true);
// Number of genes, number of variants in total, number of unique variants, number of diseases, etc? Not in graphs...
// Total screenings, total phenotypes, total individuals.
// Total number of curators, submitters? (percentage of users that is curator)
/*
$nTotalCurators = 0;
$nTotalCollaborators = 0;
$sSQL = 'SELECT g.id, g.name, g.updated_date, COUNT(u2g.userid) AS collaborators, SUM(u2g.allow_edit) AS curators FROM ' . TABLE_GENES . ' AS g LEFT OUTER JOIN ' . TABLE_CURATES . ' AS u2g ON (g.id = u2g.geneid) GROUP BY g.id ORDER BY g.id ASC';
$zGenes = $_DB->query($sSQL)->fetchAllAssoc();
$nGenes = count($zGenes);
foreach ($zGenes as $aGene) {
    $nCollaborators = ($aGene['collaborators'] - $aGene['curators']);
    print('  <TR class="data" id="' . $aGene['id'] . '" valign="top" style="cursor : pointer;" onclick="window.location.href=\'' . lovd_getInstallURL() . 'genes/' . rawurlencode($aGene['id']) . '\';">' . "\n" .
          '    <TD class="ordered"><A href="genes/' . rawurlencode($aGene['id']) . '" class="hide"><B>' . $aGene['id'] . '</B></A></TD>' . "\n" .
          '    <TD>' . $aGene['name'] . '</TD>' . "\n" .