loadLOBdbase | R Documentation |
Reconstruct a "LOBdbase"
object from properly formatted data in a .csv
file. More robust than the generic constructor function
LOBdbase
.
loadLOBdbase(file, polarity, num_compounds = NULL)
file |
Path to a .csv file containing the database to be imported. The file format
should be consistent with the .csv output that is obtained using
|
polarity |
Specify polarity (ionization mode) of the database being imported ("positive" or
"negative"). |
num_compounds |
If known, the number of parent compounds represented in the database being imported. Can be unspecified. |
loadLOBdbase
is a glorified implementation of
read.table
that attempts to determine whether the format of
the data in file
is consistent with that of a saved "LOBdbase"
object. Some leeway is allowed for variation in punctuation and spelling of
column headers in the source file. Special attention should be paid to how
adduct ions are specified (e.g., "[M+H]+"
, "[M+NH4]+"
, or
"[M+Cl]-"
). Most users will find this function more useful than the
generic constructor function LOBdbase
.
A "LOBdbase-class"
object.
James Collins, james.r.collins@aya.yale.edu
Collins, J.R., B.R. Edwards, H.F. Fredricks, and B.A.S. Van Mooy. 2016. LOBSTAHS: An adduct-based lipidomics strategy for discovery and identification of oxidative stress biomarkers. Analytical Chemistry 88:7154-7162
LOBdbase
,
LOBdbase
,
doLOBscreen
,
generateLOBdbase
,
default.LOBdbase
## save the default negative mode database as a .csv file
data(default.LOBdbase)
neg.DB = default.LOBdbase$negative
fname = paste0("LOBSTAHS_lipid-oxy_DB_",
strtrim(as.character(polarity(neg.DB)),3),".csv")
exportmat = data.frame(frag_ID(neg.DB),
mz(neg.DB),
exact_parent_neutral_mass(neg.DB),
as.character(lipid_class(neg.DB)),
as.character(species(neg.DB)),
as.character(adduct(neg.DB)),
as.character(adduct_rank(neg.DB)),
FA_total_no_C(neg.DB),
FA_total_no_DB(neg.DB),
degree_oxidation(neg.DB),
parent_elem_formula(neg.DB),
parent_compound_name(neg.DB),
stringsAsFactors = FALSE)
colnames(exportmat) = c("frag_ID","mz","exact_parent_neutral_mass",
"lipid_class","species","adduct","adduct_rank",
"FA_total_no_C","FA_total_no_DB","degree_oxidation",
"parent_elem_formula","parent_compound_name")
write.csv(exportmat, fname)
## reimport it
neg.DB.reimported = loadLOBdbase("LOBSTAHS_lipid-oxy_DB_neg.csv",
polarity = "negative",
num_compounds = NULL)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.