sbov: prototype of subsetter for mongo resource

Description Usage Arguments Value Note Examples

View source: R/lite.R

Description

prototype of subsetter for mongo resource

Usage

1
2
sbov(rme, gr, map = basicCfieldsMap(), docTypeName = "type",
  simplify = TRUE)

Arguments

rme

RaggedMongoExpt instance

gr

GRanges instance to subset by

map

list with one element per document type telling what fields are chr, start, stop

docTypeName

character(1) naming column of colData(rme) that has document type

simplify

logical(1) if TRUE, a GRanges is assembled; if FALSE, a RaggedExperiment is returned

Value

if simplify is TRUE (the default), a GRanges is returned with assay components in the mcols; otherwise a RaggedExperiment instance, with metadata component 'docType' set to propagate the input type

Note

This is a placeholder for a proper subsetByOverlaps method. While it would appear sensible to allow subsetting for diverse assay types (e.g., eQTL, DGF), in version 1.5.x this is not supported. Each call can operate on only one sample type.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
requireNamespace('mongolite')
if (verifyHasMongoCmd()) {  # for makeColData, which must be able to enumerate collections,
                            # and thus must be able to run system (as opposed to mongolite function) 'mongo' 
 m1 = mongolite::mongo(url=URL_txregInAWS(), db='txregnet')
 #cd = makeColData(url=URL_txregInAWS(), db='txregnet')
 cd = TxRegInfra::basicColData
 rme1 = RaggedMongoExpt(m1, cd[which(cd$type=='FP'),][seq_len(8),])
 BiocParallel::register(BiocParallel::SerialParam())
 qrng = GRanges('chr1', IRanges(1e6, 1.5e6))
 GenomeInfoDb::genome(qrng) = "hg19"
 ss = sbov(rme1, GRanges('chr1', IRanges(1e6, 1.5e6)), simplify=FALSE)
} 

TxRegInfra documentation built on Nov. 8, 2020, 5:15 p.m.