Beispiel #1
0
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)
Beispiel #2
0
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)
Beispiel #3
0
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)
Beispiel #4
0
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)
Beispiel #5
0
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))
Beispiel #6
0
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))
Beispiel #7
0
def getReflectMetadata(mapId):
    """
    :returns:
     {
        toMapIds : []
        dataType : []
    }
    """
    responseDict = reflect_web.getReflectionMetadata(mapId)
    raise SuccessResp(responseDict)
Beispiel #8
0
def highlightAttrNodeRoute():
    raise SuccessResp(viewData.highlightAttrNode(validatePost(), appCtx))
Beispiel #9
0
def getLayoutListRoute(mapId):
    raise SuccessResp(viewData.getLayoutList(mapId, appCtx))
Beispiel #10
0
def getFirstAttr(mapId):
    raise SuccessResp(viewData.getFirstAttr(mapId, appCtx))
Beispiel #11
0
def queryPlaceNodeRoute():
    raise SuccessResp(
        placeNode_web.preCalc(validatePost(), Context({'app': appCtx})))
Beispiel #12
0
def getAttrById(attrId, mapId):
    raise SuccessResp(viewData.getAttrById(attrId, mapId, appCtx))
Beispiel #13
0
def queryCreateMapRoute():
    raise SuccessResp(
        createMap_web.preCalc(validatePost(), Context({'app': appCtx })))
Beispiel #14
0
def queryOverlayNodesRoute():
    raise SuccessResp(placeNode_web.preCalc(validatePost(),
        Context({'app': appCtx, 'overlayNodes': True})))
def testRoute():
    raise SuccessResp('just testing upload on data server')
Beispiel #16
0
def queryJobTestHelperRoute():
    raise SuccessResp(
        jobTestHelper_web.preCalc(validatePost(), Context({'app': appCtx})))
Beispiel #17
0
def getAll():
    data = cellDataset.getAll(appCtx)
    raise SuccessResp(data)
Beispiel #18
0
def jobStatusRoute(jobId):
    raise SuccessResp(job.getStatus(jobId, appCtx.jobQueuePath))
Beispiel #19
0
def getMapListRoute(userEmail=None, userRole=[]):
    raise SuccessResp(
        projectList.get(userEmail, _urlParmToList(userRole), appCtx.viewDir))
Beispiel #20
0
def mapAuthRoute(mapId, userEmail=None, userRole=[]):
    raise SuccessResp(projectList.authorize(mapId, userEmail,
        _urlParmToList(userRole), appCtx.viewDir))
Beispiel #21
0
def getAllJobsRoute():
    raise SuccessResp(job.getAll(appCtx.jobQueuePath))
Beispiel #22
0
def testRoute():
    raise SuccessResp('just testing cellDb on data server')
def upload(dataId):
    filename = uploadFile.oldApi(dataId, request)
    raise SuccessResp('upload of ' + filename + ' complete')