Skip to main content
Topic: Choose the best parameters to analyse UPLC-qTof data (Read 13099 times) previous topic - next topic

Choose the best parameters to analyse UPLC-qTof data

Hello every one,

I'm trying to analyse UPLC-qTof data from waters ultima. As my partners are experimenting new protocols I don't know what we are missing. First, the spectras look very different from http://metabolomics-forum.com/viewtopic ... 9174cddfb0

Can I infer something from this trend already?
https://dl.dropbox.com/u/10712588/TICs.pdf

I also had to correct the "mz sorting violation" from massWolf conversion, and don't know if it can interfere...

I'm trying to extract peaks with
method='centWave', snthresh=3, prefilter=c(3,100)

and using the default parameters in the fallowing steps. When I use the extracted peaks to annotation with camera I have only fell peaks with a very low intensity.

Are there manuals explaining each step with consistence checks, that is, more extensive than  xcmsPreprocess vignette?

Re: Choose the best parameters to analyse UPLC-qTof data

Reply #1
As for your TICs: masswolf incorporates the lockmass scans into the data. That are those spikes you see. Currently the only way to correctly convert the data is to use waters databridge software to convert to CDF files.
Next it seems like all your peaks are extremely low. It can often be more easy to look at the base peak intensity (BPI) instead of the TIC. You can do that in masslynx also. Do you see more reasonable peaks there? Do you have a reasonably stable signal from the lockspray compound/trace? It doesn't look like it in your chromatogram. You need to understand if you have a reasonable data quality before there is a point in using XCMS.


For XCMS take a look at the parameters for centwave:
?findPeaks.centWave

Especially the default peakwidth parameter is not good for UPLC. You can try to use something like peakwidth=c(2,20).
Blog: stanstrup.github.io

Re: Choose the best parameters to analyse UPLC-qTof data

Reply #2
Hi  Jan,

thank you very much for your reply.

I usually only deal with the mass list, and even less with lock mass.

So, are you saying that I can't use the msconvert or massWolf corvesion with lock mass?

"You need to understand if you have a reasonable data quality before there is a point in using XCMS"

that is exactly my point, but I thought I could to this with xcms, I don't have experience with massLinx, is there an automated way to export peaks there for later inference? Can I set the conversion of all .raw files to CDF files in a batch?
 
Can I search for base peak intensity (BPI) through all samples in xcms?

 

Re: Choose the best parameters to analyse UPLC-qTof data

Reply #3
Quote
So, are you saying that I can't use the msconvert or massWolf corvesion with lock mass?
Yes. Masswolf as I said mixes the normal scans with the lockmass scans. and msconvert doesn't calibrate the data. Databridge in theory can convert all in one batch. However they are so eager to inform you that you have several traces/functions so they make a popup for each files. And it seems to stop randomly... never the less it is the only consistently working way available at the moment.

Understanding the quality of the data only through some calculations with XCMS is over-complicating things heavily. Does your peaks tail? Do they have the usual intensity achieved on your setup? Is the lockmass intensity at at reasonable level?. Are the retention times as they should be? Is the baseline at a reasonable level? How is the mass accuracy? Some of these can definitely be assessed by some calculations. But it is way faster to just look at the chromatogram first and see if everything looks normal. You can't spot things you are not looking specifically for with a computer. Luckily a human can.

For BPI plot see:
?plotChrom
Blog: stanstrup.github.io

Re: Choose the best parameters to analyse UPLC-qTof data

Reply #4
Hi Jan,

thanks again for your answer, I completely agree with you about the "sanity checks" before automated analysis, we will always find patterns if we search, even if they don't make sense.

The main problem with my group is that I'm the responsible for data analysis and, I'm not even in the same city of people running the experiment....

I've read this post http://metabolomics-forum.com/viewtopic.php?f=25&t=191

where someone says:
"...simply deleting the FUNC0003 DAT IDX and STS files might be a simple option for MassWolf conversion... "
deleting this files from .raw (in my case FUNC002, it seems that for me the FUNC0003 are from diode array)  turned to give the same visual result as the .CDF after the conversion. Do you ever read how the water write the raw data, is it correct, can I just erase this files?

the first is the .CDF, the second mzXML from full .raw, and the third from .raw without FUNC002 files
https://dl.dropbox.com/u/10712588/TICs-conversion.pdf

Re: Choose the best parameters to analyse UPLC-qTof data

Reply #5
I haven't tried the delete workaround myself. I have another workaround that I will release at some point.

As you can see yourself it seems to be working. but you need to check something: if the masses are the same. I don't know if it uses the lockmass function (it is those you delete) for the calibration. If you can verify that the masses are identical in the file you created then that workaround works too.
Blog: stanstrup.github.io

Re: Choose the best parameters to analyse UPLC-qTof data

Reply #6
Hi Jan,

it seems you were right, checking the peaks through scans they look the same for .cdf and mxXML converted

https://dl.dropbox.com/u/10712588/conv.pdf

Here is my "workaround"

# download massWolf from http://tools.proteomecenter.org/wiki/in ... e_software
# you to have to have massLynx instaled
# chage the var loc for massWolf.exe in your system
# paste a copy of a folder containing .raw files inside "My documents"
# load or paste the script below in R environment
# run raw2mzxml()

