Using massifquant for peak detection of generic matrix data?
2
0
Entering edit mode
@jamesdalgleish-14561
Last seen 8 months ago
United States

Is it possible to use massifquant for peak detection of non-MS data, but rather just finding traces that might look like MS peaks in a large matrix (150000x150000), for instance?

xcms kalman centwave yamss • 1.5k views
ADD COMMENT
1
Entering edit mode
Johannes Rainer ★ 2.1k
@johannes-rainer-6987
Last seen 5 weeks ago
Italy

The peak detection algorithms in xcms perform peak detection in retention time domain, i.e. in one dimension of the 2D matrix - with a lot of assumptions on peak shape, scattering of values in one dimension etc.

I would have a look at the yamss package instead. AFAIK, yamss uses a two-dimensional kernel to find peaks in 2D space.

cheers, jo

ADD COMMENT
0
Entering edit mode

Can you provide an example of how that would work? creating a new CMSraw object from a datatable is not straightforward.

ADD REPLY
0
Entering edit mode

I haven't tried that yet, sorry.

ADD REPLY
1
Entering edit mode
@jamesdalgleish-14561
Last seen 8 months ago
United States

So, the author provided an answer when I posed the question on the github site. I think this may be useful to many, so I'll post it here:

"

It is possible to phrase your question in terms of density estimation though. I've tried to illustrate with the following toy example:

library(yamss)
library(data.table)

set.seed(4)
num_rows <- 1000 # "m/z"
num_cols <- 2000 # "scan"
mat <- matrix(runif(num_rows*num_cols, 3, 5), nrow = num_rows, ncol = num_cols) # "intensities"

dt <- data.table(
	mz = rep(seq_len(num_rows), num_cols),
	scan = rep(seq_len(num_cols), each = num_rows),
	intensity = as.numeric(mat),
	sample = 1
)
cms_raw <- new("CMSraw")
yamss:::.mzParams(cms_raw) <- yamss:::.setMZParams(dt)
yamss:::.rawDT(cms_raw) <- dt
colData(cms_raw) <- DataFrame(sample = 1)
cms_proc <- bakedpi(cms_raw, dbandwidth = c(1e-5, 1), dgridstep = c(1e-5, 1))
cms_slice <- slicepi(cms_proc, cutoff = NULL, verbose = TRUE)"
ADD COMMENT

Login before adding your answer.

Traffic: 836 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6