The PTW package Institute for Molecules and Materials Dept. - - PowerPoint PPT Presentation

the ptw package
SMART_READER_LITE
LIVE PREVIEW

The PTW package Institute for Molecules and Materials Dept. - - PowerPoint PPT Presentation

Global Parametric Time Warping in R Tom Bloemberg The PTW package Institute for Molecules and Materials Dept. Chemometrics / Analytical Chemistry www.ru.nl/imm Global Parametric Time Warping in R The PTW package Chromatographic example


slide-1
SLIDE 1

The PTW package

Global Parametric Time Warping in R

Tom Bloemberg Institute for Molecules and Materials

  • Dept. Chemometrics /

Analytical Chemistry www.ru.nl/imm

slide-2
SLIDE 2

Chromatographic example

The PTW package

Global Parametric Time Warping in R

slide-3
SLIDE 3

Alignment

  • Also:

– ‘Synchronization’ – ‘(Time) Warping’

  • Shift, stretch, compress
  • Applications in:

– Speech analysis – Chromatography – NMR – …

The PTW package

Global Parametric Time Warping in R

slide-4
SLIDE 4

Parametric Time Warping1

  • Before warping:
  • After warping:
  • Polynomial model of warping function:
  • Minimize:

... ) (

2 2 1

+ + + = t a t a a t w

The PTW package

Global Parametric Time Warping in R

=

=

Q q q qt

a t w ) (

) Sample( ) Reference( t t ↔ )) ( Sample( ) Reference( t w t ↔

( )

i i i

t w t

2

)) ( ( Sample ) ( Reference

slide-5
SLIDE 5

A single alignment

> library(ptw) > data(chromatograms) > chromatograms <- basel.off(chromatograms) > C.warped <- ptw(chromatograms[1, ], chromatograms[16, ]) > plot(C.warped, plot.orig=TRUE, plot.wf=TRUE)

The PTW package

Global Parametric Time Warping in R

slide-6
SLIDE 6

> library(ptw) > data(chromatograms) > chromatograms <- basel.off(chromatograms) > C.warped <- ptw(chromatograms[1:8, ], chromatograms[9:16, ]) > plot(C.warped, plot.orig=TRUE, plot.wf=TRUE)

Multiple alignments

The PTW package

Global Parametric Time Warping in R

> library(ptw) > data(chromatograms) > chromatograms <- basel.off(chromatograms) > C.warped <- ptw(chromatograms[1, ], chromatograms[2:16, ]) > plot(C.warped, plot.orig=TRUE, plot.wf=TRUE)

slide-7
SLIDE 7

LC-MS data

The PTW package

Global Parametric Time Warping in R

m/z T T m/z

slide-8
SLIDE 8

T m/z

LC-MS data

The PTW package

Global Parametric Time Warping in R

m/z T Signal

slide-9
SLIDE 9

Global Alignment

The PTW package

Global Parametric Time Warping in R

  • Choose ‘High Quality’ traces using CODA2,3

!""## " !!!

m/z Time

> library(ptw) > data(LCMS) > HQ <- coda(LCMS, combine=c(1,2), windows=c(3,1), nChroms=5) > LCMS.Warped <- ptw(LCMS[1, , ], LCMS[2, , ], HQ=HQ, align.method=“global”)

slide-10
SLIDE 10

Global Alignment

The PTW package

Global Parametric Time Warping in R

> library(ptw) > data(LCMS) > HQ <- coda(LCMS, combine=c(1,2), windows=c(3,1), nChroms=5) > LCMS.Warped <- ptw(LCMS[1,,], LCMS[2,,], HQ=HQ, align.method = “global”) > library(ptw) > data(LCMS) > HQ <- coda(LCMS, combine=c(1,2), windows=c(3,1), nChroms=5) > LCMS.Warped <- ptw(colSums(LCMS[1, , HQ]), colSums(LCMS[2, , HQ]), align.method = “individual”)

slide-11
SLIDE 11

Discussion

The PTW package

Global Parametric Time Warping in R

  • Second alignment package for R (next to dtw)
  • Individual, multiple and global warpings
  • Trace selection (CODA)
  • Baseline removal (asymmetric LS)
  • Smoothing (Whittaker)
slide-12
SLIDE 12

Planning

The PTW package

Global Parametric Time Warping in R

  • Implement semi-PTW
  • Implement other distance measures
  • Connect with dtw-package
  • Release on 1 September 2009
slide-13
SLIDE 13

Acknowledgements

Jan Gerretzen Hans Wouters Ron Wehrens Lutgarde Buydens Paul Eilers Jolein Gloerich Hans Wessels Bert van der Heuvel

The PTW package

Global Parametric Time Warping in R