This function replaces a string or regular expression in a feature
variable using the sub function.
Arguments
- object
An instance of class
MSnSet.- fcol
Feature variable to be modified. Default is
"markers". IfNULL, all feature variables will updated.- from
A
characterdefining the string or regular expression of the pattern to be replaced. Default is the empty string, i.e. the regular expression"^$". Seesubfor details. IfNA, thenNAvalues are replaced byto.- to
A replacement for matched pattern. Default is
"unknown". Seesubfor details.- ...
Additional arguments passed to
sub.
Examples
library("pRolocdata")
data(dunkley2006)
getMarkers(dunkley2006, "markers")
#> organelleMarkers
#> ER lumen ER membrane Golgi Mitochondrion PM
#> 14 45 28 55 46
#> Plastid Ribosome TGN unknown vacuole
#> 20 19 13 428 21
dunkley2006 <- fDataToUnknown(dunkley2006,
from = "unknown", to = "unassigned")
getMarkers(dunkley2006, "markers")
#> organelleMarkers
#> ER lumen ER membrane Golgi Mitochondrion PM
#> 14 45 28 55 46
#> Plastid Ribosome TGN unassigned vacuole
#> 20 19 13 428 21