5532506f80e32d334d9898c6e7d23a054c7df5b1 kate Wed Jun 27 21:12:18 2012 -0700 Add special-casing to separate out Small RNA as a separate data type diff --git src/hg/js/encodeDataMatrix.js src/hg/js/encodeDataMatrix.js index 0f66c81..8f808b9 100644 --- src/hg/js/encodeDataMatrix.js +++ src/hg/js/encodeDataMatrix.js @@ -42,38 +42,40 @@ // set up structures for cell types and their tiers cellTiers = encodeProject.getCellTiers(cellTypes, encodeMatrix_organism); // gather experiments into matrix // NOTE: dataTypeExps is populated here matrix = makeExperimentMatrix(experiments, dataTypeExps); // fill in table using matrix encodeMatrix.tableOut($matrixTable, matrix, cellTiers, dataGroups, dataTypeExps, encodeProject.pruneDataGroupsToExps, tableHeaderOut, rowAddCells); } function makeExperimentMatrix(experiments, dataTypeExps) { // Populate dataType vs. cellType array with counts of experiments - var dataType, cellType; + var dataType, cellType, exp; var matrix = {}; - $.each(experiments, function (i, exp) { + $.each(experiments, function (i, experiment) { // exclude ref genome annotations - if (exp.cellType === 'None') { + if (experiment.cellType === 'None') { return true; } + // adjust experiment as needed for display purposes + exp = encodeProject.adjustExperiment(experiment); // count experiments per dataType so we can prune those having none // (the matrix[cellType] indicates this for cell types // so don't need hash for those dataType = exp.dataType; if (dataTypeExps[dataType] === undefined) { dataTypeExps[dataType] = 0; } dataTypeExps[dataType]++; cellType = exp.cellType; if (!matrix[cellType]) { matrix[cellType] = {}; } if (!matrix[cellType][dataType]) { @@ -154,31 +156,31 @@ // no data types in this organism for this group return true; } $.each(group.dataTypes, function (i, dataTypeLabel) { dataType = encodeProject.getDataTypeByLabel(dataTypeLabel).term; $td = $('<td></td>'); $td.addClass('matrixCell'); $row.append($td); if (cellType === null) { return true; } if (!matrix[cellType][dataType]) { $td.addClass('todoExperiment'); return true; } - // this cell represents experiments that + // this cell represents experiments // fill in count, mouseover and selection by click $td.addClass('experiment'); $td.text(matrix[cellType][dataType]); $td.data({ 'dataType' : dataType, 'cellType' : cellType }); $td.attr('title', 'Click to select: ' + encodeProject.getDataType(dataType).label + ' in ' + cellType +' cells'); // add highlight when moused over encodeMatrix.hoverExperiment($td); $td.click(function() {