detectReplicas {arrayMagic} | R Documentation

## detectReplicas

### Description

The function returns for each unique item all corresponding indexes.

### Usage

    detectReplicas(arrayDescription, spotIdentifier = "ID", identifiersToBeSkipped = NULL, verbose = TRUE)

### Arguments

`arrayDescription` | an object of class `data.frame` which contains a column named as `spotIdentifier`; required; default missing
`spotIdentifier` | character string; required; default: "ID"
`identifiersToBeSkipped` | vector of character strings; required; default: `NULL`; items of the column `spotIdentifier` for which no replica detection takes place
`verbose` | logical; required; default: `TRUE`

### Value

A list which contains `nrOfReplicas` and `spotReplicas`. `nrOfReplicas`: one integer characterizing the number of spot replicas given for each identifier if existing or otherwise `NA`. `spotReplicas`: a list of the length of the unique identifiers where each element contains a vector of indexes corresponding to the given identifier (i.e. the name of the list element) otherwise `NA`.

### Author(s)

Andreas Buness <a.buness@dkfz.de>

### Examples

    aD <- data.frame(ID=c("z", "x", "x", "x", "y", "z", "z", "y", "y"))
    re <- detectReplicas(aD, identifiersToBeSkipped = c("Blank", "Control1", "Control2"))
    stopifnot(re[["nrOfReplicas"]] == 3 )
    stopifnot( re$spotReplicas[["z"]] == c(1,6,7) )
    stopifnot( re$spotReplicas[["x"]] == c(2,3,4) )
    stopifnot( re$spotReplicas[["y"]] == c(5,8,9) )

    aD <- data.frame(ID=c("Blank", "Control1", "Blank", "Control2"))
    re <- detectReplicas(aD, identifiersToBeSkipped = c("Blank", "Control1", "Control2"))
    stopifnot(is.na(re[["nrOfReplicas"]]))

[Package arrayMagic version 1.14.0 Index]