a2a021905196ddc79f605ee081113e5eb00fd6ca kate Tue Apr 10 22:17:31 2012 -0700 hgEncodeApi cleanup - retire encodeExpId request. Merge functionality into experiments request (it now filters on db= parameter) diff --git src/hg/js/encodeDataSummary.js src/hg/js/encodeDataSummary.js index 6afce12..c1de9e6 100644 --- src/hg/js/encodeDataSummary.js +++ src/hg/js/encodeDataSummary.js @@ -1,30 +1,29 @@ /* encodeDataSummary.js - pull experiment table and metadata from server and display in summary tables Formatted: jsbeautify.py -j -k Syntax checked: jslint indent:4, plusplus: true, continue: true, unparam: true, sloppy: true, browser: true */ /*global $, encodeProject */ $(function () { var requests = [ // requests to server API encodeProject.serverRequests.experiment, encodeProject.serverRequests.dataType, - encodeProject.serverRequests.antibody, - encodeProject.serverRequests.expId + encodeProject.serverRequests.antibody ]; var $summaryTables = $('.summaryTable'); function addDataType(dataTypeName, expList, isChip) { // Helper function to fill datatype lists that are used to make tables var dataType, dataTypeLabel; if (!isChip) { // get data type label dataType = encodeProject.getDataType(dataTypeName); if (dataType !== undefined) { dataTypeLabel = dataType.label; } @@ -32,72 +31,65 @@ if (dataTypeLabel === undefined) { // if there is a mismatch between experiment table and CV we might not // find dataType for the experiment dataTypeLabel = dataTypeName; } if (!expList[dataTypeLabel]) { expList[dataTypeLabel] = 0; } expList[dataTypeLabel]++; } function handleServerData(responses) { // Main actions, called when loading data from server is complete var experiments = responses[0], dataTypes = responses[1], - antibodies = responses[2], - expIds = responses[3]; + antibodies = responses[2]; var cellAssayExps = {}, tfbsExps = {}, refGenomeExps = {}; var refGenomeTypes = [], elementTypes = [], tfbsTypes = []; var antibody, dataType; encodeMatrix.show($summaryTables); antibodyGroups = encodeProject.getAntibodyGroups(antibodies); encodeProject.getDataGroups(dataTypes); - // use to filter out experiments not in this assembly - expIdHash = encodeProject.getExpIdHash(expIds); - $.each(experiments, function (i, exp) { - // exlude experiment not in this assembly - if (expIdHash[exp.ix] === undefined) { - return true; - } if (exp.dataType === undefined) { return true; } // add experiment into the appropriate list(s) if (exp.cellType === 'None') { addDataType(exp.dataType, refGenomeExps, false); } else { addDataType(exp.dataType, cellAssayExps, false); } if (exp.dataType === 'ChipSeq') { antibody = encodeProject.antibodyFromExp(exp); if (!antibody) { return true; } dataType = encodeProject.targetFromAntibody(antibody); if (!dataType) { // this excludes controls return true; } addDataType(dataType, tfbsExps, true); } }); + // work-around for some supplementary files being accessioned as experiments (5C) // they show up in both reference genome and cell assay lists incorrectly // remove them from refGenome list of they are in cellAssayExps for (dataType in refGenomeExps) { if (cellAssayExps[dataType] !== undefined) { delete refGenomeExps[dataType]; } } // fill in tables and activate buttons tableOut('#refGenomeTable', refGenomeTypes, refGenomeExps, false); tableOut('#elementTable', elementTypes, cellAssayExps, false); tableOut('#tfbsTable', tfbsTypes, tfbsExps, true); if (encodeProject.isIE7()) { // disable buttons on IE7 -- not yet able to display matrix column headers adequately