Skip to main content

Topics

This section allows you to view all Topics made by this member. Note that you can only see Topics made in areas you currently have access to.

Topics - Ralf

1
Job opportunities / Senior Engineer, Software - CA, San Jose
Expertise   Software Development
Job Type   Full-time
Location   United States - California - San Jose
Job Level   Experienced

Position Summary:
The San Jose, CA software development group is seeking an exceptionally talented Senior Software Engineer that will be a key team member supporting Microsoft Windows based applications, internal .Net libraries, scientific algorithms and windows/web based services for Thermo Fisher’s leading mass spectrometry solutions. As a technical contributor, she/he must be comfortable working within a small group of developers and other cross disciplinary individuals in the design, development and release of industry leading solutions. As a Senior Engineer you will bring to the group your vast experience in software development such as mentoring other engineers, communication with peers in design and code analysis, software debugging techniques and managing time between different priorities.

for details click here.
2
XCMS - Cookbook / Converting Waters .raw files to mzXML
Proteowizard converts .raw files to mzXML/mzML but it does not calibrate the data at the moment.
One way is to export the (calibrated) data into CDF files using MassLynx.

However, if you need to convert to mzXML then you can use a workaround that is shown here.
3
XCMS - FAQ / How to choose centWave's peakwidth parameter ?
The main purpose of the peakwidth parameter is to roughly estimate the peak width range, this parameter is not a threshold.
The wavelets used for peak detection are calculated from this parameter.

If you use HPLC and your peaks are normally 20 - 60 s wide (base peak with), just go with that, i.e. peakwidth=c(20,60)
centWave will still detect peaks that are 15s or 80 s wide!

Important: Do not choose the minimum peak width too small, it will not increase sensitivity, but cause peaks to be split.

Example: peak width ~ 45 s
using peakwidth = c(10,120) the peak will be split in three peaks, each detected as a ~10s wide separate peak (since they are separated by a local minimum) :

[attachment=1:toypq4xs]peakwidth_10_120.png[/attachment:toypq4xs]

using peakwidth = c(20,120) will keep the peak intact :

[attachment=0:toypq4xs]peakwidth_20_120.png[/attachment:toypq4xs]

[attachment deleted by admin]
5
XCMS - Cookbook / PCA & MDS examples
The following code, below is an example using the FaahKO package for Principal Component Analysis (PCA) and Multi-Dimensional Scaling (MDS).

First load the required packages and then use xcms to get the filled peak data.
Code: [Select]
library(xcms)
library(pcaMethods)
cdfpath <- system.file("cdf", package = "faahKO")
cdffiles <- list.files(cdfpath, recursive = TRUE,full=T)
xset <- xcmsSet(cdffiles)
xsg <- group(xset)
xsg <- retcor(xsg)
xsg <- group(xsg,bw=10)
xsg <- fillPeaks(xsg)

Next we'll use some xcms commands to get the peak intensities out of the xcmsSet object and normalise the data. You can write you're own normalisation function or do mean centring etc.
Code: [Select]
## Get peak intensity values
values <- groupval(xsg, value="into")

## Numerical matrix with with samples in rows and variables as columns
data <- t(values)

## Normalize each mass signal to max=1
for (r in 1:ncol(data))
    data[,r] <- data[,r] / max(data[,r])

Finally we have something that we can put into the pca algorithm and plot.
Code: [Select]
##  PCA Example
pca.result <- pca(data, nPcs = 3, scale="none", cv="q2")

## Get the estimated principal axes (loadings)
loadings <- pca.result@loadings

## Get the estimated scores
scores <- pca.result@scores

## Now plot the scores
plotPcs(pca.result, type = "scores", col=as.integer(sampclass(xsg)) + 1)
dev.new()
## look to see if the model is valid
plot(pca.result)

Then have a look with the validity of the model using a Q2 values.
Loadings will let you know which metabolite is effecting the model and which metabolites are causing the differentiation.

Code: [Select]
plot(loadings[,1], loadings[,2], pch=16, cex=0.5)
text(loadings[,1], loadings[,2], rownames(values), col="red", cex=0.5)

