Skip to main content
Topic: Alignment of matrices with obiwarp (Read 2014 times) previous topic - next topic

Alignment of matrices with obiwarp

Dear all,

I usually perform the feature extraction from HRMS data with software from the vendor and want to use the XCMS package in R now to align the features from different measurements.
As i already have all of the required information available in matrices (one matrix per sample measurement with the mass, retention time and intensity), i would like to know if i can perform the alignment now directly on the matrices without using the typical input formats for XCMS (NetCDF, mzData,...).

Best regards,
Sascha

Re: Alignment of matrices with obiwarp

Reply #1
Hi,

it is possible to create an xcmsSet from a peak list,
as shown by the following minimalistic example.
But this will not allow to use Obiwarp, since Obiwarp
goes back to the raw data files, which in turn would have
to be netCDF, mzML etc.

Code: [Select]
library(xcms)

intensity <- matrix(1:32, ncol=4)
mz <- rep(1:8, ncol(intensity))
rt <- rep(8:1, ncol(intensity))

xs <- new("xcmsSet")

peaks(xs) <- cbind(mz=mz, mzmin=mz, mzmax=mz,
                  rt=mz, rtmin=mz, rtmax=mz,
                  into=as.vector(intensity), intf=as.vector(intensity),
                  maxo=as.vector(intensity), maxf=as.vector(intensity),
                  sample=rep(seq(1,ncol(intensity)), each=nrow(intensity))
                  )
sampnames(xs) <- 1:4

xsg <- group(xs)
xsg

If you need Obiwarp, you will need to write a new constructor
for the xcmsSource class that reads a peaklist into an xcmsRaw,
see also this thread: viewtopic.php?f=8&t=310

and the code in https://github.com/sneumann/xcms/blob/m ... msSource.R
and the use in https://github.com/sneumann/xcms/blob/m ... /xcmsRaw.R


Yours,
Steffen
--
IPB Halle                          Mass spectrometry & Bioinformatics
Dr. Steffen Neumann         http://www.IPB-Halle.DE
Weinberg 3 06120 Halle     Tel. +49 (0) 345 5582 - 1470
sneumann(at)IPB-Halle.DE

Re: Alignment of matrices with obiwarp

Reply #2
Hi Steffen,

thanks a lot for your fast reply to my question.
Unfortunately, i think i am not capable of performing the required modifications right now as i only created rather basic code in R so far.
Depending on the amount of time i have to spend I will either try to make myself more familiar with the code of XCMS and a more advanced type of programming or i will stick to my current alignment algorithm from OpenMS.

Best regards,
Sascha