R/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)
}

Try the phantasus package in your browser

Any scripts or data that you put into this service are public.

phantasus documentation built on Nov. 8, 2020, 6:39 p.m.