indexOf.Layout: Gets the index of one or more spots from their name or id

Description Usage Arguments Value Author(s) See Also Examples

Description

Gets the index of one or more spots from their name or id.

Usage

1
2
## S3 method for class 'Layout'
indexOf(this, name=NULL, id=name, plate=NULL, ignoreCase=TRUE, regexpr=FALSE, ...)

Arguments

name

A string vector (or a single regular expression) to match against the names.

id

A string vector (or a single regular expression) to match against the ids.

plate

A string vector (or a single regular expression) to match against the plates. If it is numeric it will be matched against the plate number as given by getPlateNumber().

ignoreCase

If TRUE, the matching is not case sensitive, otherwise it is.

regexpr

If TRUE, regular expression matching is used, otherwise plain string comparison is used.

At least one of the arguments name and id must be given. If both are given, indices of spots that match either the name search pattern or the id search pattern.

Value

Returns the vector of indices of matched names or ids. Returns numeric(0) if no matches were found.

Author(s)

Henrik Bengtsson (http://www.braju.com/R/)

See Also

For more help on regular expressions see grep() and apropos. *getName(). *getId(). For more information see Layout.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  SMA$loadData(c("mouse.setup", "mouse.gnames"))
  layout <- as.Layout(mouse.setup, id=mouse.gnames)

  # Get the index of spots with id "54" and "232".
  indexOf(layout, id=c("54", "232"))
  # [1] 54 232

  # Get the index of all spots with id beginning with "120" and
  # having at least four characters.
  indexOf(layout, id="^120.+", regexpr=TRUE)
  # [1] 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209

HenrikBengtsson/aroma documentation built on May 7, 2019, 12:56 a.m.