44bbb36829e709998760b22a59dc3fac09b2dd33 kate Tue Nov 1 19:43:13 2011 -0700 Complete features for ChIP-seq diff --git src/hg/js/encodeDataMatrix.js src/hg/js/encodeDataMatrix.js index efe8d35..85e247f 100644 --- src/hg/js/encodeDataMatrix.js +++ src/hg/js/encodeDataMatrix.js @@ -130,75 +130,74 @@ $(".floatHeader #searchTypePanel").remove(); // Note: user-defined callback requires // default actions from floatHeader plugin // implementation (stop+fadeIn) header.stop(true, true); header.fadeIn(100); } }); } function handleServerData(responses) { // main actions, called when loading data from server is complete var experiments = responses[0], dataTypes = responses[1], cellTypes = responses[2], expIds = responses[3]; - var matrix = {}; var dataGroups, cellTiers, expIdHash, header; + var matrix = {}; hideLoadingImage(spinner); $('#matrixTable').show(); - // set up structures for data types and their groups - $.each(dataTypes, function (i, item) { - dataTypeTermHash[item.term] = item; - dataTypeLabelHash[item.label] = item; + $.each(dataTypes, function (i, dataType) { + dataTypeTermHash[dataType.term] = dataType; + dataTypeLabelHash[dataType.label] = dataType; }); // data type labels tucked into their tiers dataGroups = encodeProject.getDataGroups(dataTypes); // set up structures for cell types and their tiers - $.each(cellTypes, function (i, item) { - cellTypeHash[item.term] = item; + $.each(cellTypes, function (i, cellType) { + cellTypeHash[cellType.term] = cellType; }); cellTiers = encodeProject.getCellTiers(cellTypes); // use to filter out experiments not in this assembly expIdHash = encodeProject.getExpIdHash(expIds); // gather experiments into matrix $.each(experiments, function (i, exp) { // todo: filter out with arg to hgApi if (exp.organism !== organism) { return true; } // exclude ref genome annotations if (exp.cellType === 'None') { return true; } if (expIdHash[exp.ix] === undefined) { return true; } // 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 (!dataTypeTermHash[dataType].count) { dataTypeTermHash[dataType].count = 0; } - dataTypeTermHash[dataType].count++; + ataTypeTermHash[dataType].count++; cellType = exp.cellType; if (!matrix[cellType]) { matrix[cellType] = {}; } if (!matrix[cellType][dataType]) { matrix[cellType][dataType] = 0; } matrix[cellType][dataType]++; }); // fill in table tableOut(matrix, cellTiers, dataGroups); }