Description Usage Arguments Value Author(s) Examples
View source: R/update.metaboSet.R
Update sample or analyte ids in an experiment object
1 2 |
obj |
Metaboset object |
what |
Only Sid or Analyte supported |
formerid |
Vector of current Sids |
newid |
Vector of new Sids |
exact |
Exact matching |
swap |
Should names in oldname be swaped with corresponding newname |
metaboSet object
David Enot david.enot@gustaveroussy.fr
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | testfiles=list.files(system.file( package = "GRMeta"),pattern = "txt$",full.names = TRUE)
mydata=loadAgilentData(ifile =testfiles[1])
print(mydata$Sid)
### Exact=TRUE: simple renaming of the Sid
mydata2=update(mydata,what="Sid",formerid=c("Bl_prerun-eau_1b","Bl_prerun-matrice_4"),newid = c("Bl-pre","BlM-pre"),exact=TRUE,swap = FALSE)
print(mydata2$File)
### Exact=FALSE: replace patterns by the second one
mydata2=update(mydata,what="Sid",formerid=c("pre","eau"),newid = c("*****",""),exact=FALSE,swap = FALSE)
print(mydata2$Meta)
### Swap two entries does ONLY exchange ids but not the file/date etc...
print(mydata$File)
mydata2=update(mydata,what="Sid",formerid="Bl_prerun-eau_1b",newid = "Bl_prerun-matrice_4",swap = TRUE)
print(mydata2$File)
############# With Analyte: exclude the method name from the analyte id
testfiles=list.files(system.file( package = "GRMeta"),pattern = "txt$",full.names = TRUE)
mydata=loadAgilentData(ifile =testfiles[1])
mydata$Analyte
mydata2=update(mydata,what="Analyte",formerid="-myassay",newid = "",exact=FALSE)
mydata2$Analyte
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.