For the MDS example we'll use the same data as before.
Code: [Select]
## MDS Example
library(MASS)

## MDS
data.dist <- dist(data)
mds <- isoMDS(data.dist)
plot(mds$points, type = "n")
text(mds$points, labels = rownames(data),col=as.integer(sampclass(xsg)) + 1)

To read up on the topic a good starting place is:
MDS - StatSoft
PCA - StatSoft
        PCA wikipedia

[attachment deleted by admin]
6
XCMS - Cookbook / TIC overlays
Sometimes it can be very nice to have all of your TICs from all of the files overlaid. This can help identify problems with repeatability and big changes between classes. The following code offers a function to do this.

Code: [Select]
library(xcms)
library(faahKO)
cdfpath <- system.file("cdf", package = "faahKO")
cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE)
xset <- xcmsSet(cdffiles)

getTICs(xcmsSet=xset, pdfname="TICs.pdf",rt="corrected")
## or
getTICs(files=cdffiles, pdfname="fileTICs.pdf")

To use the code above copy and paste the functions below into your R session before running the code above.
Code: [Select]
getTIC <- function(file,rtcor=NULL) {
    object <- xcmsRaw(file)
    cbind(if (is.null(rtcor)) object@scantime else rtcor, rawEIC(object,mzrange=range(object@env$mz))$intensity)
}

##
##  overlay TIC from all files in current folder or from xcmsSet, create pdf
##
getTICs <- function(xcmsSet=NULL,files=NULL, pdfname="TICs.pdf",rt=c("raw","corrected")) {
  if (is.null(xcmsSet)) {
    filepattern <- c("[Cc][Dd][Ff]", "[Nn][Cc]", "([Mm][Zz])?[Xx][Mm][Ll]",
                      "[Mm][Zz][Dd][Aa][Tt][Aa]", "[Mm][Zz][Mm][Ll]")
    filepattern <- paste(paste("\.", filepattern, "$", sep = ""), collapse = "|")
    if (is.null(files))
        files <- getwd()
    info <- file.info(files)
    listed <- list.files(files[info$isdir], pattern = filepattern,
                          recursive = TRUE, full.names = TRUE)
    files <- c(files[!info$isdir], listed)
  } else {
    files <- filepaths(xcmsSet)
  }

  N <- length(files)
  TIC <- vector("list",N)

  for (i in 1:N) {
      cat(files[i],"n")
      if (!is.null(xcmsSet) && rt == "corrected")
        rtcor <- xcmsSet@rt$corrected[[i]] else
          rtcor <- NULL
      TIC[[i]] <- getTIC(files[i],rtcor=rtcor)
  }

  pdf(pdfname,w=16,h=10)
      cols <- rainbow(N)
      lty = 1:N
      pch = 1:N
      xlim = range(sapply(TIC, function(x) range(x[,1])))
      ylim = range(sapply(TIC, function(x) range(x[,2])))
      plot(0, 0, type="n", xlim = xlim, ylim = ylim, main = "Total Ion Chromatograms", xlab = "Retention Time", ylab = "TIC")
      for (i in 1:N) {
      tic <- TIC[[i]]
      points(tic[,1], tic[,2], col = cols[i], pch = pch[i], type="l")
      }
      legend("topright",paste(basename(files)), col = cols, lty = lty, pch = pch)
  dev.off()
 
  invisible(TIC)
}

[attachment deleted by admin]
7
metaXCMS / Welcome to the metaXCMS user forum!
If you report bugs, please include as many details as possible:

  • the R and metaXCMS version you are using
  • the steps to reproduce the problem
  • a screenshot if necessary
Ralf.
8
XCMS / Welcome to the XCMS user forum - please read before posting!
If you report bugs, please include as many details as possible:

  • the R and XCMS version you are using, i.e. the output of
    sessionInfo()
  • the steps to reproduce the problem
  • if an R function errors out, the exact place of the error can be shown by typing
    traceback()

Ten Simple Rules for Getting Help from Online Scientific Communities

Please use the search function to browse this forum for possible answers to your question.

In addition to that, an archive of the obsolete xcms mailing list is available.

Ralf.