Skip to contents

Convert between VFB and external identifiers

Usage

vfb_fromvfbids(vfbids, ..., mustWork = NA)

vfb_tovfbids(ids, fixed = TRUE, ...)

Arguments

vfbids

One or more vfb identifiers. Solr wildcards can also be used when fixed=FALSE- see examples and vfb_solr_query

...

Additional arguments passed to vfb_solr_query.

mustWork

logical: if TRUE then an error is given if there are missing results; if NA then a warning; if FALSE then there will be no message but missing values will still be denoted by NA values.

ids

One or more external identifiers. Solr wildcards can also be used when fixed=FALSE- see examples and vfb_solr_query

fixed

Whether to insist on exact matches. When fixed=FALSE solr wildcards can be used.

Value

A character vector of vfb ids (for vfb_fromvfbids) or external identifiers (for vfb_tovfbids) in the same order as the input query. Missing values will be denoted by NAs when fixed=TRUE. When fixed=FALSE and a wild-card search returns no results a character vector of length 0 will be returned.

Details

Note that these functions are not appropriate for fetching more than ~ 200 identifiers individually specified identifiers. If a large number of identifiers are required, it is a much better idea to fetch all ids and then filter locally.

See also

gmr_vfbid, vfb_solr_query, which powers the underlying queries.

Examples

# some flycircuit ids
fcids=c("VGlut-F-000304", "VGlut-F-200278", "fru-F-200121", "TH-F-300016")
vfbids=vfb_tovfbids(fcids)
vfb_fromvfbids(vfbids)
#> Warning: Some ids could not be translated!
#> [1] NA NA NA NA

# make up a fake id for testing - will give a warning
# \donttest{
vfb_fromvfbids(c(vfbids, "VFB_10013392"))
#> Warning: Some ids could not be translated!
#> [1] NA NA NA NA NA
# }
# Some GMR GAL4 lines
gmrs=c('93D09', '87F10')
vfb_tovfbids(sprintf("GMR_%s*", gmrs), fixed=FALSE)
#> character(0)