| merge {opm} | R Documentation | 
Combine all plates in a single OPM object
by treating them as originating from subsequent runs of
the same experimental plate. Adjust the times
accordingly. Alternatively, split plates according to the
contained regular series of substrates, if any. The
MOPMX method merges according to plate
types, optionally including a novel element.
## S4 method for signature 'CMAT,ANY' merge(x, y) ## S4 method for signature 'CMAT,factor' merge(x, y) ## S4 method for signature 'CMAT,logical' merge(x, y) ## S4 method for signature 'MOPMX,ANY' merge(x, y) ## S4 method for signature 'MOPMX,missing' merge(x, y) ## S4 method for signature 'OPM,OPM' merge(x, y, sort.first = TRUE, parse = TRUE) ## S4 method for signature 'OPM,missing' merge(x, y, sort.first = TRUE, parse = TRUE) ## S4 method for signature 'OPM,numeric' merge(x, y, sort.first = TRUE, parse = TRUE) ## S4 method for signature 'OPMS,missing' merge(x, y, sort.first = TRUE, parse = TRUE) ## S4 method for signature 'OPMS,numeric' merge(x, y, sort.first = TRUE, parse = TRUE) ## S4 method for signature 'MOPMX,ANY,ANY' split(x, f, drop) ## S4 method for signature 'MOPMX,ANY,missing' split(x, f, drop) ## S4 method for signature 'MOPMX,factor,ANY' split(x, f, drop) ## S4 method for signature 'MOPMX,factor,missing' split(x, f, drop) ## S4 method for signature 'MOPMX,list,ANY' split(x, f, drop) ## S4 method for signature 'MOPMX,list,missing' split(x, f, drop) ## S4 method for signature 'OPM,ANY,missing' split(x, f, drop) ## S4 method for signature 'OPM,factor,ANY' split(x, f, drop) ## S4 method for signature 'OPM,factor,missing' split(x, f, drop) ## S4 method for signature 'OPM,missing,ANY' split(x, f, drop) ## S4 method for signature 'OPM,missing,missing' split(x, f, drop) ## S4 method for signature 'OPMS,ANY,missing' split(x, f, drop) ## S4 method for signature 'OPMS,factor,ANY' split(x, f, drop) ## S4 method for signature 'OPMS,factor,missing' split(x, f, drop) ## S4 method for signature 'OPMS,missing,ANY' split(x, f, drop) ## S4 method for signature 'OPMS,missing,missing' split(x, f, drop) ## S4 method for signature 'OPMX,ANY,ANY' split(x, f, drop)
x | 
|
y | 
 For the  If  For the   | 
sort.first | 
 Logical scalar. Sort the plates according to their setup times before merging?  | 
parse | 
 Logical scalar. Ignored unless
  | 
f | 
 For the  If a factor,  If neither missing nor a factor,  For the  If   | 
drop | 
 Passed to   | 
