def oneByAllLeesLRequest(): """ Post example: { map : "PancanAtlas/SampleMap", focusAttr: opts.dynamicData, layoutIndex : 1, email : Meteor.user().username, }; focusAttr is in this form: {"attrName" : { "sampleId" : value}, ... } JSON response on Success from job queue: {result: [ [ attributeId, leesL, Rank, Pearson], ..., ... ] } For all attributes on the requested map. """ logging.info('One By All LeesL requested') parms = validatePost() ctx = Context({'app': appCtx}) responseDict = statsLayout_web.preCalc(parms, ctx) logging.info(responseDict) raise SuccessResp(responseDict)
def reflectionRequest(): """ JSON post example { dataType : "dataTypePointsToAFileInReflectionConfig" layout : "layoutTheToMapWillOpenUpOn" toMap : "mapToViewReflection" map : "Pancan12/SampleMap", nodeIds : [id, id, ...], rankCategories: True/False, dynamicAttrName : "Kindey Isle" email: [email protected] }; JSON response on Success from job queue: { url : "http://aLong/UrlForTheClient/ToViewReflectionOnAMap" dataRetrievalUrl : HUB_URL/reflect/attrId/<string:fileId>, nNodes : 123 } dataRetrievalUrl is an enpoint to download the calculated file. "url" will open a map viewer with the reflection in your browser. nNodes is the number of nodes there was data for when calculating reflection. """ logging.info('Reflection requested') parms = validatePost() ctx = Context({'app': appCtx}) responseDict = reflect_web.preCalc(parms, ctx) logging.info(responseDict) raise SuccessResp(responseDict)
def oneByAllStatRequest(): """ Post example: { map : "PancanAtlas/SampleMap", focusAttr: opts.dynamicData, focusAttrDatatype : dType, email : Meteor.user().username, }; focusAttr is in this form: {"attrName" : { "sampleId" : value}, ... } focus attribute datatype is one of: ["bin", "cat", "cont"] JSON response on Success from job queue: {result: [ [ attributeId, single-test pvalue, BHFDR, bonefonni], ..., ... ] } For all attributes on the requested map. """ logging.info('One By All Stat requested') parms = validatePost() ctx = Context({'app': appCtx}) responseDict = statsNoLayout_web.preCalc(parms, ctx) logging.info(responseDict) raise SuccessResp(responseDict)
def getRefAttr(attrId): """Returns reflection request JSON. define return schema """ logging.info('Reflection get request, attrid: ' + attrId) responseDict = reflect_web.getReflectionAttr(attrId) raise SuccessResp(responseDict)
def deleteMap(mapId, userEmail=None, userRole=[]): # Verify this is from the allowed view server if not request.environ['REMOTE_ADDR'] in appCtx.viewServerAddrs and \ not request.environ['HTTP_X_FORWARDED_FOR'] in appCtx.viewServerAddrs: raise ErrorResp('', 404) raise SuccessResp( projectEdit.delete(mapId, userEmail, _urlParmToList(userRole), appCtx))
def updateColor(): # Verify this is from the allowed view server. # TODO why not use the view server name and certificate here, # rather than the IP addr? if not request.environ['REMOTE_ADDR'] in appCtx.viewServerAddrs and \ not request.environ['HTTP_X_FORWARDED_FOR'] in appCtx.viewServerAddrs: raise ErrorResp('', 404) raise SuccessResp(projectEdit.updateColor(validatePost(), appCtx))
def getReflectMetadata(mapId): """ :returns: { toMapIds : [] dataType : [] } """ responseDict = reflect_web.getReflectionMetadata(mapId) raise SuccessResp(responseDict)
def highlightAttrNodeRoute(): raise SuccessResp(viewData.highlightAttrNode(validatePost(), appCtx))
def getLayoutListRoute(mapId): raise SuccessResp(viewData.getLayoutList(mapId, appCtx))
def getFirstAttr(mapId): raise SuccessResp(viewData.getFirstAttr(mapId, appCtx))
def queryPlaceNodeRoute(): raise SuccessResp( placeNode_web.preCalc(validatePost(), Context({'app': appCtx})))
def getAttrById(attrId, mapId): raise SuccessResp(viewData.getAttrById(attrId, mapId, appCtx))
def queryCreateMapRoute(): raise SuccessResp( createMap_web.preCalc(validatePost(), Context({'app': appCtx })))
def queryOverlayNodesRoute(): raise SuccessResp(placeNode_web.preCalc(validatePost(), Context({'app': appCtx, 'overlayNodes': True})))
def testRoute(): raise SuccessResp('just testing upload on data server')
def queryJobTestHelperRoute(): raise SuccessResp( jobTestHelper_web.preCalc(validatePost(), Context({'app': appCtx})))
def getAll(): data = cellDataset.getAll(appCtx) raise SuccessResp(data)
def jobStatusRoute(jobId): raise SuccessResp(job.getStatus(jobId, appCtx.jobQueuePath))
def getMapListRoute(userEmail=None, userRole=[]): raise SuccessResp( projectList.get(userEmail, _urlParmToList(userRole), appCtx.viewDir))
def mapAuthRoute(mapId, userEmail=None, userRole=[]): raise SuccessResp(projectList.authorize(mapId, userEmail, _urlParmToList(userRole), appCtx.viewDir))
def getAllJobsRoute(): raise SuccessResp(job.getAll(appCtx.jobQueuePath))
def testRoute(): raise SuccessResp('just testing cellDb on data server')
def upload(dataId): filename = uploadFile.oldApi(dataId, request) raise SuccessResp('upload of ' + filename + ' complete')