This function creates a stratified 'test' MSnSet
which can be used
for algorihtmic development. A "MSnSet"
containing only
the marker proteins, as defined in fcol
, is returned with a new
feature data column appended called test
in which a stratified subset
of these markers has been relabelled as 'unknowns'.
testMSnSet(object, fcol = "markers", size = 0.2, seed)
An instance of class "MSnSet"
The feature meta-data column name containing the
marker definitions on which the data will be stratified. Default
is markers
.
The size of the data set to be extracted. Default is 0.2 (20 percent).
The optional random number generator seed.
An instance of class "MSnSet"
which
contains only the proteins that have a labelled localisation
i.e. the marker proteins, as defined in fcol
and a new
column in the feature data slot called test
which has part
of the labels relabelled as "unknown" class (the number of
proteins renamed as "unknown" is according to the parameter size).
library(pRolocdata)
data(tan2009r1)
sample <- testMSnSet(tan2009r1)
getMarkers(sample, "test")
#> organelleMarkers
#> Cytoskeleton ER Golgi Lysosome Nucleus
#> 5 22 10 6 16
#> PM Peroxisome Proteasome Ribosome 40S Ribosome 60S
#> 27 3 12 16 25
#> mitochondrion unknown
#> 23 46
all(dim(sample) == dim(markerMSnSet(tan2009r1)))
#> [1] TRUE