Revision 80c7b427b73eabcf1cbf64adf47708e2640d3ffb authored by Nitesh Turaga on 29 October 2019, 17:11:02 UTC, committed by Nitesh Turaga on 29 October 2019, 17:11:02 UTC
1 parent 32a8d5c
Raw File
probeDataset.R
probeDataset <- function (es, query) {
    exprsIndices <- query$exprs;
    fDataQuery <- query$fData;

    response <- list()
    response[['dims']] <- dim(exprs(es))
    response[['fvarLabels']] <- colnames(fData(es))
    response[['probe']] <- exprs(es)[exprsIndices]
    response[['fdata']] <- list()

    if (!is.null(nrow(fDataQuery))) {
        for(i in seq_len(nrow(fDataQuery))) {
            row <- fDataQuery[i,]
            response[['fdata']][[row$name]] <- fData(es)[[row$name]][row$indices[[1]]]
        }
    }

    jsonlite::toJSON(response)
}
back to top