maCompPlate2: Generate plate IDs

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/stepNorm.R

Description

This function is a modification of the maCompPlate function in the marray library. It generates plate IDs from the dimensions of the grid and spot matrices. Unlike the maCompPlate function, the number of spots is not necessarily a multiple of the number of wells on a plate, therefore this function allows empty spots on the slide.

Usage

1
maCompPlate2(no.plates = NULL, n = 384)

Arguments

no.plates

object of class "numeric", number of plates used specified by the user. If a number is not specified, then it is assumed that there are no empty spots on the slide.

n

object of class "numeric", number of wells in each plate, usually 384 or 96.

Details

This function can be used to handle three cases: 1) the number of spots is a multiple of the number of wells on a plate (usually 96 or 384); 2) the number of spots is not a multiple of the number of wells on a plate, and several of spots on the slide are therefore left empty. In this case, the user needs to specify the number of total plates used; plate IDs of empty spots will be NAs; 3)the number of spots is not a multiple of the number of wells on a plate, but all spots on the slide are spotted, therefore there is one plate not fully used. In this case, the user does not need to specify the number of total plates (as this will not be an integer), the function assumes no empty spots on the slide automatically. See Examples below.

Value

The function maCompPlate2 returns a function with bindings for no.plates and n, which when receiving a object of marrayRaw, marrayNorm or marrayLayout class, it returns a vector of plate IDs (factor).

Author(s)

Yuanyuan Xiao

See Also

maCompPlate, marrayLayout.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
####### case 1: no empty spots on the slide, full plates used
L<-new("marrayLayout", maNgr=4, maNgc=4, maNsr=22, maNsc=24)
### "compPlate" is a function
compPlate <- maCompPlate2(n=384)
plate <- compPlate(L)
table(plate)
### can also use:
plate<-maCompPlate(L,384)
table(plate)

####### case 2: with empty spots on the slide, full plates used
L<-new("marrayLayout", maNgr=4, maNgc=4, maNsr=22, maNsc=26)
### "compPlate" is a function
compPlate <- maCompPlate2(no.plates=22,n=384)
plate <- compPlate(L)
table(plate)
### empty spots are NAs
unique(plate)

###### case 3: no empty spots on the slide, one plate not full
L<-new("marrayLayout", maNgr=4, maNgc=4, maNsr=22, maNsc=26)
### argument no.plates not specified, the function assumes no empty spots
compPlate <- maCompPlate2(n=384)
plate <- compPlate(L)
### 23 full plates (384), the 24th not full (304)
table(plate)
### no NAs, no empty spots
unique(plate)

stepNorm documentation built on Nov. 8, 2020, 6:19 p.m.