Haplotyping via Perfect Phylogeny

38
Haplotyping via Perfect Phylogeny Conceptual Framework and Efficient (almost linear- time) Solutions Dan Gusfield U.C. Davis RECOMB 02, April 2002

description

Haplotyping via Perfect Phylogeny. Conceptual Framework and Efficient (almost linear-time) Solutions Dan Gusfield U.C . Davis RECOMB 02, April 2002. Genotypes and Haplotypes. Each individual has two “copies” of each chromosome. - PowerPoint PPT Presentation

Transcript of Haplotyping via Perfect Phylogeny

Page 1: Haplotyping via Perfect Phylogeny

Haplotyping via Perfect Phylogeny

Conceptual Framework and Efficient (almost linear-time) Solutions

Dan GusfieldU.C. Davis

RECOMB 02, April 2002

Page 2: Haplotyping via Perfect Phylogeny

Genotypes and HaplotypesEach individual has two “copies” of each

chromosome. At each site, each chromosome has one of two

alleles (states) denoted by 0 and 1 (motivated by SNPs)

0 1 1 1 0 0 1 1 0

1 1 0 1 0 0 1 0 0

2 1 2 1 0 0 1 2 0

Two haplotypes per individual

Genotype for the individualMerge the haplotypes

Page 3: Haplotyping via Perfect Phylogeny

Haplotyping Problem

• Biological Problem: For disease association studies, haplotype data is more valuable than genotype data, but haplotype data is hard to collect. Genotype data is easy to collect.

• Computational Problem: Given a set of n genotypes, determine the original set of n haplotype pairs that generated the n genotypes. This is hopeless without a genetic model.

Page 4: Haplotyping via Perfect Phylogeny

The Perfect Phylogeny Model

We assume that the evolution of extant haplotypes can be displayed on a rooted, directed tree, with the all-0 haplotype at the root, where each site

changes from 0 to 1 on exactly one edge, and each extant haplotype is created by accumulating the changes on a path from the root to a leaf, where that haplotype is displayed.

In other words, the extant haplotypes evolved along a perfect phylogeny with all-0 root.

Page 5: Haplotyping via Perfect Phylogeny

The Perfect Phylogeny Model

000001

2

4

3

510100

1000001011

00010

01010

12345sitesAncestral haplotype

Extant haplotypes at the leaves

Site mutations on edges

Page 6: Haplotyping via Perfect Phylogeny

Justification for Perfect Phylogeny Model

• In the absence of recombination each haplotype of any individual has a single parent, so tracing back the history of the haplotypes in a population gives a tree.

• Recent strong evidence for long regions of DNA with no recombination. Key to the NIH haplotype mapping project. (See NYT October 30, 2002)

• Mutations are rare at selected sites, so are assumed non-recurrent.

• Connection with coalescent models.

Page 7: Haplotyping via Perfect Phylogeny

The Haplotype Phylogeny Problem

Given a set of genotypes S, find an explaining set of haplotypes that fits a perfect phylogeny.

1 2a 2 2b 0 2c 1 0

sitesA haplotype pair explains agenotype if the merge of thehaplotypes creates thegenotype. Example: Themerge of 0 1 and 1 0 explains 2 2.

Genotype matrix

S

Page 8: Haplotyping via Perfect Phylogeny

The Haplotype Phylogeny Problem

Given a set of genotypes, find an explaining set of haplotypes that fits a perfect phylogeny

1 2a 2 2b 0 2c 1 0

1 2a 1 0a 0 1b 0 0b 0 1c 1 0c 1 0

Page 9: Haplotyping via Perfect Phylogeny

The Haplotype Phylogeny Problem

Given a set of genotypes, find an explaining set of haplotypes that fits a perfect phylogeny

1 2a 2 2b 0 2c 1 0

1 2a 1 0a 0 1b 0 0b 0 1c 1 0c 1 0

1

c c a a

b

b

2

10 10 10 01 01

00

00

Page 10: Haplotyping via Perfect Phylogeny

The Alternative Explanation

1 2a 2 2b 0 2c 1 0

1 2a 1 1a 0 0b 0 0b 0 1c 1 0c 1 0

No treepossiblefor thisexplanation

Page 11: Haplotyping via Perfect Phylogeny

When does a set of haplotypes to fit a perfect phylogeny?

Classic NASC: Arrange the haplotypes in a matrix, two haplotypes for each individual. Then (with no duplicate columns), the haplotypes fit a unique perfect phylogeny if and only if no two columns contain all three pairs:

