https://github.com/ctlab/phantasus
Tip revision: 352afd17e53dcc6d6682988d722127ba8a2190bd authored by Alexey Sergushichev on 29 March 2024, 23:37:48 UTC
Skipping absent file when generating counts index
Skipping absent file when generating counts index
Tip revision: 352afd1
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)
}