stitch-methods {xcms} | R Documentation

## Correct gaps in data

### Description

Fixes gaps in data due to calibration scans or lock mass. Automatically detects file type and calls the relevant method. The mzXML file keeps the data the same length in time but overwrites the lock mass scans. The netCDF version adds the scans back into the data thereby increasing the length of the data and correcting for the unseen gap.

### Arguments

`object` | An `xcmsRaw-class` object
`lockMass` | A dataframe of locations of the gaps
`freq` | The intervals of the lock mass scans
`start` | The starting lock mass scan location, default is 1

### Details

`makeacqNum` takes locates the gap using the starting lock mass scan and it's intervals. This data frame is then used in `stitch` to correct for the gap caused by the lock mass. Correction works by using scans from either side of the gap to fill it in.

### Value

`stitch` A corrected `xcmsRaw-class` object `makeacqNum` A numeric vector of scan locations corresponding to lock Mass scans

### Methods

object = "xcmsRaw"

  `stitch(object, lockMass=numeric())`

object = "xcmsRaw"

  `makeacqNum(object, freq=numeric(), start=1)`

### Author(s)

Paul Benton, hpaul.benton08@imperial.ac.uk

### Examples

    ## Not run: library(xcms)
        library(faahKO)
        ## These files do not have this problem to correct for but just
        ## for an example
        cdfpath <- system.file("cdf", package = "faahKO")
        cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE)
        xr<-xcmsRaw(cdffiles[1])
        xr
        ##Lets assume that the lockmass starts at 1 and is every 100 scans
        lockMass<-xcms:::makeacqNum(xr, freq=100, start=1)
        ## these are equcal
        lockmass<-AutoLockMass(xr)
        ob<-stitch(xr, lockMass)
        ob

        ## plot the old data before correction
        foo<-rawEIC(xr, m=c(200,210), scan=c(80,140))
        plot(foo$scan, foo$intensity, type="h")

        ## plot the new corrected data to see what changed
        foo<-rawEIC(ob, m=c(200,210), scan=c(80,140))
        plot(foo$scan, foo$intensity, type="h")

    ## End(Not run)

[Package xcms version 3.10.2 Index]