0,1 and 1,0 and 1,1 This is the 3-Gamete Test

Page 12: Haplotyping via Perfect Phylogeny

The Alternative Explanation

1 2a 2 2b 0 2c 1 0

1 2a 1 1a 0 0b 0 0b 0 1c 1 0c 1 0

No treepossiblefor thisexplanation

Page 13: Haplotyping via Perfect Phylogeny

1 2a 2 2b 0 2c 1 0

1 2a 1 0a 0 1b 0 0b 0 1c 1 0c 1 0

1

c c a a

b

b

2

0 0

0 1 0 1

0 0

The Tree Explanation Again

Page 14: Haplotyping via Perfect Phylogeny

Solving the Haplotype Phylogeny Problem (PPH)

• Simple Tools based on classical Perfect Phylogeny Problem.

• Complex Tools based on Graph Realization Problem (graphic matroid realization).

Page 15: Haplotyping via Perfect Phylogeny

Simple Tools – treeing the 1’s1) For any row i in S, the set of 1 entries in row

i specify the exact set of mutations on the path from the root to the least common ancestor of the two leaves labeled i, in every perfect phylogeny for S.

2) The order of those 1 entries on the path is also the same in every perfect phylogeny for S, and is easy to determine by “leaf counting”.

Page 16: Haplotyping via Perfect Phylogeny

Leaf Counting

1 2 3 4 5 6 7a 1 0 1 0 0 0 0b 0 1 0 1 0 0 0c 2 2 0 0 2 0 2d 2 2 0 0 0 2 0

In any column c, count two for each 1, andcount one for each 2. The total is the number of leaves below mutation c, in every perfect phylogeny for S. So if we know the set ofmutations on a path from the root, we knowtheir order as well.

S

Count 4 4 2 2 1 1 1

Page 17: Haplotyping via Perfect Phylogeny

The Subtree of 1’s is ForcedThe columns of S with at least one 1 entry specify a unique upper subtree that must be in every perfect phylogeny for S.

1 2 3 4 5 6 7a 1 0 1 0 0 0 0b 0 1 0 1 0 0 0c 2 2 0 0 2 0 2d 2 2 0 0 0 2 0

S

143

2

a a b b

4 4 2 2 1 1 1

Page 18: Haplotyping via Perfect Phylogeny

Corollary: A Useful Sufficient Condition

If every column of S has at least one 1, then there is a unique perfect phylogeny for S, if there is any.

Build the forced tree based on the 1-entries, then every mutation (site) is in the tree, and any 2-entries dictate where the remaining leaves must be attached to the tree.

Page 19: Haplotyping via Perfect Phylogeny

What to do when the Corollary does not apply?

• Build the forced tree of 1-entries.• 2-entries in columns with 1-entries are

done.• Remaining problem: 2-entries in columns

without any 1-entries

Page 20: Haplotyping via Perfect Phylogeny

Uniqueness without 1’s

A 0 2 2B 2 2 0C 2 0 2

There are 8 haplotype solutionsthat can explain the data, butonly one that fits a perfect phylogeny, i.e. only one solutionto the PPH problem.

Page 21: Haplotyping via Perfect Phylogeny

More Simple Tools

3) For any row i in S, and any column c, if S(i,c) is 2, then in every perfect phylogeny for S, the path between the two leaves labeled i, must contain the edge with mutation c.

Further, every mutation c on the path between the two i leaves must be from such a column c.

Page 22: Haplotyping via Perfect Phylogeny

From Row Data to Tree Constraints

Root The order is known for the red mutations

1 2 3 4 5 6 7

i:0 1 0 2 2 1 2

i i

Subtree for row i data

4,5,7orderunknown

26

sites

Page 23: Haplotyping via Perfect Phylogeny

The Graph Theoretic Problem

Given a genotype matrix S with n sites, and a red-blue fork for each row i,

create a directed tree T where each integer from 1 to n labels exactly one edge, so that each fork is contained in T.i i

Page 24: Haplotyping via Perfect Phylogeny

Complex Tool: Graph Realization

• Let Rn be the integers 1 to n, and let P be an unordered subset of Rn. P is called a path set.

• A tree T with n edges, where each is labeled with a unique integer of Rn, realizes P if there is a contiguous path in T labeled with the integers of P and no others.

• Given a family P1, P2, P3…Pk of path sets, tree T realizes the family if it realizes each Pi.