This OPMS method of merge is
intended for dealing with slowly growing or reacting
organisms that need to be analysed with subsequent runs
of the same plate in PM mode. Results obtained
with Geodermatophilus strains and Generation-III
plates indicate that this works well in practice. See the
references, and see the documentation of the
montero_et_al data set in the opmdata
package.
See the arguments time.fmt and time.zone of
opm_opt for modifying the parsing of
setup-time entries. If it does not work, additional
time-string templates must be stored.
The CMAT method of merge is only for
internal use.
The split methods with missing f are for
splitting plates that contain series of substrate-usage
assays as indicated in the full substrate names (mostly
interpretable as concentrations).  OPMS
objects are generated that contain each replicate within
the series in a separate plate and the replicate
ID indicated in the metadata entry given by
opm_opt("series.key"). This allows for
comparisons between within-plate replicates.
Splitting according to substrate series will not work if
these are not regular, i.e. the same substrates occur in
each replicate. In such cases x will be returned,
with a warning. Substrates without a replicate
(‘concentration’) indicator would silently be
skipped, however. The composition and order of the wells
per pseudo-plate must be made uniform.  This is done by
enforcing well names and well ordering of the first
replicate in all forthcoming replicates.
After a successful splitting, the numeric suffixes in the
full well names make no sense any more, as each plate
contains a constant set of such suffixes. The
no.num argument of wells and the
dependent methods can be used to remove the suffixes
before displaying the full well names.
The MOPMX method for merge will
raise an error if elements occur within x (and
optionally y) that have the same plate type but
cannot be combined any way because they contain distinct
sets of wells. See the comments on combining plates into
a OPMS object.
The OPMX method of merge yields an
OPM object. The metadata and
csv_data will be taken from the first
contained plate, but aggregated values, if any, will be
dropped.
The MOPMX method for merge yields a
MOPMX object with a potentially different
number of elements.
The split methods yield either an
OPMS or an MOPMX object; the
MOPMX method for split yields a list
of MOPMX objects.
Montero-Calasanz, M. d. C., Goeker, M., Poetter, G., Rohde, M., Sproeer, C., Schumann, P., Gorbushina, A. A., Klenk, H.-P. 2012 Geodermatophilus arenarius sp. nov., a xerophilic actinomycete isolated from Saharan desert sand in Chad. Extremophiles 16, 903–909.
Montero-Calasanz, M. d. C., Goeker, M., Rohde, M., Schumann, P., Poetter, G., Sproeer, C., Gorbushina, A. A., Klenk, H.-P. 2013 Geodermatophilus siccatus sp. nov., isolated from arid sand of the Saharan desert in Chad. Antonie van Leeuwenhoek 103, 449–456.
opmdata::montero_et_al
Other conversion-functions: as.data.frame,
extract, extract_columns,
flatten, oapply,
opmx, plates,
rep, rev, sort,
to_yaml, unique
## merge: OPM methods
stopifnot(identical(merge(vaas_1, 0.5), vaas_1)) # nothing to merge
summary(x <- merge(vaas_1, vaas_1)) # biologically unreasonable!
## Class                 OPM
## From file             ./E. coli DSM
##                       30083T_vim10_7B__1_28_PMX_0_8#30#2010_F_
##                       7B_5.csv
## Hours measured        191.75
## Number of wells       96
## Plate type            Gen III
## Position              7-B
## Setup time            8/30/2010 1:53:08 PM
## Metadata              5
## Aggregated            FALSE
## Discretized           FALSE
stopifnot(is(x, "OPM"), dim(x) == c(2 * hours(vaas_1, "size"), 96))
## merge: OPMS methods
summary(x <- merge(vaas_4)) # biologically unreasonable for these data!
## Class                 OPM
## From file             ./P. aeruginosa St.
##                       429_vim10_22B__1_28_PMX_0_8#30#2010_C_22B_5.csv
## Hours measured        383.75
## Number of wells       96
## Plate type            Gen III
## Position              22-B
## Setup time            8/30/2010 11:28:54 AM
## Metadata              5
## Aggregated            FALSE
## Discretized           FALSE
stopifnot(is(x, "OPM"), dim(x) == c(sum(hours(vaas_4, "size")), 96))
# See opmdata::montero_et_al for an object to which this can be sensibly
# applied. An according example is given in the montero_et_al documentation.
## split: OPM methods
(x <- split(vaas_1))
## 1
## Class                 OPMD
## From file             ./E. coli DSM
##                       30083T_vim10_7B__1_28_PMX_0_8#30#2010_F_
##                       7B_5.csv
## Hours measured        95.75
## Number of wells       1
## Plate type            Gen III
## Position              7-B
## Setup time            8/30/2010 1:53:08 PM
## Metadata              6
## Aggregated            TRUE
## Discretized           TRUE
## 
## 2
## Class                 OPMD
## From file             ./E. coli DSM
##                       30083T_vim10_7B__1_28_PMX_0_8#30#2010_F_
##                       7B_5.csv
## Hours measured        95.75
## Number of wells       1
## Plate type            Gen III
## Position              7-B
## Setup time            8/30/2010 1:53:08 PM
## Metadata              6
## Aggregated            TRUE
## Discretized           TRUE
## 
## => OPMS object with 2 plates (2 aggregated, 2 discretized) of type 'Gen III', 1 well(s) and about 384 time point(s).
metadata(x, opm_opt("series.key"))
## [1] 1 2
stopifnot(is(x, "OPMS"), dim(x) == c(2, hours(vaas_1, "size"), 1))
# only D-Serine is present as series, all other wells are skipped
# thus split is more useful when applied to other plate types such as "ECO"
(x <- split(vaas_1, "Species"))
##                  Length Plate.type Aggregated Discretized
## Escherichia.coli      1    Gen III       TRUE        TRUE
## 
## => MOPMX object with 1 element(s), details are shown above.
##  Access the elements with [[ or $ to apply specific methods.
stopifnot(is(x, "MOPMX"), length(x) == 1)
## split: OPMS methods
(x <- split(vaas_4))
## 1
## Class                 OPMD
## From file             ./E. coli DSM
##                       18039_vim10_12B__1_28_PMX_0_8#30#2010_E_12B_5.csv
## Hours measured        95.75
## Number of wells       1
## Plate type            Gen III
## Position              12-B
## Setup time            8/30/2010 1:19:11 PM
## Metadata              6
## Aggregated            TRUE
## Discretized           TRUE
## 
## 2
## Class                 OPMD
## From file             ./E. coli DSM
##                       18039_vim10_12B__1_28_PMX_0_8#30#2010_E_12B_5.csv
## Hours measured        95.75
## Number of wells       1
## Plate type            Gen III
## Position              12-B
## Setup time            8/30/2010 1:19:11 PM
## Metadata              6
## Aggregated            TRUE
## Discretized           TRUE
## 
## 3
## Class                 OPMD
## From file             ./E. coli DSM
##                       30083T_vim10_7B__1_28_PMX_0_8#30#2010_F_
##                       7B_5.csv
## Hours measured        95.75
## Number of wells       1
## Plate type            Gen III
## Position              7-B
## Setup time            8/30/2010 1:53:08 PM
## Metadata              6
## Aggregated            TRUE
## Discretized           TRUE
## 
## 4
## Class                 OPMD
## From file             ./E. coli DSM
##                       30083T_vim10_7B__1_28_PMX_0_8#30#2010_F_
##                       7B_5.csv
## Hours measured        95.75
## Number of wells       1
## Plate type            Gen III
## Position              7-B
## Setup time            8/30/2010 1:53:08 PM
## Metadata              6
## Aggregated            TRUE
## Discretized           TRUE
## 
## 5
## Class                 OPMD
## From file             ./P. aeruginosa DSM
##                       1707_vim10_17B__1_28_PMX_0_8#30#2010_D_17B_5.csv
## Hours measured        95.75
## Number of wells       1
## Plate type            Gen III
## Position              17-B
## Setup time            8/30/2010 12:31:46 PM
## Metadata              6
## Aggregated            TRUE
## Discretized           TRUE
## 
## 6
## Class                 OPMD
## From file             ./P. aeruginosa DSM
##                       1707_vim10_17B__1_28_PMX_0_8#30#2010_D_17B_5.csv
## Hours measured        95.75
## Number of wells       1
## Plate type            Gen III
## Position              17-B
## Setup time            8/30/2010 12:31:46 PM
## Metadata              6
## Aggregated            TRUE
## Discretized           TRUE
## 
## 7
## Class                 OPMD
## From file             ./P. aeruginosa St.
##                       429_vim10_22B__1_28_PMX_0_8#30#2010_C_22B_5.csv
## Hours measured        95.75
## Number of wells       1
## Plate type            Gen III
## Position              22-B
## Setup time            8/30/2010 11:28:54 AM
## Metadata              6
## Aggregated            TRUE
## Discretized           TRUE
## 
## 8
## Class                 OPMD
## From file             ./P. aeruginosa St.
##                       429_vim10_22B__1_28_PMX_0_8#30#2010_C_22B_5.csv
## Hours measured        95.75
## Number of wells       1
## Plate type            Gen III
## Position              22-B
## Setup time            8/30/2010 11:28:54 AM
## Metadata              6
## Aggregated            TRUE
## Discretized           TRUE
## 
## => OPMS object with 8 plates (8 aggregated, 8 discretized) of type 'Gen III', 1 well(s) and about 384 time point(s).
metadata(x, opm_opt("series.key"))
## [1] 1 2 1 2 1 2 1 2
stopifnot(is(x, "OPMS"), dim(x) == c(8, hours(vaas_4, "size")[1], 1))
(x <- split(vaas_4, "Species"))
##                        Length Plate.type Aggregated Discretized
## Escherichia.coli            2    Gen III          2           2
## Pseudomonas.aeruginosa      2    Gen III          2           2
## 
## => MOPMX object with 2 element(s), details are shown above.
##  Access the elements with [[ or $ to apply specific methods.
stopifnot(is(x, "MOPMX"), length(x) == 2)
# Split into list of OPMS objects with the same overall measurement hours
x <- split(vaas_4, as.factor(hours(vaas_4)))
stopifnot(is(x, "MOPMX"), length(x) == 1, class(x[[1]]) == "OPMS")
# ... because the running times were actually already identical, the list
# contains only a single element.