swh:1:snp:0c004a03453a29b80f921a24433f7e780b9ceb53
Raw File
Tip revision: c6bb0e960554a23eb712690cbd7f8e3f7d79ca0d authored by Alexey Sergushichev on 02 July 2021, 13:19:49 UTC
Update js
Tip revision: c6bb0e9
probeDataset.R
probeDataset <- function (es, query) {
    exprsIndices <- query$exprs;
    fDataQuery <- query$fData;
    pDataQuery <- query$pData;
    response <- list()
    response[['dims']] <- dim(exprs(es))
    response[['fvarLabels']] <- colnames(fData(es))
    response[['varLabels']] <- colnames(pData(es))
    response[['probe']] <- exprs(es)[exprsIndices]
    response[['fdata']] <- list()
    response[['pdata']] <- 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]]]
        }
    }
    if (!is.null(nrow(pDataQuery))) {
        for(i in seq_len(nrow(pDataQuery))) {
            row <- pDataQuery[i,]
            response[['pdata']][[row$name]] <- pData(es)[[row$name]][row$indices[[1]]]
        }
    }
    jsonlite::toJSON(response)
}
back to top