catmaid_skids: Find skeleton ids (skids) for various inputs including...

View source: R/catmaid_skids.R

catmaid_skidsR Documentation

Find skeleton ids (skids) for various inputs including textual queries

Description

An efficient way to find neuron skeleton ids interactively or in any function that can take skids as an input.

Usage

catmaid_skids(x, several.ok = TRUE, conn = NULL, ...)

Arguments

x

one or more skids or a query expression (see details)

several.ok

Logical indicating whether we can allow multiple skids.

conn

A catmaid_connection objection returned by catmaid_login. If NULL (the default) a new connection object will be generated using the values of the catmaid.* package options as described in the help for catmaid_login.

...

additional parameters passed to catmaid_query_by_annotation

Details

If the inputs are numeric or have length > 1 they are assumed already to be skids and are simply converted to integers.

If the input is a string starting with "name:" or "annotation:" they are used for a query by catmaid_query_by_name or catmaid_query_by_annotation, respectively.

If the input is a string that cannot be interpreted as a number but does not start with "name:" or "annotation:", it is assumed to be an exact match for an annotation.

Value

integer vector of skids (of length 0 on failure).

Examples

## Not run: 
# these are just passed through
catmaid_skids(1:10)

# nb these are all regex matches
catmaid_skids("name:ORN")
catmaid_skids("name:PN")
# there will be multiple annotations that match this
catmaid_skids("annotation:ORN")
# but only one that matches this (see regex for details)
catmaid_skids("annotation:^ORN$")
# As a special case this looks for an exact match annotation for "ORN"
catmaid_skids("ORN")

## End(Not run)

jefferis/rcatmaid documentation built on Aug. 16, 2022, 8:52 p.m.