# warnings: the script will erase your .raw files, so change it or have a backup
# for some people the lock mass is FUN003 http://metabolomics-forum.com/viewtopic.php?f=25&t=191
# in this case change FUNC.*2 for 3

raw2mzxml <- function() {
   setwd("~")
   old.dir <- getwd()
   t1 <- as.numeric(strsplit(strsplit(date(), " ")[[1]][4], ":")[[1]])
   loc <- "C:/Documents and Settings/ricardo/Meus documentos/Downloads/massWolf-4.3.1/massWolf.exe"
   vfiles <- list.dirs(dir(), full.names=TRUE)
   vfiles <- vfiles[grep(".*\.raw$", vfiles)]

   dirs <- unique(sub("(.*\/).*raw","\1", vfiles))
   root <- paste(strsplit(dirs[1], "/")[[1]][1],"/",sep="")
   dirs <- as.vector(sapply(dirs, function(x) paste(strsplit(x, "/")[[1]][-1],collapse="/")))
   #dirs <- path.expand(paste("~/", dirs, sep=""))
   vlog <- c()
   for(i in 1:length(dirs)) {
      setwd(path.expand(paste("~/", root, sep="")))
      setwd(dirs)
      vfiles <- list.dirs(dir())
      vfiles <- vfiles[grep(".*\.raw$", vfiles)]
      
      for(j in 1:length(vfiles)) {
         file.remove(path.expand(paste(getwd(),"/",vfiles,"/",dir(vfiles)[grep(".*FUNC.*2.*", dir(vfiles))], sep="")))
          log <- shell(paste(""", loc, """, " --mzXML ", vfiles[j],sep=""))
          vlog <- append(vlog, log)
          unlink(vfiles[j], recursive=TRUE)
      }
   }
   setwd(old.dir)
    t2 <- as.numeric(strsplit(strsplit(date(), " ")[[1]][4], ":")[[1]])
   cat(paste("n The program took:", paste(t2-t1, collapse=":"), "to convert", length(vlog), "files", "n"))
   
}

Re: Choose the best parameters to analyse UPLC-qTof data

Reply #7
I added a function, convert.waters2, to my package (https://github.com/stanstrup/chemhelper) based on this idea of deleting the functions (in waters lingo) that should not go into the output file. You can select which functions to keep and a separate file for each will be written.
Blog: stanstrup.github.io

Re: Choose the best parameters to analyse UPLC-qTof data

Reply #8
Quote from: "Jan Stanstrup"
I added a function, convert.waters2, to my package (https://github.com/stanstrup/chemhelper) based on this idea of deleting the functions (in waters lingo) that should not go into the output file. You can select which functions to keep and a separate file for each will be written.

Hi Jan,

I am attempting to use the convert.waters2 function you have posted on git hub but the supplemental material you refer to here (http://https://github.com/stanstrup/convert.waters.raw) gives a 404 error. Can you re post those or provide more information on how to set up the conversion, i.e. "MassLynx need to be installed and masswolf need to be in path." what path do you refer to? Also, where to raw files need to be?

Thank you,

Dale Forrister

Re: Choose the best parameters to analyse UPLC-qTof data

Reply #9
I have fixed the link. Thanks. But that material won't tell you how to use the function.
When you have installed the package take a look at the documentation. Hopefully it explains how to use the function itself. Otherwise please complain here and I will improve it.
The raw files can be anywhere. You pass the function a vector of paths to the raw files.

PATH is a list of folders in which the OS will always look for an executable if you try to run it. It is a so called "environmental variable". You can either 1) add the folder where you have masswolf to PATH (http://windowsitpro.com/systems-managem ... ystem-path), 2) simply dump masswolf.exe in "c:WindowsSystem32" (which is in PATH) or 3) put masswolf in your R working directory. That should work too.
Blog: stanstrup.github.io

Re: Choose the best parameters to analyse UPLC-qTof data

Reply #10
Thanks for the quick response. I was able to get the convert.waters() to run, but I keep getting an error with convert.waters2()

masswolf.exe is in the working directory. I want to remove the lockscans so I chose funcs= c(1,2) is that correct? what are each of those func (func001, func002 and func003)?

here is what I used:

convert.waters2(infiles ="K:/XCMS_ANALYSIS/mzxml",outdir = "K:/XCMS_ANALYSIS/mzxml/converted",funcs = c(1,2))

I get the errors:

1) "In file.symlink(from = paste0(infiles, "/", to_copy),  ... :
  cannot symlink 'K:XCMS_ANALYSISmzxmlconverted' to 'K:/XCMS_ANALYSIS/mzxml/converted/temp.raw/converted', reason 'A required privilege is not held by the client'
2) running command 'masswolf --mzXML "K:/XCMS_ANALYSIS/mzxml/converted/temp.raw" "K:/XCMS_ANALYSIS/mzxml/converted/mzxml_func1.mzXML"' had status 65535


Thanks,

Dale

Re: Choose the best parameters to analyse UPLC-qTof data

Reply #11
Which functions to choose depends on the experiment you did. The functions are those listed in masslynx if you open a chromatogram and do: --> display --> tic. If you just did MS1 I think you just want the first one. The second would be the lockmass function.

For  convert.waters2 infiles needs to be the actual .raw file. Not the folder which contains them as for convert.waters. I would guess that is the problem here.
Blog: stanstrup.github.io