"OlsSearch"
OlsSearch-class.Rd
Searching the OLS is done using the OlsSearch
data
structure.
Objects can be created with the constructor function
OlsSearch
.
q
:Object of class "character"
~~
ontology
:Object of class "character"
~~
type
:Object of class "character"
~~
slim
:Object of class "character"
~~
fieldList
:Object of class "character"
~~
queryFields
:Object of class "character"
~~
exact
:Object of class "logical"
~~
groupField
:Object of class "logical"
~~
obsoletes
:Object of class "logical"
~~
local
:Object of class "character"
~~
childrenOf
:Object of class "character"
~~
rows
:Object of class "integer"
~~
start
:Object of class "integer"
~~
url
:Object of class "character"
~~
numFound
:Object of class "integer"
~~
response
:Object of class "data.frame"
~~
signature(from = "OlsSearch", to =
"data.frame")
: ...
signature(from = "OlsSearch", to = "Terms")
:
...
signature(object = "OlsSearch")
: ...
signature(object = "OlsSearch")
: ... The value
can be updated with the olsRows
replacement method. To
request all responses, use allRows
.
OlsSearch(q = "trans-golgi")
#> Object of class 'OlsSearch':
#> query: trans-golgi
#> requested: 20 (out of 13983)
#> response(s): 0
OlsSearch(q = "cell")
#> Object of class 'OlsSearch':
#> query: cell
#> requested: 20 (out of 241622)
#> response(s): 0
OlsSearch(q = "cell", exact = TRUE)
#> Object of class 'OlsSearch':
#> query: cell
#> requested: 20 (out of 7221)
#> response(s): 0
OlsSearch(q = "cell", exact = TRUE, ontology = "go")
#> Object of class 'OlsSearch':
#> ontolgy: go
#> query: cell
#> requested: 20 (out of 0)
#> response(s): 0
OlsSearch(q = "cell", exact = TRUE, ontology = "GO")
#> Object of class 'OlsSearch':
#> ontolgy: GO
#> query: cell
#> requested: 20 (out of 0)
#> response(s): 0
OlsSearch(q = "electrospray", ontology = "MS")
#> Object of class 'OlsSearch':
#> ontolgy: MS
#> query: electrospray
#> requested: 20 (out of 8)
#> response(s): 0
OlsSearch(q = "ionization", ontology = "MS")
#> Object of class 'OlsSearch':
#> ontolgy: MS
#> query: ionization
#> requested: 20 (out of 56)
#> response(s): 0
OlsSearch(q = "electrospray ionization", ontology = "MS")
#> Object of class 'OlsSearch':
#> ontolgy: MS
#> query: electrospray ionization
#> requested: 20 (out of 59)
#> response(s): 0
OlsSearch(q = "electrospray ionization", ontology = "MS", exact=TRUE)
#> Object of class 'OlsSearch':
#> ontolgy: MS
#> query: electrospray ionization
#> requested: 20 (out of 1)
#> response(s): 0
## Request 5 results instead of 20 (default)
OlsSearch(q = "plasma,membrane", ontology = "go", rows = 5)
#> Object of class 'OlsSearch':
#> ontolgy: go
#> query: plasma,membrane
#> requested: 5 (out of 1551)
#> response(s): 0
## or, once the object was created
(res <- OlsSearch(q = "plasma,membrane", ontology = "go"))
#> Object of class 'OlsSearch':
#> ontolgy: go
#> query: plasma,membrane
#> requested: 20 (out of 1551)
#> response(s): 0
olsRows(res) <- 5
res
#> Object of class 'OlsSearch':
#> ontolgy: go
#> query: plasma,membrane
#> requested: 5 (out of 1551)
#> response(s): 0
## all results
res <- allRows(res)
res
#> Object of class 'OlsSearch':
#> ontolgy: go
#> query: plasma,membrane
#> requested: 1551 (out of 1551)
#> response(s): 0
res <- OlsSearch(q = "trans-golgi", ontology = "go", rows = 5)
res
#> Object of class 'OlsSearch':
#> ontolgy: go
#> query: trans-golgi
#> requested: 5 (out of 329)
#> response(s): 0
res <- olsSearch(res)
res
#> Object of class 'OlsSearch':
#> ontolgy: go
#> query: trans-golgi
#> requested: 5 (out of 329)
#> response(s): 5
as(res, "data.frame")
#> id
#> 1 go:class:http://purl.obolibrary.org/obo/GO_0000138
#> 2 go:class:http://purl.obolibrary.org/obo/GO_1990676
#> 3 go:class:http://purl.obolibrary.org/obo/GO_0032588
#> 4 go:class:http://purl.obolibrary.org/obo/GO_0005802
#> 5 go:class:http://purl.obolibrary.org/obo/GO_0030140
#> iri short_form obo_id
#> 1 http://purl.obolibrary.org/obo/GO_0000138 GO_0000138 GO:0000138
#> 2 http://purl.obolibrary.org/obo/GO_1990676 GO_1990676 GO:1990676
#> 3 http://purl.obolibrary.org/obo/GO_0032588 GO_0032588 GO:0032588
#> 4 http://purl.obolibrary.org/obo/GO_0005802 GO_0005802 GO:0005802
#> 5 http://purl.obolibrary.org/obo/GO_0030140 GO_0030140 GO:0030140
#> label ontology_name ontology_prefix type
#> 1 Golgi trans cisterna go GO class
#> 2 Golgi trans cisterna membrane go GO class
#> 3 trans-Golgi network membrane go GO class
#> 4 trans-Golgi network go GO class
#> 5 trans-Golgi network transport vesicle go GO class
#> is_defining_ontology
#> 1 TRUE
#> 2 TRUE
#> 3 TRUE
#> 4 TRUE
#> 5 TRUE
res <- as(res, "Terms")
res
#> Object of class 'Terms' with 5 entries
#> From the GO ontology
#> GO:0000138, GO:1990676 ... GO:0005802, GO:0030140
termPrefix(res)
#> GO:0000138 GO:1990676 GO:0032588 GO:0005802 GO:0030140
#> "GO" "GO" "GO" "GO" "GO"
termId(res)
#> GO:0000138 GO:1990676 GO:0032588 GO:0005802 GO:0030140
#> "GO:0000138" "GO:1990676" "GO:0032588" "GO:0005802" "GO:0030140"