Hello All,
I am doing some targeted metabolomics and was wondering if there were a quicker way to extract data from an MSn experiment data ("OnDiskMSnExp") data object.
I read in a number of files:
raw_data <- readMSData(files = FILES, pdata = new("NAnnotatedDataFrame", pd),
mode = "onDisk", centroided = FALSE, msLevel = 1)
And perform peakPicking:
comp_sg_cent_mz <- raw_data %>%
smooth(method = "SavitzkyGolay", halfWindowSize = 4L) %>%
pickPeaks(refineMz = "descendPeak") %>%
filterRt(initial_rtr) %>%
filterMz(initial_mzr)
I then write out the data:
write.table(comp_sg_cent_mz, file = main_peak_file_name, row.names = FALSE, append = TRUE, col.names = TRUE, sep = "\t")
And get something like this:
"file" "rt" "mz" "i"
1 404.2169952 391.283958025663 14271.6536796537
1 404.7310068 391.283864868878 14570.7012987013
1 405.245991 391.2839380729 13788.5194805195
1 405.760002 391.28338580945 10999.5714285714
Which I then process further.
The issue is that the write.table function takes at least one minute to write out (which is problematic with many files and compounds). Is there a faster way to access this data?
Thanks for any and all advice! james
Thank you, jo! I will try this out.