Tests if the marker class sizes are large enough for the parameter
optimisation scheme, i.e. the size is greater that xval + n
,
where the default xval
is 5 and n
is 2. If the test
is unsuccessful, a warning is thrown.
testMarkers(object, xval = 5, n = 2, fcol = "markers", error = FALSE)
An instance of class "MSnSet"
.
The number cross-validation partitions. See the
xval
argument in the parameter optimisation function(s).
Default is 5.
Number of additional examples.
The name of the prediction column in the
featureData
slot. Default is "markers"
.
A logical
specifying if an error should be
thown, instead of a warning.
If successfull, the test invisibly returns NULL
. Else,
it invisibly returns the names of the classes that have too few examples.
In case the test indicates that a class contains too few examples,
it is advised to either add some or, if not possible, to remove
the class altogether (see minMarkers
)
as the parameter optimisation is likely to fail or, at least,
produce unreliable results for that class.
getMarkers
and minMarkers
library("pRolocdata")
data(dunkley2006)
getMarkers(dunkley2006)
#> organelleMarkers
#> ER lumen ER membrane Golgi Mitochondrion PM
#> 14 45 28 55 46
#> Plastid Ribosome TGN unknown vacuole
#> 20 19 13 428 21
testMarkers(dunkley2006)
toosmall <- testMarkers(dunkley2006, xval = 15)
#> Warning: ER lumen, TGN have/has less than 17 markers.
toosmall
#> [1] "ER lumen" "TGN"
try(testMarkers(dunkley2006, xval = 15, error = TRUE))
#> Error in testMarkers(dunkley2006, xval = 15, error = TRUE) :
#> ER lumen, TGN have/has less than 17 markers.