The mtd_ms_run() function allows to define and format the ms_run fields
of the mzTab-M metadata. The information is build on the actual data file
names along with optional additional parameters to characterize the MS
run(s).
For details and expected input for the various parameter it is strongly suggested to consult the mzTab-M documentation.
Arguments
- location
characterwith the location (and file name) of the individual runs. Each element will be one run. This parameter is required, set to"null"if the location of the file(s) is not known.- instrument_ref
(optional)
integer()with the index of the instrument the run was measured on.- format
(optional)
characterdefining the format of the external MS data file. If specified, alsoid_formathas be be provided. Can be of length 1 or equal tolength(location). For data file(s) in mzML format,format = "[MS, MS:1000584, mzML file, ]"can be used.- id_format
(optional)
characterdefining the id format used in the external data file. If specified, alsoformatneeds to be defined. Can be of length 1 or equal tolength(location). For data file(s) in mzML format,format = "[MS, MS:1000530, mzML unique identifier, ]"can be used.- fragmentation_method
(optional)
listofcharacterdefining the type(s) of fragmentation(s) used in a given ms run. Length must match length oflocationif provided. If no fragmentation was used for a specific file/run useNULLfor thatlistelement (position). As example, if two runs are included, the first does not have any fragmentation and for the second CID and HCD was used definelist(NULL, c("[MS, MS:1000133, CID, ]", "[MS, MS:1000422, HCD, ]")).- scan_polarity
characterdefining the polarity of a run. Can be either"positive"or"negative". Can be of length 1 or equal tolength(location).- hash
(optional)
characterwith the hash value of the corresponding external MS data file. If provided, alsohash_methodneeds to be defined. The length ofhashhas to match the length oflocation.- hash_method
(optional)
characterwith the hash method used to generate the value inhash. If provided, alsohashneeds to be defined. The length ofhash_methodhas to match the length ofhash.
See also
MTD-export for other functions defining metadata information
Examples
## Build a very basic MTD ms_run section for two data files
fls <- c("file:///path/to/file/a.mzML", "file:///path/to/file/b.mzML")
mtd_ms_run(location = fls, scan_polarity = "positive")
#> values
#> [1,] "ms_run[1]-location" "file:///path/to/file/a.mzML"
#> [2,] "ms_run[1]-scan_polarity[1]" "[MS, MS:1000130, positive scan, ]"
#> [3,] "ms_run[2]-location" "file:///path/to/file/b.mzML"
#> [4,] "ms_run[2]-scan_polarity[1]" "[MS, MS:1000130, positive scan, ]"
## Add also instrument reference information
mtd_ms_run(location = fls, scan_polarity = "positive", instrument_ref = 1)
#> values
#> [1,] "ms_run[1]-location" "file:///path/to/file/a.mzML"
#> [2,] "ms_run[1]-instrument_ref" "instrument[1]"
#> [3,] "ms_run[1]-scan_polarity[1]" "[MS, MS:1000130, positive scan, ]"
#> [4,] "ms_run[2]-location" "file:///path/to/file/b.mzML"
#> [5,] "ms_run[2]-instrument_ref" "instrument[1]"
#> [6,] "ms_run[2]-scan_polarity[1]" "[MS, MS:1000130, positive scan, ]"
## Finally, add a fragmentation method used for the second file - no
## fragmentation was used for the first file, thus `NULL` is specified.
## Parameter `fragmentation_method` expects a `list` as input to support
## also multiple fragmentation methods per MS run.
mtd_ms_run(location = fls, scan_polarity = "positive",
fragmentation_method = list(NULL, "[MS, MS:1000133, CID, ]"))
#> values
#> [1,] "ms_run[1]-location" "file:///path/to/file/a.mzML"
#> [2,] "ms_run[1]-scan_polarity[1]" "[MS, MS:1000130, positive scan, ]"
#> [3,] "ms_run[2]-location" "file:///path/to/file/b.mzML"
#> [4,] "ms_run[2]-fragmentation_method[1]" "[MS, MS:1000133, CID, ]"
#> [5,] "ms_run[2]-scan_polarity[1]" "[MS, MS:1000130, positive scan, ]"