// Show different graphs about this gene; variant type (DNA, RNA & Protein level), ... $sID = rawurldecode($_PE[1]); define('PAGE_TITLE', 'Graphs & statistics on gene ' . $sID); $_T->printHeader(); $_T->printTitle(); // Load authorization, collaborators and up see statistics about all variants, not just the public ones. lovd_isAuthorized('gene', $sID); // Check if there are variants at all. $nVariants = $_DB->query('SELECT COUNT(*) FROM ' . TABLE_VARIANTS . ' AS vog INNER JOIN ' . TABLE_VARIANTS_ON_TRANSCRIPTS . ' AS vot USING (id) INNER JOIN ' . TABLE_TRANSCRIPTS . ' AS t ON (vot.transcriptid = t.id) WHERE t.geneid = ?' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : ' AND statusid >= ' . STATUS_MARKED), array($sID))->fetchColumn(); if (!$nVariants) { lovd_showInfoTable('There are currently no ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'variants in this gene.', 'stop'); $_T->printFooter(); exit; } 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"; // FIXME; Implement: // Check what's left here. // - Variant types (RNA). // - 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) {
* You should have received a copy of the GNU General Public License * along with LOVD. If not, see <http://www.gnu.org/licenses/>. * *************/ define('ROOT_PATH', './'); require ROOT_PATH . 'inc-init.php'; if ($_AUTH) { // If authorized, check for updates. require ROOT_PATH . 'inc-upgrade.php'; } define('PAGE_TITLE', 'Current system status'); $_T->printHeader(); $_T->printTitle(); 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"> </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"> </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"> </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"> </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...