• The graph realization problem generalizes the consecutive ones problem, where T is a path.

Page 25: Haplotyping via Perfect Phylogeny

Graph Realization Example

1

2 4

5

63

8

7

P1: 1, 5, 8P2: 2, 4P3: 1, 2, 5, 6 P4: 3, 6, 8P5: 1, 5, 6, 7

Realizing Tree T

Page 26: Haplotyping via Perfect Phylogeny

Graph Realization

Polynomial time (almost linear-time) algorithms exist for the graph realization problem – Whitney, Tutte, Cunningham, Edmonds, Bixby, Wagner, Gavril, Tamari, Fushishige.

The algorithms are not simple; no known

implementations.

Page 27: Haplotyping via Perfect Phylogeny

Recognizing graphic Matroids

• The graph realization problem is the same problem as determining if a binary matroid is graphic, and the algorithms come from that literature.

• The fastest algorithm is due to Bixby and Wagner (Math of OR, )

• Representation methods due to Cunningham et al.

Page 28: Haplotyping via Perfect Phylogeny

Reducing PPH to graph realization

We solve any instance of the PPH problem by creating appropriate path sets, so that a solution to the resulting graph realization problem leads to a solution to the PPH problem instance.

The key issue: How to encode a fork by path sets.

Page 29: Haplotyping via Perfect Phylogeny

From Row Data to Tree Constraints

Root The order is known for the red mutations

1 2 3 4 5 6 7

i:0 1 0 2 2 1 2

i i

Subtree for row i data

4,5,7orderunknown

26

sites

Page 30: Haplotyping via Perfect Phylogeny

Encoding a Red path, named g257

P1: U, 2P2: U, 2, 5P3: 2, 5P4: 2, 5, 7P5: 5, 7P6: 5, 7, gP7: 7, g

257

g

U

U is a universal glue edge, used for all red paths.g is used for all red paths identical to this one – i.e.different forks with the identical red path.

forcedIn T

Page 31: Haplotyping via Perfect Phylogeny

Encoding and gluing a blue pathFor a specific blue path, simply specify a singlepath set containingthe integers in the blue path. However, we need toforce that path to be glued to the end of a specificred path g, or to the root of T.

In the first case, just add g to the path set. In the second case, add U to the path set.

Page 32: Haplotyping via Perfect Phylogeny

Encoding and gluing a blue path to the end of red path g

257

4, 9, 18, 20

g

P: g, 4, 9, 18, 20

Page 33: Haplotyping via Perfect Phylogeny

After the Reduction

After all the paths are given to the graph realization algorithm, and a realizing tree T is obtained (assuming one is), contract all the glue edges to obtain a perfect phylogeny for the original haplotyping problem (PPH) instance.

Conversely, any solution can be obtained in this way.

Page 34: Haplotyping via Perfect Phylogeny

Uniqueness In 1932, Whitney established the NASC for the

uniqueness of a solution to a graph realization problem:

Let T be the tree realizing the family of required path sets. For each path set Pi in the family, add an edge in T between the ends of the path realizing Pi. Call the result graph G(T).

T is the unique realizing tree, if and only if G(T) is 3-vertex connected. e.g., G(T) remains

connected after the removal of any two vertices.

Page 35: Haplotyping via Perfect Phylogeny

Uniqueness of PPH Solution

• Apply Whitney’s theorem, using all the paths implied by the reduction of the PPH problem to graph realization.

• (Minor point) Do not allow the removal of the endpoints of the universal glue edge U.

Page 36: Haplotyping via Perfect Phylogeny

Multiple Solutions

• In 1933, Whitney showed how multiple solutions to the graph realization problem are related.

• Partition the edges of G into two, connected graphs, each with at least two edges, such that the two graphs have exactly two nodes in common. Then twist one graph around those nodes.

• Any solution can be transformed to another via a series of such twists.

Page 37: Haplotyping via Perfect Phylogeny

Twisting Example

x y x y1

23

45

6

78

12

3

4

5 67

8

All the cycle sets are preserved by twisting

Page 38: Haplotyping via Perfect Phylogeny

Representing all the solutions

All the solutions to the PPH problem can be implicitly represented in a data structure whichcan be built in linear time, once one solution isknown. Then each solution can be generated inlinear time per solution. Method is a smallmodification of ones developed by Cunninghamand Edwards, and by Hopcroft and Tarjan.

See Gusfield’s web site for errata.