batch: Access batch IDs

Description Usage Arguments Value Examples

Description

batch gets and batch<- assigns a vector of batch IDs for binders/samples. The ID is used to distinguish separate assay runs.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
batch(x, ...)

## S4 method for signature 'BAf'
batch(x, wise = c("sinfo", "binder"))

batch(x, ...) <- value

## S4 replacement method for signature 'BAf'
batch(x, wise = c("sinfo", "binder")) <- value

batch_colname(x, ...)

## S4 method for signature 'BAf'
batch_colname(x, wise = c("sinfo", "binder"))

n_batch(x, ...)

## S4 method for signature 'BAf'
n_batch(x)

Arguments

x

an object of the BAf-class

...

for other functions with same name

wise

which batch, sample-wise or binder-wise.

value

a vector of new batch IDs. It should be either a single value or in exactly same dimension as the previous values.

Value

batch: a vector of batch IDs for binders/samples

batch_colname: a character of the name of the column that contains sample/binder batch IDs

n_batch: a list of the numbers of sample/binder batches

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(sba)
batch(sba, "binder")               # get batch IDs
batch(sba, "binder") <- rep(c("AY10", "AY11"), each= ncol(sba) / 2)
batch(sba, "b")               # short name is also allowed.

batch(sba, "sinfo")
batch(sba, "sinfo") <- rep(LETTERS[1:4], each= 96)
batch(sba, "sinfo")[1:96] <- "A"
batch(sba, "sample")     # 'sample' instead of 'sinfo' is also allowed.

n_batch(sba)
 

Rundmus/BAf-R_package documentation built on May 18, 2020, 12:59 p.m.