query_metadata: query omicidx API for studies based on lucene query

Description Usage Arguments Value Note Examples

View source: R/query_metadata.R

Description

query omicidx API for studies based on lucene query

Usage

1
query_metadata(luceneq, component = "StudiesSraStudiesGet", size = 10, ...)

Arguments

luceneq

character(1) query in lucene syntax

component

character(1) API component to use, defaults to 'StudiesSraStudiesGet'

size

numeric(1) number of records to return, defaults to 10.

...

passed to omicidxClientR::ExperimentsSraExperimentsGet

Value

list with S3 class 'omicidx_qhits', elements are hits, obj, query, time.

Note

Queries for "nested" fields like organism within sample are handled in the third example. Cursor information will be present in 'obj' element of the return value.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# example 1
x = query_metadata("cancer")
x
sapply(x$hits, "[[", "title")
# example 2 fix on RNA-seq
y = query_metadata('cancer AND library_strategy:"RNA-Seq"', 
   component="ExperimentsSraExperimentsGet")
table(sapply(y$hits, "[[", "library_strategy"))
# example 3 fix on RNA-seq in humans
yy =query_metadata('cancer AND library_strategy:"RNA-Seq" AND sample.organism:"Homo sapiens"',
  component="ExperimentsSraExperimentsGet", size=100)
table(sapply(yy$hits, function(x) x$sample[,"organism"]))

vjcitn/SraInAnVIL documentation built on Dec. 23, 2021, 4:05 p.m.