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

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

Value

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

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.

Examples

if (FALSE) {
# 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")
}