update.metaboSet: Update ids in a metaboSet object

Description Usage Arguments Value Author(s) Examples

View source: R/update.metaboSet.R

Description

Update sample or analyte ids in an experiment object

Usage

1
2
## S3 method for class 'metaboSet'
update(obj,what="Sid",formerid=NULL,newid=NULL,exact=TRUE,swap=FALSE)

Arguments

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

Value

metaboSet object

Author(s)

David Enot david.enot@gustaveroussy.fr

Examples

 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

kroemerlab/GRMeta documentation built on March 25, 2020, 11:32 a.m.