getMBRecordEntry: Get A Specific Entry from MassBank Record

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/MassBankRecordeR.R

Description

This function returns the entries in the MassBank record matching the field_code, or NULL if absent. The record should be in vector format, e.g. with MBFileToVector. Used to retrieve information in getMBRecordInfo.

Usage

1
getMBRecordEntry(field_code, record, trimEntry=TRUE)

Arguments

field_code

The string to match to the MassBank record.

record

The MassBank record in vector format to search, converted with MBFileToVector.

trimEntry

If TRUE, the field_code is removed, if FALSE, the full line is returned.

Details

Use getMBRecordPeaks, getMBRecordPeakAnnotations and/or getMBPeaksAnnos to retrieve peaks and peak annotations.

Value

Returns a vector containing the matching entries or NULL if the retrieval failed.

Author(s)

Emma Schymanski <emma.schymanski@uni.lu>.

See Also

MBFileToVector, getMBRecordInfo.

Examples

1
2
3
4
5
6
7
MBrecord <- system.file("extdata","EA020161_Diclofenac.txt",package="ReSOLUTION")
record <- MBFileToVector(MBrecord)
field_code <- "CH$NAME"
field_code <- "CH$LINK: CAS"
field_code <- "CH$LINK CS"
field_code <- "CH$LINK: PUBCHEM CID"
getMBRecordEntry(field_code, record)

schymane/ReSOLUTION documentation built on May 22, 2021, 3:41 a.m.