Distance Metrics Mark Voorhies 5/14/2015 Mark Voorhies Distance - - PowerPoint PPT Presentation

distance metrics
SMART_READER_LITE
LIVE PREVIEW

Distance Metrics Mark Voorhies 5/14/2015 Mark Voorhies Distance - - PowerPoint PPT Presentation

Distance Metrics Mark Voorhies 5/14/2015 Mark Voorhies Distance Metrics New verbs f u n c t i o n ( parameter1 , parameter2 ) : def Do t h i s ! # Code to do t h i s return r e t u r n v a l u e Mark Voorhies


slide-1
SLIDE 1

Distance Metrics

Mark Voorhies 5/14/2015

Mark Voorhies Distance Metrics

slide-2
SLIDE 2

New verbs

def f u n c t i o n ( parameter1 , parameter2 ) : ”””Do t h i s ! ””” # Code to do t h i s return r e t u r n v a l u e

Mark Voorhies Distance Metrics

slide-3
SLIDE 3

Generators are like polymerases: iterable but not indexable

Mark Voorhies Distance Metrics

slide-4
SLIDE 4

List tricks

Adding data to a list: m y l i s t = [ ] m y l i s t . append (3) m y l i s t += [ 4 , 5 , 6 ]

Mark Voorhies Distance Metrics

slide-5
SLIDE 5

List tricks

Adding data to a list: m y l i s t = [ ] m y l i s t . append (3) m y l i s t += [ 4 , 5 , 6 ] Lists of lists: matrix = [ [ 1 , 2 , 3 , 4] , [ 5 , 6 , 7 , 8] , [ 9 ,10 ,11 ,12]]

Mark Voorhies Distance Metrics

slide-6
SLIDE 6

Expression profiling pipelines

Observation Hypothesis Experiment Model

Label (aRNA or cDNA) Amplify (bar code) Hybridize Sequencing Reaction Optical Aquisition (TIFF) Digitize (GPR) (FASTQ) Archive (NOMAD, MADAM, Acuity) Normalize and Merge (CDT) Probe design with unique mapping to genome Map to genome

  • r transcriptome

(SAM, BAM) Analyze GEO deposition Library Design! Quantify Abundances (RSEM, Cufflinks, eXpress, ...) GEO deposition

Mark Voorhies Distance Metrics

slide-7
SLIDE 7

Expression profiling pipelines

Mark Voorhies Distance Metrics

slide-8
SLIDE 8

Expression profiling pipelines

Mark Voorhies Distance Metrics

slide-9
SLIDE 9

The CDT file format

Minimal CLUSTER input Cluster3 CDT output Tab delimited (\t) UNIX newlines (\n) Missing values → empty cells

Mark Voorhies Distance Metrics

slide-10
SLIDE 10

supp2data.cdt

Mark Voorhies Distance Metrics

slide-11
SLIDE 11

supp2data.cdt

[ [ ”YBR166C” , ”YOR357C” , ”YLR292C” , . . . ] , [ ”TYR1 . . . ” , ”GRD19 . . . ” , ”SEC72 . . . ” , . . . ] , [ [ 0.33 , −0.17 , 0.04 , −0.07 , −0.09 , . . . ] , [ −0.64 , −0.38 , −0.32 , −0.29 , −0.22 , . . . ] , [ −0.23 , 0.19 , −0.36 , 0.14 , −0.40 , . . . ] , . . . ] ] Mark Voorhies Distance Metrics

slide-12
SLIDE 12

Fun with logarithms

In log space, multiplication and division become addition and subtraction: log(xy) = log(x) + log(y) log(x/y) = log(x) − log(y)

Mark Voorhies Distance Metrics

slide-13
SLIDE 13

Fun with logarithms

In log space, multiplication and division become addition and subtraction: log(xy) = log(x) + log(y) log(x/y) = log(x) − log(y) Therefore, exponentiation becomes multiplication: log(xy) = y log(x)

Mark Voorhies Distance Metrics

slide-14
SLIDE 14

Fun with logarithms

In log space, multiplication and division become addition and subtraction: log(xy) = log(x) + log(y) log(x/y) = log(x) − log(y) Therefore, exponentiation becomes multiplication: log(xy) = y log(x) Also, we can change of the base of a logarithm like so: logA(x) = log(x)/ log(A)

Mark Voorhies Distance Metrics

slide-15
SLIDE 15

Pearson distances

Pearson similarity s(x, y) = 1 N

N

  • i

xi − xoffset φx yi − yoffset φy

  • φG =
  • N
  • i

(Gi − Goffset)2 N

Mark Voorhies Distance Metrics

slide-16
SLIDE 16

Pearson distances

Pearson similarity s(x, y) =

N

  • i

xi − xoffset φx yi − yoffset φy

  • φG =
  • N
  • i

(Gi − Goffset)2

Mark Voorhies Distance Metrics

slide-17
SLIDE 17

Pearson distances

Pearson similarity s(x, y) =

N

  • i

  xi − xoffset N

i (xi − xoffset)2

    yi − yoffset N

i (yi − yoffset)2

 

Mark Voorhies Distance Metrics

slide-18
SLIDE 18

Pearson distances

Pearson similarity s(x, y) = N

i (xi − xoffset)(yi − yoffset)

N

i (xi − xoffset)2

N

i (yi − yoffset)2

Mark Voorhies Distance Metrics

slide-19
SLIDE 19

Pearson distances

Pearson similarity s(x, y) = N

i (xi − xoffset)(yi − yoffset)

N

i (xi − xoffset)2

N

i (yi − yoffset)2

Pearson distance d(x, y) = 1 − s(x, y)

Mark Voorhies Distance Metrics

slide-20
SLIDE 20

Pearson distances

Pearson similarity s(x, y) = N

i (xi − xoffset)(yi − yoffset)

N

i (xi − xoffset)2

N

i (yi − yoffset)2

Pearson distance d(x, y) = 1 − s(x, y) Euclidean distance N

i (xi − yi)2

N

Mark Voorhies Distance Metrics

slide-21
SLIDE 21

Comparing all measurements for two genes

  • −5

5 −5 5

Comparing two expression profiles (r = 0.97)

TLC1 log2 relative expression YFG1 log2 relative expression

Mark Voorhies Distance Metrics

slide-22
SLIDE 22

Comparing all genes for two measurements

  • −10

−5 5 10 −10 −5 5 Array 1, log2 relative expression Array 2, log2 relative expression

  • Mark Voorhies

Distance Metrics

slide-23
SLIDE 23

Comparing all genes for two measurements

  • −10

−5 5 10 −10 −5 5

Euclidean Distance

Array 1, log2 relative expression Array 2, log2 relative expression

  • Mark Voorhies

Distance Metrics

slide-24
SLIDE 24

Comparing all genes for two measurements

  • −10

−5 5 10 −10 −5 5

Uncentered Pearson

Array 1, log2 relative expression Array 2, log2 relative expression

  • Mark Voorhies

Distance Metrics

slide-25
SLIDE 25

Measure all pairwise distances under distance metric

Mark Voorhies Distance Metrics

slide-26
SLIDE 26

Clustering exercises – Visualizing the distance matrix

Mark Voorhies Distance Metrics

slide-27
SLIDE 27

Homework

1 Write a function to calculate all pairwise Pearson correlations

for the yeast expression profiles.

2 Save the results of your pairwise correlation calculation in the

CDT format described in the JavaTreeView manual.

3 Read PNAS 95:14863 4 Try the first two problems, replacing the Pearson correlation

with the distance metric from the PNAS paper or with one of the distance metrics from the Cluster3 manual.

Mark Voorhies Distance Metrics