Description Usage Arguments Value Examples
View source: R/database-functions.R
Returns mz/rt features from Peak.list stored in SQLite database
1 | get_features(mytbl, peak.db, asdf)
|
mytbl |
character name of table in database to return |
peak.db |
Formal class SQLiteConnection |
asdf |
logical indicating whether to return a data frame instead of a tibble. Default is FALSE |
tbl alternatively a data frame
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | library(LUMA)
if(require(RSQLite, quietly = TRUE)) {
file <- system.file("extdata","Sample_Data.csv", package = "LUMA") # is case sensitive on Linux
sample_data <- read.table(file, header = TRUE, sep = ",")
mzdatafiles <- sample_data$CT.ID
file.base <- gen_filebase(mzdatafiles = mzdatafiles, BLANK = FALSE, IonMode =
"Positive", ion.id = c("Pos","Neg")) #Returns "Peaklist_Pos"
peak_db <- connect_peakdb(file.base = file.base, mem = TRUE)
dbIsValid(peak_db) #Database is valid
dbListTables(peak_db) #But no tables yet
mydf <- Peaklist_Pos$From_CAMERA
write_tbl(mydf = mydf, myname = "From_CAMERA", peak.db = peak_db)
test_tbl <- LUMA:::get_features(mytbl = "From_CAMERA", peak.db = peak_db)
test_tbl #Returns a tibble
test_df <- LUMA:::get_features(mytbl = "From_CAMERA", peak.db = peak_db, asdf = TRUE)
test_df #Returns a data frame
dbDisconnect(peak_db)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.