Local genetic ethnicity determination system
A hidden Markov model-based system addresses the challenge of assigning genetic labels by building probabilistic models to determine haplotype pairs, achieving efficient and accurate labeling of input genotypes.
Patent Information
- Application Number
- CA2992397
- Authority / Receiving Office
- CA · CA
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2015-07-13
- Filing Date
- 2016-07-13
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2036-07-13
AI Technical Summary
Existing SNP genotyping methods fail to accurately identify which allele corresponds to which haplotype, leading to unordered pairs of alleles and difficulty in determining genetic labels such as ethnicity, especially in admixed genotypes.
A computer-implemented system using hidden Markov models, including diploid and inter-window HMMs, to assign labels to input sample genotypes by building probabilistic models based on SNP sequences, calculating label pair probabilities, and updating models with assigned labels for improved accuracy.
The system efficiently and accurately assigns genetic labels, particularly ethnicity, to input sample genotypes, improving accuracy over time through model updates.
Abstract
Description
LOCAL GENETIC ETHNICITY DETERMINATION SYSTEM Inventors: Keith D. Noto; Yong Wang CROSS REFERENCE TO RELATED APPLICATIONS
[0001] This application claims the benefit of U.S. Patent Application No. 62 / 191,968, filed July 13, 2015. FIELD
[0002] The disclosed embodiments relate to assigning labels to an input sample genotype. In particular, the disclosed embodiments relate to using hidden Markov models that efficiently and accurately determine labels for the input sample genotype. BACKGROUND
[0003] Although humans are, genetically speaking, almost entirely identical, small differences in human DNA are responsible for much of the variation between individuals. For example, a sequence variation at one position in DNA between individuals is known as a single-nucleotide polymorphism (SNP). Stretches of DNA inherited together from a single parent are referred to as haplotypes (e.g., one haplotype inherited from the mother and another haplotype inherited from the father).
[0004] A subset of the SNPs in an individual's genome may be detected with SNP genotyping. Through SNP genotyping, the pair of alleles for a SNP at a given location in each haplotype may be identified. For example, an SNP may be identified as heterozygous (i.e., one allele of each type), homozygous (i.e., both alleles of a same type), or unknown. SNP genotyping identifies the pair of alleles for a given genotype, but does not identify which allele corresponds to which haplotype, i.e., SNP genotyping does not identify the homomorphic chromosome (of the homomorphic pair) to which each allele corresponds. Thus, successful SNP genotyping produces an unordered pair of alleles, where each allele corresponds to one of two haplotypes.
[0005] In general, most of the SNPs of a haplotype that correspond to a particular chromosome are sourced from a single chromosome from a parent. However, some of the SNPs from the haplotype may correspond to the parent's other homomorphic chromosome due to chromosomal crossover. Because the genetic information in a particular chromosome of an individual mostly corresponds to a single chromosome of a parent, sequences of SNPs tend to stay relatively intact across generations. SUMMARY
[0006] The computer-implemented system and method described herein assign to an input sample genotype one or more labels from a set of labels by comparing sequences of SNPs of the input sample genome those of reference sample genomes that correspond to the labels. Labels may be, for example, ethnicity labels indicating an ancestral origin group. Labels are assigned to the input sample genotype by building two types of hidden Markov models (HMMs): diploid HMMs and an inter- window HMM. Each diploid HMM is based on the SNPs in a window of one of the chromosomes of the input sample genotype. The diploid HMMs may be used to build an inter-window HMM that includes a set of states corresponding to each window across the chromosomes of the input sample genotype.
[0007] The diploid HMM is built by accessing the input sample genotype from a memory and dividing it into a number of windows, where each window includes a sequence of SNPs from the input sample genotype. A diploid HMM is built for each window based on the sequence of SNPs in that window. Each diploid state in a diploid HMM for a window may correspond to a pair of haploid states for the window, where each haploid state is from a haploid Markov model (MM). The haploid MM is a probabilistic model of a haplotype for the window. For each diploid state in a diploid HMM of a window, a diploid state probability indicating the likelihood that the input sample genotype corresponds to the diploid state is calculated.
[0008] For each window, a label pair probability distribution may be calculated based on the annotations for the window and the diploid state probabilities of the input sample genome for the diploid HMM of the window. The label pair probability distribution for a window may map each pair of labels (one label for each of two constituent haplotypes for a window) to the probability that the SNPs in the window correspond to the pair of labels. A set of annotations may be accessed, each annotation corresponding to a haploid state from a window and a label from the set of labels, where the labels include the origin groups under consideration. An annotation for a haploid state indicates the probability that a haplotype of the label (e.g., a haplotype for an individual in the origin group correspond to the label) corresponds to that haploid state. Each annotation for a label may be calculated from a set of reference samples that correspond to the labels.
[0009] An inter-window HMM may be built based on the label pair probability distributions. The inter-window HMM may include a set of states for each window, where each state in a window corresponds to a pair of labels. The transition probabilities of the inter-window HMM may be learned based on the expectation-maximization. The inter-window HMM may use the label pair probability distribution for a window as the probability distribution for each state in the window given the SNPs of the input sample genotype in the window. Based on the inter-window HMM, one or more labels may be assigned to the input sample genotype. Assigning labels may include determining a proportion of the input sample genotype that corresponds to each label, may include calculation of a Viterbi path for the inter-window HMM, and may additionally or alternatively include calculating a plurality of stochastic paths for the inter-window HMM. In some embodiments, the inter-window HMM for an input sample genotype may be used to update the annotations for use in assigning labels to other genotypes.
[0010] Compared to existing methods for assigning labels to potentially admixed genotypes, the disclosed system and methods assigns labels to a genotype quickly and accurately. The disclosed method may also update the models and / or annotations based on the genotypes which labels have been assigned to, so that the accuracy of the system improves over time. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] These and other features, aspects, and advantages of the present invention will become better understood with regard to the following description, and accompanying drawings, where:
[0012] FIG. 1 is a block diagram of a label determination system for training and utilizing a model for assigning labels to a genotype, according to one embodiment.
[0013] FIG. 2 is an example of a haplotype MM, according to an embodiment.
[0014] FIG. 3 is an example of a diploid HMM, according to an embodiment.
[0015] FIG. 4 is an example of an inter-window HMM, according to an embodiment.
[0016] FIG. 5 is a flowchart illustrating a method for calculating annotations, according to some embodiments.
[0017] FIG. 6 is a flowchart illustrating a method for assigning labels to a genotype, according to some embodiments.
[0018] FIG. 7 is a flow diagram for assigning labels to a genotype based on a model and updating the model based on the labels assigned to the genotype, according to one embodiment.
[0019] Note that for purposes of clarity, only one of each item corresponding to a reference numeral is included in most figures, but when implemented multiple instances of any or all of the depicted modules may be employed, as will be appreciated by those of skill in the art. DETAILED DESCRIPTION Genetic Data Collection
[0020] Individuals may provide deoxyribonucleic acid (DNA) samples (e.g., saliva, skin cells, blood, or other biological matter) for analysis of their genetic data. In one embodiment, an individual uses a sample collection kit to provide a sample from which genetic data can be reliably extracted according to conventional methods. A DNA extraction service can receive the sample and genotype the genetic data, for example by extracting the DNA from the sample and identifying values of SNPs present within the DNA. The result is a diploid genotype. A DNA quality control and matching preparation service may assesses data quality of the diploid genotype by checking various attributes such as genotyping call rate, genotyping heterozygosity rate, and agreement between genetic and self- reported gender. The genotype data (referred to herein as a genotype) is sent (e.g., transmitted through a network) to a label determination system 100. The label determination may receive the genotype from the DNA extraction service or from the DNA quality control and matching preparation service and may store the genotype (e.g., in a database).
[0021] Genotypes may be received that includes L SNPs. Since most SNPs manifest as one of two possible allelic variations within a population (e.g., an SNP may be adenine (A) in some individuals, but cytosine (C) in others), an allele for a particular SNP of a genotype may be referenced by either 0 or 1 (e.g., 0 for A and 1 for C) without loss of generality. Furthermore, although described herein are as using biallelic SNPs (i.e., SNPs that can take on two possible alleles), the methods and systems described herein may be generalized to include multiallelic SNPs (e.g., triallelic SNPs). Additionally, instead of using individual alleles as the basic unit of genomic data, the methods and systems herein may use "mini haplotypes" consisting of multiple alleles as the basic units of data.
[0022] A pair of alleles for an SNP in a genotype may be received without information indicating the homomorphic chromosome to which each allele corresponds. Thus, genotyping may result in a sequence of L SNPs, each of which contains a unordered pair of values: <com:Math><semantics>(0,0)<annotation encoding="application / x-tex">(0,0)< / annotation>< / semantics>< / com:Math> (i.e., homozygous 0), (0,1) (i.e., heterozygous), or (1,1) (i.e., homozygous 1). In some instances, genotyping a particular SNP fails, in which case the alleles for that SNP may be missing. Herein, a genotype may be represented as <com:Math><semantics>G=(G1,G2,...,GL)<annotation encoding="application / x-tex">G = (G_1, G_2, ..., G_L)< / annotation>< / semantics>< / com:Math>, where each <com:Math><semantics>Gi<annotation encoding="application / x-tex">G_i< / annotation>< / semantics>< / com:Math> (for <com:Math><semantics>i∈{1,...,L}<annotation encoding="application / x-tex">i \in \{1, ..., L\}< / annotation>< / semantics>< / com:Math>) is an SNP that has a value of either <com:Math><semantics>(0,0)<annotation encoding="application / x-tex">(0,0)< / annotation>< / semantics>< / com:Math>, <com:Math><semantics>(0,1)<annotation encoding="application / x-tex">(0,1)< / annotation>< / semantics>< / com:Math>, <com:Math><semantics>(1,1)<annotation encoding="application / x-tex">(1,1)< / annotation>< / semantics>< / com:Math>, or missing data. The label determination system may store and use genotypes such as a input sample genotype X that labels are assigned to and reference panel sample genomes for a label that are used to calculate an annotation for that label.
[0023] A genotype G may be divided in W windows, where each window w (for <com:Math><semantics>w∈{1,...,W}<annotation encoding="application / x-tex">w \in \{1,...,W\}< / annotation>< / semantics>< / com:Math>) is a sequence of SNPs (i.e., a subsequence of G). The windows may overlap (i.e., share one or more SNPs). The bounds of each window are such that no window w includes SNPs from more than one chromosome (i.e., from more than one pair of homomorphic chromosomes). Each window w may start at SNP index <com:Math><semantics>Sw<annotation encoding="application / x-tex">S_w< / annotation>< / semantics>< / com:Math> and have a length of <com:Math><semantics>Dw<annotation encoding="application / x-tex">D_w< / annotation>< / semantics>< / com:Math>. Thus, the sequence of SNPs of the genotype G in window w is <com:Math><semantics>(GSw,...,G(Sw+Dw−1))<annotation encoding="application / x-tex">(G_{S_w}, ..., G_{(S_w + D_w - 1)})< / annotation>< / semantics>< / com:Math>. The length <com:Math><semantics>Dw<annotation encoding="application / x-tex">D_w< / annotation>< / semantics>< / com:Math> of each window w may be selected so that each haplotype in the window w is likely to correspond to a single respective correct label. For example, the length <com:Math><semantics>Dw<annotation encoding="application / x-tex">D_w< / annotation>< / semantics>< / com:Math> of each window w may be selected so as to have a length of 1-10 centimorgans (cM) or less.
[0024] A input sample genome X can be assigned one or more labels by a label determination system. Each window w of the genotype G may be assigned a pair of labels from a set of K labels, one label for each haplotype in the genome G. A label is an identification of some group of haplotypes that are genetically similar. For example, a label corresponds to ancestry from a historical population (e.g., ethnic group). For example, each ethnic group and corresponding label may correspond to a geographic area which the given population historically inhabited. Examples include areas such as North Africa, Scandinavia, South Asia, etc. System Overview
[0025] FIG. 1 is a block diagram of a label determination system for training and utilizing a model to assign labels to a genotype, according to one embodiment. The label determination system 100 trains and uses models to probabilistically determine the labels to which an input genotype sample corresponds. The label determination system 100 may be a computing system including one or more processors, one or more computer memories, and an interface for communicating through a network. In one example embodiment, the label determination system 100 includes a haploid MM store 110, a reference panel sample store 115, a diploid HMM store 120, an annotation store 125, a genotype store 130, an inter-window HMM store 135, a haploid MM module 140, a diploid HMM module 150, an inter-window HMM module 160, a label assignment module 170, and phasing module 180.
[0026] In some embodiments, the label determination system 100 may operate in a training stage and a label assignment stage. The training stage may be performed once to build haploid MMs for each window w stored in the haploid MM store 110 and calculate the annotations stored in the annotation store 125 for each label k and window w. The training stage is not based on a particular input sample genotype. After the training stage, the label determination system 100 may assign labels to an input sample genotype X during the label assignment stage. Assigning labels to an input sample genotype X uses the haploid MMs and the annotations initialized during the training phrase. After the training stage has been performed once, labels may be continuously assigned to different input sample genotypes. Haploid Markov Model
[0027] The haploid MM store 110 stores a haploid MM for each window w. The haploid MM module 140 builds the haploid MMs based on training data (e.g., sequenced haplotypes and / or phased haplotypes) during the training stage. The haploid MMs In alternate embodiments, the haploid MMs may be received from another system (e.g., through a network). Each haploid MM is a probabilistic model of alleles in a respective window w. The haploid MM for a window w is a directed acyclic graph with a finite number of haploid states. Each directed edge between two haploid states in the haploid MM is referred to herein as a "transition" and corresponds to the value of an allele in a haplotype. Therefore, every possible haplotype (i.e., sequence of alleles) in the window w corresponds to a path (i.e., sequence of haploid states) through the haploid MM corresponding to window w. The states in a haploid MM, the transitions between them, and the probabilities of those transitions are determined by the haploid MM module 140 based on the training data. In some embodiments, a haploid MM may be a model used with a HMM phasing algorithm.
[0028] FIG. 2 illustrates an example of a haploid MM 200 for a window w, according to one embodiment. FIG. 2 illustrates the haploid MM for window w as a directed graph, where arrows represent transitions between states. The haploid MM is divided into <com:Math><semantics>Dw+1<annotation encoding="application / x-tex">D_w + 1< / annotation>< / semantics>< / com:Math> levels (i.e., the haploid MM includes one more level than the number <com:Math><semantics>Dw<annotation encoding="application / x-tex">D_w< / annotation>< / semantics>< / com:Math> of SNPs in the window w). That is, each state in the model corresponds to some level <com:Math><semantics>d∈{0,...,Dw+1}<annotation encoding="application / x-tex">d \in \{0, ..., D_w + 1\}< / annotation>< / semantics>< / com:Math>. Each level d in the window w includes <com:Math><semantics>hw,d<annotation encoding="application / x-tex">h_{w,d}< / annotation>< / semantics>< / com:Math> states. Each state u in the haploid MM may be referenced by the combination of its level d and an index n (for <com:Math><semantics>n∈{0,...,hw.d−1}<annotation encoding="application / x-tex">n \in \{0, ..., h_{w.d} - 1\}< / annotation>< / semantics>< / com:Math>), although states may be references with an alternate referencing scheme. In FIG. 2, the index <com:Math><semantics>n<annotation encoding="application / x-tex">n< / annotation>< / semantics>< / com:Math> of each state <com:Math><semantics>u<annotation encoding="application / x-tex">u< / annotation>< / semantics>< / com:Math> is the integer with which the state is labeled. Herein, <com:Math><semantics>u(w,d,n)<annotation encoding="application / x-tex">u(w,d,n)< / annotation>< / semantics>< / com:Math> references the nth state at level d in window w. Thus, the start state is <com:Math><semantics>𝕊w=u(w,0,0)<annotation encoding="application / x-tex">\mathbb{S}_w = u(w,0,0)< / annotation>< / semantics>< / com:Math> and the end state is <com:Math><semantics>𝔼w=u(w,Dw,0)<annotation encoding="application / x-tex">\mathbb{E}_{w} = u(w, D_{w}, 0)< / annotation>< / semantics>< / com:Math>.
[0029] A haploid MM 200 includes one start state <com:Math><semantics>𝕊w<annotation encoding="application / x-tex">\mathbb{S}_w< / annotation>< / semantics>< / com:Math> at level 0 and one end state <com:Math><semantics>𝔼w<annotation encoding="application / x-tex">\mathbb{E}_w< / annotation>< / semantics>< / com:Math> at level <com:Math><semantics>Dw<annotation encoding="application / x-tex">D_w< / annotation>< / semantics>< / com:Math>. Besides the end state <com:Math><semantics>𝔼w<annotation encoding="application / x-tex">\mathbb{E}_w< / annotation>< / semantics>< / com:Math> at level <com:Math><semantics>Dw<annotation encoding="application / x-tex">D_w< / annotation>< / semantics>< / com:Math> which is a terminal node, each state at level d can include outgoing transitions to either one or two states at level <com:Math><semantics>d+1<annotation encoding="application / x-tex">d+1< / annotation>< / semantics>< / com:Math>. The transition between a state at level <com:Math><semantics>d−1<annotation encoding="application / x-tex">d-1< / annotation>< / semantics>< / com:Math> to a second state in level d corresponds to the dth allele in window w of a haplotype. In FIG. 2, the allele value of a haplotype corresponding to the transition between two states is illustrated by the number (either 0 or 1) on the arrow between the states. For example, the transition from the start state <com:Math><semantics>𝕊w<annotation encoding="application / x-tex">\mathbb{S}_{w}< / annotation>< / semantics>< / com:Math> to <com:Math><semantics>u(w,1,0)<annotation encoding="application / x-tex">u(w,1,0)< / annotation>< / semantics>< / com:Math> (i.e., the state at level 1 with index number <com:Math><semantics>n=0<annotation encoding="application / x-tex">n=0< / annotation>< / semantics>< / com:Math>) corresponds to an allele of 0 at the first SNP position in window w and the transition from the start state <com:Math><semantics>𝕊w<annotation encoding="application / x-tex">\mathbb{S}_w< / annotation>< / semantics>< / com:Math> to <com:Math><semantics>u(w,1,1)<annotation encoding="application / x-tex">u(w,1,1)< / annotation>< / semantics>< / com:Math> (i.e., the state at level 1 with index number <com:Math><semantics>n=1<annotation encoding="application / x-tex">n = 1< / annotation>< / semantics>< / com:Math>) may correspond to an allele of 1 at that SNP position. As indicated by FIG. 2, in this example, the transition probability between the start state <com:Math><semantics>Sw<annotation encoding="application / x-tex">S_w< / annotation>< / semantics>< / com:Math> and <com:Math><semantics>u(w,1,0)<annotation encoding="application / x-tex">u(w,1,0)< / annotation>< / semantics>< / com:Math> is 0.56 and the transition probability between <com:Math><semantics>Sw<annotation encoding="application / x-tex">S_w< / annotation>< / semantics>< / com:Math> and <com:Math><semantics>u(w,1,1)<annotation encoding="application / x-tex">u(w,1,1)< / annotation>< / semantics>< / com:Math> is <com:Math><semantics>1−0.56=0.44<annotation encoding="application / x-tex">1 - 0.56 = 0.44< / annotation>< / semantics>< / com:Math>.
[0030] The transition function <com:Math><semantics>t(u,a)<annotation encoding="application / x-tex">t(u,a)< / annotation>< / semantics>< / com:Math> maps the haploid state <com:Math><semantics>u<annotation encoding="application / x-tex">u< / annotation>< / semantics>< / com:Math> in the haploid MM for window <com:Math><semantics>w<annotation encoding="application / x-tex">w< / annotation>< / semantics>< / com:Math> at level d-1 to the haploid state at level d that u transitions to when the dth allele in window w is equal to <com:Math><semantics>a∈{0,1}<annotation encoding="application / x-tex">a \in \{0,1\}< / annotation>< / semantics>< / com:Math>. Thus, in the example of FIG. 2, <com:Math><semantics>t(u(w,2,0),0)<annotation encoding="application / x-tex">t(u(w,2,0),0)< / annotation>< / semantics>< / com:Math> may map to haploid state <com:Math><semantics>u(w,3,0)<annotation encoding="application / x-tex">u(w,3,0)< / annotation>< / semantics>< / com:Math> and <com:Math><semantics>t(u(w,2,0),1)<annotation encoding="application / x-tex">t(u(w,2,0),1)< / annotation>< / semantics>< / com:Math> may map to haploid state <com:Math><semantics>u(w,3,1)<annotation encoding="application / x-tex">u(w,3,1)< / annotation>< / semantics>< / com:Math>. When a haploid state u at level d-1 transitions to two distinct states (i.e., when <com:Math><semantics>t(u,0)≠t(u,1)<annotation encoding="application / x-tex">t(u,0) \neq t(u,1)< / annotation>< / semantics>< / com:Math>), each of the transitions is mapped to the dth allele in the window w. Herein, <com:Math><semantics>ρ(u,a)<annotation encoding="application / x-tex">\rho(u,a)< / annotation>< / semantics>< / com:Math> refers to the probability that a haplotype which is in state u at level d-1 in window w has an allele with a value of a at the dth SNP in the window w. Thus, <com:Math><semantics>ρ(u(w,2,1),0)=0.9<annotation encoding="application / x-tex">\rho(u(w,2,1),0) = 0.9< / annotation>< / semantics>< / com:Math> and <com:Math><semantics>ρ(u(w,2,1),1)=0.1<annotation encoding="application / x-tex">\rho(u(w,2,1),1) = 0.1< / annotation>< / semantics>< / com:Math>. If the state u transitions to only one state v at level d, then the haploid MM may still include a probability distribution for the dth allele even though the state transition is deterministic. For example, as illustrated in FIG. 2, the transition from state <com:Math><semantics>u(w,2,2)<annotation encoding="application / x-tex">u(w,2,2)< / annotation>< / semantics>< / com:Math> to state <com:Math><semantics>u(w,3,4)<annotation encoding="application / x-tex">u(w,3,4)< / annotation>< / semantics>< / com:Math> may associate a probability of 0.75 with allele 0 at the third SNP in the window w and a probability of 0.25 for allele 1 at the third SNP in the window w.
[0031] Each path through the haploid MM 200 corresponds to one or more possible sequences of alleles (for example, that may occur in the input sample genotype X). The probability of a sequence of alleles is given by the product of the corresponding allele probabilities in the corresponding path. For example, a path that includes the sequence of state (<com:Math><semantics>𝕊w<annotation encoding="application / x-tex">\mathbb{S}_w< / annotation>< / semantics>< / com:Math>, <com:Math><semantics>𝒖(w,1,1)<annotation encoding="application / x-tex">\mathbf{u}(w,1,1)< / annotation>< / semantics>< / com:Math>, <com:Math><semantics>𝒖(w,2,1)<annotation encoding="application / x-tex">\mathbf{u}(w,2,1)< / annotation>< / semantics>< / com:Math>, <com:Math><semantics>𝒖(w,3,3)<annotation encoding="application / x-tex">\mathbf{u}(w,3,3)< / annotation>< / semantics>< / com:Math>) corresponds to the sequence of alleles <com:Math><semantics>(1,1,1)<annotation encoding="application / x-tex">(1,1,1)< / annotation>< / semantics>< / com:Math> which has a probability of <com:Math><semantics>ρ(𝕊w,1)×ρ(u(w,1,1),1)×ρ(u(w,2,1),1)=<annotation encoding="application / x-tex">\rho(\mathbb{S}_w,1)\times\rho(u(w,1,1),1)\times\rho(u(w,2,1),1)=< / annotation>< / semantics>< / com:Math> 0.022. The possible haplotypes (or, equivalently, every possible sequence of alleles) correspond to different paths in the haploid MM. Each path corresponding to a possible haplotype begins at the start state <com:Math><semantics>𝕊w<annotation encoding="application / x-tex">\mathbb{S}_w< / annotation>< / semantics>< / com:Math>, includes exactly one state for each level d, and ends at the end state <com:Math><semantics>𝔼w<annotation encoding="application / x-tex">\mathbb{E}_w< / annotation>< / semantics>< / com:Math>. Diploid Hidden Markov Model
[0032] Returning to FIG. 1, the diploid HMM store 120 stores a diploid HMM for each window w. The diploid HMM module 150 may build these diploid HMMs based on the haploid MMs stored in the haploid MM store 110. Each diploid state in the diploid HMM for window w corresponds to an ordered pair of haploid states (i.e., one haploid state for each of the two haplotype that constitute a genome) in the haploid MM 200 for window w. Thus each diploid state <com:Math><semantics>(u1,u2)<annotation encoding="application / x-tex">(u_1, u_2)< / annotation>< / semantics>< / com:Math> in the diploid HMM at level d corresponds to the haploid states <com:Math><semantics>u1<annotation encoding="application / x-tex">u_1< / annotation>< / semantics>< / com:Math> and <com:Math><semantics>u2<annotation encoding="application / x-tex">u_2< / annotation>< / semantics>< / com:Math>, where <com:Math><semantics>u1<annotation encoding="application / x-tex">u_1< / annotation>< / semantics>< / com:Math> and <com:Math><semantics>u2<annotation encoding="application / x-tex">u_2< / annotation>< / semantics>< / com:Math> are from level d. For example, the start state of the diploid HMM for window w is <com:Math><semantics>(u(w,0,0),u(w,0,0))=(𝕊w,𝕊w)<annotation encoding="application / x-tex">(u(w,0,0), u(w,0,0)) = (\mathbb{S}_w,\mathbb{S}_w)< / annotation>< / semantics>< / com:Math>.
[0033] In some embodiments, the diploid HMM store 120 stores a full HMM for each window w. A full diploid HMM for window w includes, for a level d, a diploid state for every ordered pair of haploid states in the haploid MM 200 at level d. Full diploid HMMs may be calculated during the training stage. The diploid HMM store may also include diploid HMMs that correspond to particular genotypes. The diploid HMM for a particular genotype <com:Math><semantics>G<annotation encoding="application / x-tex">G< / annotation>< / semantics>< / com:Math> (e.g., an input sample genotype <com:Math><semantics>X<annotation encoding="application / x-tex">X< / annotation>< / semantics>< / com:Math> or a reference panel sample genome for a label k) in window w may include all the possible diploid states that are compatible with the genotype G and the possible transitions for genotype G. Diploid HMMs may be built for the input sample genome X by the diploid HMM module 150 during the label assignment stage. Diploid HMMs may be also be built by the diploid HMM module for the reference panel sample genomes stored in the reference panel sample store 115 during the training stage when calculating the annotations in the annotation store 125. In general, the diploid HMM for window w for a genotype G includes fewer states than the full diploid HMM for window w, because many diploid states in the full diploid HMM will not be compatible with the genotype G.
[0034] In some embodiments, the diploid HMM for a genotype G for a window w is built based on the full diploid HMM for the window w. In alternate embodiments, the diploid HMM module 150 does not build full diploid HMMs and no full diploid HMMs are stored in the diploid HMM store 120. Instead, the diploid HMM module may build diploid HMMs for genotypes for each window w based on the corresponding haploid MM for window w.
[0035] FIG. 3 is an example of a diploid HMM 300 for a window w, according to an embodiment. The diploid HMM illustrated in FIG. 3 is a fully-instantiated diploid HMM. For this reason, the number of diploid states at each level d for window w is equal to the square of the number of states in the corresponding haploid MM 200 at level d (i.e., <com:Math><semantics>(hw,d)2<annotation encoding="application / x-tex">(h_{w,d})^2< / annotation>< / semantics>< / com:Math>). For a genotype sequence made up of haplotypes that correspond to a diploid state <com:Math><semantics>(u1,u2)<annotation encoding="application / x-tex">(u_1,u_2)< / annotation>< / semantics>< / com:Math> at level <com:Math><semantics>d−1<annotation encoding="application / x-tex">d-1< / annotation>< / semantics>< / com:Math> in a window <com:Math><semantics>w<annotation encoding="application / x-tex">w< / annotation>< / semantics>< / com:Math>, the probability that the dth genotype in the window w is the ordered pair <com:Math><semantics>(a1,a2)<annotation encoding="application / x-tex">(a_1,a_2)< / annotation>< / semantics>< / com:Math> equals <com:Math><semantics>ρ(u1,a1)×ρ(u2,a2)<annotation encoding="application / x-tex">\rho(u_1,a_1) \times \rho(u_2,a_2)< / annotation>< / semantics>< / com:Math>. The number of possible transitions from a diploid state <com:Math><semantics>(u1,u2)<annotation encoding="application / x-tex">(u_1,u_2)< / annotation>< / semantics>< / com:Math> is equal to the number of possible transitions from <com:Math><semantics>u1<annotation encoding="application / x-tex">u_1< / annotation>< / semantics>< / com:Math> in the haploid MM multiplied by the number of possible transitions from <com:Math><semantics>u2<annotation encoding="application / x-tex">u_2< / annotation>< / semantics>< / com:Math>.
[0036] FIG. 3 depicts an example diploid HMM 300 that corresponds to the example haploid MM 200 depicted in FIG. 2. In FIG. 2, each diploid state in the diploid HMM is labeled with a pair of index numbers <com:Math><semantics>(n,m)<annotation encoding="application / x-tex">(n,m)< / annotation>< / semantics>< / com:Math> corresponding to the indices of the corresponding pair of haploid states in the haploid MM. For example, the diploid state labeled (1,2) at level 2 in FIG. 3 represents the diploid state <com:Math><semantics>(u(w,2,1),u(w,2,2))<annotation encoding="application / x-tex">(u(w,2,1),u(w,2,2))< / annotation>< / semantics>< / com:Math> where haploid states <com:Math><semantics>u(w,2,1)<annotation encoding="application / x-tex">u(w,2,1)< / annotation>< / semantics>< / com:Math> and <com:Math><semantics>u(w,2,2)<annotation encoding="application / x-tex">u(w,2,2)< / annotation>< / semantics>< / com:Math> are from the haploid MM 200 of FIG. 2.
[0037] Because every genotype corresponds to two haplotypes, each phased genotype corresponds to a single path through the diploid HMM 300 for window w. However, because the SNPs in unphased genotypes do not associate alleles with particular haplotypes, the exact path through the diploid HMM that a genotype traverses will likely be ambiguous as the genotype will likely include a number of heterozygous SNPs and possibly missing data for SNPs as well. For example, the sequence of unordered allele pairs <com:Math><semantics>((0,1),(0,1))<annotation encoding="application / x-tex">((0,1),(0,1))< / annotation>< / semantics>< / com:Math> corresponds to four distinct paths through the first three levels of the example diploid HMM for window w such as the sequence of diploid states <com:Math><semantics>((𝕊w,𝕊w),(u(w,1,0),u(w,1,1)),(u(w,2,1),u(w,2,2))).<annotation encoding="application / x-tex">((\mathbb{S}_w, \mathbb{S}_w), (u(w,1,0), u(w,1,1)), (u(w,2,1), u(w,2,2))).< / annotation>< / semantics>< / com:Math>
[0038] Various modifications may be made to the diploid HMM 300 as described above. For example, because the probability of transition from diploid state <com:Math><semantics>(u1,u2)<annotation encoding="application / x-tex">(u_1,u_2)< / annotation>< / semantics>< / com:Math> to diploid state <com:Math><semantics>(u3,u4)<annotation encoding="application / x-tex">(u_3,u_4)< / annotation>< / semantics>< / com:Math> is equivalent to the probability of the transition from <com:Math><semantics>(u2,u1)<annotation encoding="application / x-tex">(u_2,u_1)< / annotation>< / semantics>< / com:Math> to <com:Math><semantics>(u4,u3)<annotation encoding="application / x-tex">(u_4,u_3)< / annotation>< / semantics>< / com:Math>, diploid states in an diploid HMM may be collapsed / reduced into states representing unordered pairs. This reduces both the computer processing time required and the complexity of the calculation.
[0039] The diploid HMM module 150 calculates a label pair probability distribution <com:Math><semantics>EX,w<annotation encoding="application / x-tex">E_{X,w}< / annotation>< / semantics>< / com:Math> for each window w for a input sample genotype X. The label pair probability distribution <com:Math><semantics>EX,w<annotation encoding="application / x-tex">E_{X,w}< / annotation>< / semantics>< / com:Math> includes a label pair probability <com:Math><semantics>EX,w(p,q)<annotation encoding="application / x-tex">E_{X,w}(p,q)< / annotation>< / semantics>< / com:Math> for each unordered pair of labels <com:Math><semantics>(p,q)<annotation encoding="application / x-tex">(p,q)< / annotation>< / semantics>< / com:Math>. The label pair probability distribution <com:Math><semantics>EX,w(p,q)<annotation encoding="application / x-tex">E_{X,w}(p,q)< / annotation>< / semantics>< / com:Math> is a metric indicating the agreement between the input sample genome X and the annotations for the label pair <com:Math><semantics>(p,q)<annotation encoding="application / x-tex">(p,q)< / annotation>< / semantics>< / com:Math>. For each window w of a input sample genotype X and each pair of labels <com:Math><semantics>(p,q)<annotation encoding="application / x-tex">(p,q)< / annotation>< / semantics>< / com:Math>, the calculated label pair probability <com:Math><semantics>EX,w(p,q)<annotation encoding="application / x-tex">E_{X,w}(p,q)< / annotation>< / semantics>< / com:Math> is equal to or proportional to the probability of the input sample genotype X in the window w given that the haplotypes of the genome in window w correspond to the pair of labels <com:Math><semantics>(p,q)<annotation encoding="application / x-tex">(p,q)< / annotation>< / semantics>< / com:Math>. In some embodiments, the label pair probability distribution <com:Math><semantics>EX,w(p,q)<annotation encoding="application / x-tex">E_{X,w}(p,q)< / annotation>< / semantics>< / com:Math> is normalized so that the summation of the distribution is the same for each window (e.g., <com:Math><semantics>EX,w(p,q)<annotation encoding="application / x-tex">E_{X,w}(p,q)< / annotation>< / semantics>< / com:Math> may be a normalized probability such that <com:Math><semantics>∑p=1K∑q=pKEX,w(p,q)=1<annotation encoding="application / x-tex">\sum_{p=1}^K \sum_{q=p}^K E_{X,w}(p,q) = 1< / annotation>< / semantics>< / com:Math>) In some embodiments, the label pair probability distribution <com:Math><semantics>EX,w<annotation encoding="application / x-tex">E_{X,w}< / annotation>< / semantics>< / com:Math> is based on the SNPs in window w of the genotype X but not on SNPs of the genotype X outside of window w. The label pair probability distribution <com:Math><semantics>EX,w<annotation encoding="application / x-tex">E_{X,w}< / annotation>< / semantics>< / com:Math> may be based on an diploid HMM for the window w and the input sample genotype <com:Math><semantics>𝑿<annotation encoding="application / x-tex">\boldsymbol{X}< / annotation>< / semantics>< / com:Math>. Annotations
[0040] Returning now to FIG. 1, the reference panel sample store 115 stores a set of reference samples for each of the K labels. The set of reference panel samples corresponding to the kth label (for <com:Math><semantics>k∈{1,...,K}<annotation encoding="application / x-tex">k \in \{1, ..., K\}< / annotation>< / semantics>< / com:Math>) is referred to herein as <com:Math><semantics>Rk<annotation encoding="application / x-tex">R_k< / annotation>< / semantics>< / com:Math>. Each reference panel sample <com:Math><semantics>R∈Rk<annotation encoding="application / x-tex">R \in R_k< / annotation>< / semantics>< / com:Math> in the store 115 may be an unphased diploid genotype of L SNPs, <com:Math><semantics>R=(R1,...,RL)<annotation encoding="application / x-tex">R=(R_1,...,R_L)< / annotation>< / semantics>< / com:Math>, where each <com:Math><semantics>Ri<annotation encoding="application / x-tex">R_i< / annotation>< / semantics>< / com:Math> (for <com:Math><semantics>i∈{1,...,L}<annotation encoding="application / x-tex">i \in \{1,...,L\}< / annotation>< / semantics>< / com:Math>) is an SNP that is either an unordered pair of binary alleles (i.e., <com:Math><semantics>(0,0)<annotation encoding="application / x-tex">(0,0)< / annotation>< / semantics>< / com:Math>, <com:Math><semantics>(0,1)<annotation encoding="application / x-tex">(0,1)< / annotation>< / semantics>< / com:Math>, or <com:Math><semantics>(1,1)<annotation encoding="application / x-tex">(1,1)< / annotation>< / semantics>< / com:Math>) or missing data. The labels may each correspond to a different origin population (e.g., an ethnic group), in which case each reference panel sample R may be a single-origin genotype from the kth origin population.
[0041] The annotation store 125 stores an annotation <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_w(k,u)< / annotation>< / semantics>< / com:Math> for each label k and for each haploid state u in the haploid MM 200 for window w. The annotations may be calculated by the diploid HMM module 150 during the training stage. An annotation is <com:Math><semantics>Aν(k,u)<annotation encoding="application / x-tex">A_{\nu}(k,u)< / annotation>< / semantics>< / com:Math> is based on the set of reference panel samples <com:Math><semantics>Rk<annotation encoding="application / x-tex">R_k< / annotation>< / semantics>< / com:Math> for the label k. The annotation <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_w(k,u)< / annotation>< / semantics>< / com:Math> is based on a calculation, for each reference sample <com:Math><semantics>R∈ℝk<annotation encoding="application / x-tex">R \in \mathbb{R}_k< / annotation>< / semantics>< / com:Math>, of the conditional probability of the haploid state u given the SNP sequence in the window w for the reference panel sample R. The calculation of the probability of the state u given reference panel sample R is based on the haploid MM 200 for window w. For a given window w, label k, and state u, the annotation <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_w(k,u)< / annotation>< / semantics>< / com:Math> is the probability that a haplotype corresponding to label k includes the haploid state u in its path through window w. Equivalently, the annotation <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_w(k,u)< / annotation>< / semantics>< / com:Math> is the expected proportion of haplotypes of the genotypes of the set of reference panel samples <com:Math><semantics>Rk<annotation encoding="application / x-tex">R_k< / annotation>< / semantics>< / com:Math> that include haploid state <com:Math><semantics>u<annotation encoding="application / x-tex">u< / annotation>< / semantics>< / com:Math> in their corresponding paths.
[0042] In one embodiment, annotations are determined using a forward–backward algorithm. For a reference panel sample <com:Math><semantics>R∈ℝk<annotation encoding="application / x-tex">R \in \mathbb{R}_k< / annotation>< / semantics>< / com:Math>, the forward–backward algorithm may be used to calculate a forward function <com:Math><semantics>fR,w<annotation encoding="application / x-tex">f_{R,w}< / annotation>< / semantics>< / com:Math> and a backward function <com:Math><semantics>bR,w<annotation encoding="application / x-tex">b_{R,w}< / annotation>< / semantics>< / com:Math>. The forward function <com:Math><semantics>fR,w(u,v)<annotation encoding="application / x-tex">f_{R,w}(u,v)< / annotation>< / semantics>< / com:Math> may map the diploid state <com:Math><semantics>(u,v)<annotation encoding="application / x-tex">(u,v)< / annotation>< / semantics>< / com:Math> at level d to the joint probability of the first d SNPs in window w of the reference panel sample R and the diploid state <com:Math><semantics>(u,v)<annotation encoding="application / x-tex">(u,v)< / annotation>< / semantics>< / com:Math>. That is, the output of the forward function <com:Math><semantics>fR,w(u,v)<annotation encoding="application / x-tex">f_{R,w}(u,v)< / annotation>< / semantics>< / com:Math> is the probability, based on the haploid MM for the window w, that a genotype has the first d SNPs of R and that R corresponds to the state <com:Math><semantics>(u,v)<annotation encoding="application / x-tex">(u,v)< / annotation>< / semantics>< / com:Math> at level d. Similarly, the backward function <com:Math><semantics>bR,w(u,v)<annotation encoding="application / x-tex">b_{R,w}(u,v)< / annotation>< / semantics>< / com:Math> may map the diploid state <com:Math><semantics>(u,v)<annotation encoding="application / x-tex">(u,v)< / annotation>< / semantics>< / com:Math> at level d to the joint probability of the last <com:Math><semantics>(D−d)<annotation encoding="application / x-tex">(D-d)< / annotation>< / semantics>< / com:Math> SNPs in window w of the reference panel sample R and the state <com:Math><semantics>(u,v)<annotation encoding="application / x-tex">(u,v)< / annotation>< / semantics>< / com:Math>. The forward-backwards product, <com:Math><semantics>fR,w(u,v)×bR,w(u,v)<annotation encoding="application / x-tex">f_{R,w}(u,v) \times b_{R,w}(u,v)< / annotation>< / semantics>< / com:Math>, may be the joint probability of all the SNPs of the reference panel sample R in window w and the corresponding state <com:Math><semantics>(u,v)<annotation encoding="application / x-tex">(u,v)< / annotation>< / semantics>< / com:Math>. In some embodiments, the outputs of the forward function <com:Math><semantics>fR,w<annotation encoding="application / x-tex">f_{R,w}< / annotation>< / semantics>< / com:Math> and the backward function <com:Math><semantics>bR,w<annotation encoding="application / x-tex">b_{R,w}< / annotation>< / semantics>< / com:Math> are proportional, but not necessarily equal to the probabilities of their respective diploid states.
[0043] The annotation <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_w(k,u)< / annotation>< / semantics>< / com:Math> for the label k and state u may be given by: [Image disponible dans le document PDF, Image available in the PDF document] (1) where <com:Math><semantics>|Rk|<annotation encoding="application / x-tex">|R_k|< / annotation>< / semantics>< / com:Math> denotes the cardinality of the set <com:Math><semantics>Rk<annotation encoding="application / x-tex">R_k< / annotation>< / semantics>< / com:Math> (i.e., the number of reference panel samples in <com:Math><semantics>Rk<annotation encoding="application / x-tex">R_k< / annotation>< / semantics>< / com:Math>) and where StatesInLevel<com:Sub>w< / com:Sub>(u) refers to the set of haploid states in the same level as u (i.e., if u is in level d, then StatesInLevel<com:Sub>w< / com:Sub>(u) is the set of all states at level d). Because <com:Math><semantics>(Sw,Sw)<annotation encoding="application / x-tex">(S_w, S_w)< / annotation>< / semantics>< / com:Math> is the start state of the diploid HMM 300 for window <com:Math><semantics>w<annotation encoding="application / x-tex">w< / annotation>< / semantics>< / com:Math>, <com:Math><semantics>bR,w(𝕊w,𝕊w)<annotation encoding="application / x-tex">b_{R,w}(\mathbb{S}_w,\mathbb{S}_w)< / annotation>< / semantics>< / com:Math> is equal to the likelihood of the reference panel sample <com:Math><semantics>R<annotation encoding="application / x-tex">R< / annotation>< / semantics>< / com:Math>.
[0044] By the definition of the conditional probability, <com:Math><semantics>fR,w(u,v)×bR,w(u,v) / bR,w(𝕊w,𝕊w)<annotation encoding="application / x-tex">f_{R,w}(u,v) \times b_{R,w}(u,v) / b_{R,w}(\mathbb{S}_w,\mathbb{S}_w)< / annotation>< / semantics>< / com:Math> is the diploid state probability, i.e., the conditional probability that the path of a genotype includes the state <com:Math><semantics>(u,v)<annotation encoding="application / x-tex">(u,v)< / annotation>< / semantics>< / com:Math> in the diploid HMM 300 for window w given that the genotype is the reference panel sample R. In some embodiments, the forward–backwards product <com:Math><semantics>fR,w(u,v)×bR,w(u,v)<annotation encoding="application / x-tex">f_{R,w}(u,v) \times b_{R,w}(u,v)< / annotation>< / semantics>< / com:Math> and <com:Math><semantics>bR,w(𝕊w,𝕊w)<annotation encoding="application / x-tex">b_{R,w}(\mathbb{S}_w,\mathbb{S}_w)< / annotation>< / semantics>< / com:Math> are calculated to be proportional, but not necessarily equivalent, to the likelihood of their respective diploid states. In such an embodiment, the diploid state probability <com:Math><semantics>fR,w(u,v)×bR,w(u,v) / bR,w(𝕊w,𝕊w)<annotation encoding="application / x-tex">f_{R,w}(u,v) \times b_{R,w}(u,v) / b_{R,w}(\mathbb{S}_w,\mathbb{S}_w)< / annotation>< / semantics>< / com:Math> for reference panel sample R is still equivalent to the conditional probability that the path of the genotype includes the state <com:Math><semantics>(u,v)<annotation encoding="application / x-tex">(u,v)< / annotation>< / semantics>< / com:Math> in the diploid HMM 300 given the genotype R.
[0045] The summation of the diploid state probabilities <com:Math><semantics>fR,w(u,v)×bR,w(u,v) / bR,w(𝕊w,𝕊w)<annotation encoding="application / x-tex">f_{R,w}(u,v) \times b_{R,w}(u,v) / b_{R,w}(\mathbb{S}_w,\mathbb{S}_w)< / annotation>< / semantics>< / com:Math> over all haploid states v in level d produces the marginal probability that the first haplotype is in haploid state u at level d given the reference panel sample R. The diploid state probabilities for a reference panel sample R may be summed over the set of diploid states that include the haploid state u (i.e., diploid states <com:Math><semantics>(u,v)<annotation encoding="application / x-tex">(u,v)< / annotation>< / semantics>< / com:Math> and <com:Math><semantics>(v,u)<annotation encoding="application / x-tex">(v,u)< / annotation>< / semantics>< / com:Math> for all haploid states <com:Math><semantics>v<annotation encoding="application / x-tex">v< / annotation>< / semantics>< / com:Math> at the same level as the haploid state <com:Math><semantics>u<annotation encoding="application / x-tex">u< / annotation>< / semantics>< / com:Math>) to produce a probability that the reference panel sample R corresponds to the haploid state u. Finally, the probabilities of u for each reference panel sample R may be combined produce the annotation <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_w(k,u)< / annotation>< / semantics>< / com:Math>. For example, <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_w(k,u)< / annotation>< / semantics>< / com:Math> may be the arithmetic average of the probabilities of the haploid state u for each reference panel sample R, therefore representing the expected proportion of reference panel samples in the set of reference panel samples <com:Math><semantics>Rk<annotation encoding="application / x-tex">R_k< / annotation>< / semantics>< / com:Math> that include the state u in their respective paths. Stated differently, the annotation <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_w(k,u)< / annotation>< / semantics>< / com:Math> is the probability that the haploid state of a haplotype at a level d is haploid state u given that the haplotype corresponds to label k. In other alternatives, a different mathematical formulation other than arithmetic average may be used.
[0046] The annotations in the annotation store 125 may be calculated during a training stage prior to determining labels for potentially admixed genotypes. In some embodiments, the annotations are updated based on labels determined for unphased potentially admixed genotypes that are input to the system through the process described herein. In some embodiments, the annotations <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_w(k,u)< / annotation>< / semantics>< / com:Math> for a label k and window w may be iteratively improved by determining a probability that an admixed genotype corresponds to a label k in window w and modifying the annotations <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_w(k,u)< / annotation>< / semantics>< / com:Math> accordingly. Inter Window Hidden Markov Model
[0047] After the training stage is complete, the label determination system 100 begins the label assignment phase to assign labels to an input sample genome X. The genotype store 130 stores one or more unphased genotypes, including the input sample genotype X. The label determination system 100 may assign one or more labels to the input sample genotype X based on the sequence of SNPs in the input sample genotype X. The inter-window HMM store 135 stores an inter-window HMM corresponding to the input sample genotype X that is used to determine the labels. The inter-window HMM is built by the inter-window HMM module 160. The inter-window HMM includes states for each window w. The transition probabilities between states in the inter-window HMM may be based on the annotations or some subset thereof as stored in the annotation store 125.
[0048] FIG. 4 is a simplified example of an inter-window HMM 400 such as may be stored in the inter-window HMM store 135, according to an embodiment. For each window w, an inter-window HMM includes a set of states corresponding to every unordered pair of labels from the set of labels K. Thus, there are <com:Math><semantics>T=(K+1)K / 2<annotation encoding="application / x-tex">T = (K + 1)K / 2< / annotation>< / semantics>< / com:Math> states for each window w. Herein, the states for a window w are denoted as <com:Math><semantics>UX,w,(p,q)<annotation encoding="application / x-tex">U_{X,w,(p,q)}< / annotation>< / semantics>< / com:Math> where <com:Math><semantics>(p,q)<annotation encoding="application / x-tex">(p,q)< / annotation>< / semantics>< / com:Math> corresponds to a pair of labels. For the purpose of clarity, the values of p and q are restricted to <com:Math><semantics>1≤p≤q≤K<annotation encoding="application / x-tex">1 \le p \le q \le K< / annotation>< / semantics>< / com:Math>. In this way, the pair <com:Math><semantics>(p,q)<annotation encoding="application / x-tex">(p,q)< / annotation>< / semantics>< / com:Math> uniquely refers to each of the T unordered pairs of labels.
[0049] For purposes of illustration, FIG. 4 shows an example of an inter-window HMM 400 with <com:Math><semantics>K=3<annotation encoding="application / x-tex">K=3< / annotation>< / semantics>< / com:Math> labels. Thus, in the embodiment illustrated by FIG. 4, each window w has <com:Math><semantics>T=6<annotation encoding="application / x-tex">T=6< / annotation>< / semantics>< / com:Math> states, each state corresponding to a pair of labels <com:Math><semantics>(p,q)∈{(1,1),(1,2),(1,3),(2,2),(2,3),(3,3)}<annotation encoding="application / x-tex">(p,q) \in \{(1,1),(1,2),(1,3),(2,2),(2,3),(3,3)\}< / annotation>< / semantics>< / com:Math>. Although FIG. 4 depicts <com:Math><semantics>K=3<annotation encoding="application / x-tex">K=3< / annotation>< / semantics>< / com:Math> labels, the number of labels K can selected to be any natural number. The start state 310 transitions to one of the T possible states of window 1 as illustrated by the six arrows between the start state 310 and the respective T states of window 1. Each state in window 1 transitions to states in window 2. A state <com:Math><semantics>UX,w,(p,q)<annotation encoding="application / x-tex">U_{X,w,(p,q)}< / annotation>< / semantics>< / com:Math> in window w may transition to a state <com:Math><semantics>UX,w+1,(p′,q′)<annotation encoding="application / x-tex">U_{X,w+1,(p',q')}< / annotation>< / semantics>< / com:Math> in window w+1, where 1 <com:Math><semantics>≤p′≤q′≤K<annotation encoding="application / x-tex">\leq p' \leq q' \leq K< / annotation>< / semantics>< / com:Math>. If the window w and the window w+1 correspond to the same chromosome (i.e., correspond to the same pair of homomorphic chromosomes), then a state <com:Math><semantics>UX,w,(p,q)<annotation encoding="application / x-tex">U_{X,w,(p,q)}< / annotation>< / semantics>< / com:Math> may be more likely to transition to a state <com:Math><semantics>UX,w+1,(p′,q′)<annotation encoding="application / x-tex">U_{X,w+1,(p',q')}< / annotation>< / semantics>< / com:Math> in window <com:Math><semantics>w+1<annotation encoding="application / x-tex">w+1< / annotation>< / semantics>< / com:Math> that corresponds to the same pair of labels (i.e., <com:Math><semantics>(p′,q′)<annotation encoding="application / x-tex">(p',q')< / annotation>< / semantics>< / com:Math> <com:Math><semantics>=(p,q)<annotation encoding="application / x-tex">=(p,q)< / annotation>< / semantics>< / com:Math>) than to a state in window <com:Math><semantics>w+1<annotation encoding="application / x-tex">w+1< / annotation>< / semantics>< / com:Math> that corresponds to a different pair of labels <com:Math><semantics>(p′,q′)<annotation encoding="application / x-tex">(p',q')< / annotation>< / semantics>< / com:Math>, where <com:Math><semantics>1≤p′<annotation encoding="application / x-tex">1 \le p'< / annotation>< / semantics>< / com:Math> <com:Math><semantics>≤q′≤K<annotation encoding="application / x-tex">\leq q' \leq K< / annotation>< / semantics>< / com:Math>. This is because it is biologically unlikely that the sequences of SNPs in adjacent windows will correspond to different labels (e.g., correspond to different ancestral origin groups). In some embodiments, the inter-window HMM may include a probability that sequential states from the same chromosomes correspond to the same pair of labels. Herein, this probability is denoted as <com:Math><semantics>(1−τX)<annotation encoding="application / x-tex">(1 - \tau_X)< / annotation>< / semantics>< / com:Math>.
[0050] In some embodiments, the transition probability <com:Math><semantics>PX(UX,w,(p,q),(p′,q′))<annotation encoding="application / x-tex">P_X(U_{X,w,(p,q)},(p',q'))< / annotation>< / semantics>< / com:Math> from a state <com:Math><semantics>UX,w,(p,q)<annotation encoding="application / x-tex">U_{X,w,(p,q)}< / annotation>< / semantics>< / com:Math> to a state <com:Math><semantics>UX,w+1,(p′,q′)<annotation encoding="application / x-tex">U_{X,w+1,(p',q')}< / annotation>< / semantics>< / com:Math> in the same chromosome is given by: [Image disponible dans le document PDF, Image available in the PDF document] (2) where <com:Math><semantics>πX,(p′,q′)<annotation encoding="application / x-tex">\pi_{X,(p',q')}< / annotation>< / semantics>< / com:Math> is the label probability corresponding to the pair of labels <com:Math><semantics>(p′,q′)<annotation encoding="application / x-tex">(p',q')< / annotation>< / semantics>< / com:Math> and where the label change probability <com:Math><semantics>τX<annotation encoding="application / x-tex">\tau_X< / annotation>< / semantics>< / com:Math> is the probability that one of the labels <com:Math><semantics>(p′,q′)<annotation encoding="application / x-tex">(p',q')< / annotation>< / semantics>< / com:Math> in state <com:Math><semantics>UX,w+1,(p′,q′)<annotation encoding="application / x-tex">U_{X,w+1,(p',q')}< / annotation>< / semantics>< / com:Math> will have one label different than <com:Math><semantics>(p,q)<annotation encoding="application / x-tex">(p,q)< / annotation>< / semantics>< / com:Math> in state <com:Math><semantics>UX,w,(p,q)<annotation encoding="application / x-tex">U_{X,w,(p,q)}< / annotation>< / semantics>< / com:Math>. A label probability vector <com:Math><semantics>πX<annotation encoding="application / x-tex">\pi_X< / annotation>< / semantics>< / com:Math> may include the label probabilities <com:Math><semantics>πX,(p,q)<annotation encoding="application / x-tex">\pi_{X,(p,q)}< / annotation>< / semantics>< / com:Math> for all <com:Math><semantics>1≤p≤q≤K<annotation encoding="application / x-tex">1 \le p \le q \le K< / annotation>< / semantics>< / com:Math>. The values of <com:Math><semantics>πX<annotation encoding="application / x-tex">\pi_X< / annotation>< / semantics>< / com:Math> and <com:Math><semantics>τX<annotation encoding="application / x-tex">\tau_X< / annotation>< / semantics>< / com:Math> may be calculated by the inter- window HMM module 160 based on the input sample genotype X according to a procedure described below. In some embodiments, the label probabilities <com:Math><semantics>πX,(p,q)<annotation encoding="application / x-tex">\pi_{X,(p,q)}< / annotation>< / semantics>< / com:Math> sum to unity (i.e., <com:Math><semantics>∑p=1K∑q=pKπX,(p,q)=<annotation encoding="application / x-tex">\sum_{p=1}^K \sum_{q=p}^K \pi_{X,(p,q)} =< / annotation>< / semantics>< / com:Math> 1). In some embodiments, the values of the label probability vector <com:Math><semantics>πX<annotation encoding="application / x-tex">\pi_X< / annotation>< / semantics>< / com:Math> and the label change probability <com:Math><semantics>τX<annotation encoding="application / x-tex">\tau_X< / annotation>< / semantics>< / com:Math> are calculated with a Baum-Welch algorithm. In Equation 2, transitions from a state <com:Math><semantics>UX,w,(p,q)<annotation encoding="application / x-tex">U_{X,w,(p,q)}< / annotation>< / semantics>< / com:Math> to a state <com:Math><semantics>UX,w+1,(p′,q′)<annotation encoding="application / x-tex">U_{X,w+1,(p',q')}< / annotation>< / semantics>< / com:Math> without any of the same labels (i.e., if <com:Math><semantics>p′∉{p,q}<annotation encoding="application / x-tex">p' \notin \{p,q\}< / annotation>< / semantics>< / com:Math> and <com:Math><semantics>q′∉{p,q}<annotation encoding="application / x-tex">q' \notin \{p,q\}< / annotation>< / semantics>< / com:Math>) are impossible. By omitting a transition for these low-probability transitions, the complexity of the inter- window HMM 400 may be reduced, thereby producing significant savings in time and computer processing requirements needed to determine labels.
[0051] In some embodiments, for some states <com:Math><semantics>UX,w,(p,q)<annotation encoding="application / x-tex">U_{X,w,(p,q)}< / annotation>< / semantics>< / com:Math>, the outgoing transition probabilities do not sum to unity (i.e., <com:Math><semantics>∑p′=1K∑q′=p′KPX(UX,w,p,q,(p′,q′))<1<annotation encoding="application / x-tex">\sum_{p'=1}^{K} \sum_{q'=p'}^{K} P_X\left(U_{X,w,p,q},(p',q')\right) < 1< / annotation>< / semantics>< / com:Math>). Defining the transition probabilities to sum to less than unity may decrease the complexity compared to embodiments in which the transition probabilities are normalized so as to sum to unity. For example, in embodiments in which the transitions probabilities between states on the same chromosome is given by equation 2, the outgoing transition probabilities for a state on a window w that is on the same chromosome as window <com:Math><semantics>w+1<annotation encoding="application / x-tex">w+1< / annotation>< / semantics>< / com:Math> do not sum to unity. In such embodiments, a state <com:Math><semantics>UX,w,(p,q)<annotation encoding="application / x-tex">U_{X,w,(p,q)}< / annotation>< / semantics>< / com:Math> may have outgoing transitions to states in window <com:Math><semantics>w+1<annotation encoding="application / x-tex">w+1< / annotation>< / semantics>< / com:Math> and to an implicit null state that does not have outgoing transitions. In some embodiments, the inter-window HMM 400 does not explicitly reference these null states or the transitions thereto. In some embodiments, the inter-window HMM functionally ignores these implicit null states.
[0052] If the window <com:Math><semantics>w+1<annotation encoding="application / x-tex">w+1< / annotation>< / semantics>< / com:Math> corresponds to a different chromosome than window <com:Math><semantics>w<annotation encoding="application / x-tex">w< / annotation>< / semantics>< / com:Math>, then the state <com:Math><semantics>UX,w,(p,q)<annotation encoding="application / x-tex">U_{X,w,(p,q)}< / annotation>< / semantics>< / com:Math> may transition to an inter-chromosome state 320, which, in turn, transitions to a state <com:Math><semantics>UX,w+1,(p′,q′)<annotation encoding="application / x-tex">U_{X,w+1,(p',q')}< / annotation>< / semantics>< / com:Math> in the next window <com:Math><semantics>w+1<annotation encoding="application / x-tex">w+1< / annotation>< / semantics>< / com:Math>. Thus, if the window <com:Math><semantics>w+1<annotation encoding="application / x-tex">w+1< / annotation>< / semantics>< / com:Math> corresponds to a different chromosome than window w, the state <com:Math><semantics>UX,w,(p,q)<annotation encoding="application / x-tex">U_{X,w,(p,q)}< / annotation>< / semantics>< / com:Math> may transition to a state <com:Math><semantics>UX,w+1,(p′,q′)<annotation encoding="application / x-tex">U_{X,w+1,(p',q')}< / annotation>< / semantics>< / com:Math> with a probability that is independent of the state <com:Math><semantics>UX,w,(p,q)<annotation encoding="application / x-tex">U_{X,w,(p,q)}< / annotation>< / semantics>< / com:Math> at window w (i.e., independent of <com:Math><semantics>(p,q)<annotation encoding="application / x-tex">(p,q)< / annotation>< / semantics>< / com:Math>) because of the intervening inter-chromosome state 320. The transition probability between consecutive windows w and <com:Math><semantics>w+1<annotation encoding="application / x-tex">w+1< / annotation>< / semantics>< / com:Math> corresponding to different chromosomes may be given by: [Image disponible dans le document PDF, Image available in the PDF document] (3)
[0053] If window w is the final window (i.e., <com:Math><semantics>w=W<annotation encoding="application / x-tex">w = W< / annotation>< / semantics>< / com:Math>), then the state <com:Math><semantics>UX,w,(p,q)<annotation encoding="application / x-tex">U_{X,w,(p,q)}< / annotation>< / semantics>< / com:Math> in the window w transitions to an end state (not shown in FIG. 4). Each state <com:Math><semantics>UX,w,(p,q)<annotation encoding="application / x-tex">U_{X,w,(p,q)}< / annotation>< / semantics>< / com:Math> in window w transitions to either a state <com:Math><semantics>UX,w+1,(p,q)<annotation encoding="application / x-tex">U_{X,w+1,(p,q)}< / annotation>< / semantics>< / com:Math> in window <com:Math><semantics>w+1<annotation encoding="application / x-tex">w+1< / annotation>< / semantics>< / com:Math>, an inter-chromosome state 320, or an end state. FIG. 4 illustrates the possible outgoing transitions for each state <com:Math><semantics>UX,w,(p,q)<annotation encoding="application / x-tex">U_{X,w,(p,q)}< / annotation>< / semantics>< / com:Math> with arrows. For example, in window 2 (and in all windows w in which the window w+1 is on the same chromosome), the state <com:Math><semantics>UX,2,(1,3)<annotation encoding="application / x-tex">U_{X,2,(1,3)}< / annotation>< / semantics>< / com:Math> corresponding to the pair of labels (1,3) has five outgoing arrows because <com:Math><semantics>UX,2,(1,3)<annotation encoding="application / x-tex">U_{X,2,(1,3)}< / annotation>< / semantics>< / com:Math> can transition to the states <com:Math><semantics>UX,3,(1,1)<annotation encoding="application / x-tex">U_{X,3,(1,1)}< / annotation>< / semantics>< / com:Math>, <com:Math><semantics>UX,3,(1,2)<annotation encoding="application / x-tex">U_{X,3,(1,2)}< / annotation>< / semantics>< / com:Math>, <com:Math><semantics>UX,3,(1,3)<annotation encoding="application / x-tex">U_{X,3,(1,3)}< / annotation>< / semantics>< / com:Math>, <com:Math><semantics>UX,3,(2,3)<annotation encoding="application / x-tex">U_{X,3,(2,3)}< / annotation>< / semantics>< / com:Math>, and <com:Math><semantics>UX,3,(3,2)<annotation encoding="application / x-tex">U_{X,3,(3,2)}< / annotation>< / semantics>< / com:Math>. However, state <com:Math><semantics>UX,2,(1,3)<annotation encoding="application / x-tex">U_{X,2,(1,3)}< / annotation>< / semantics>< / com:Math> cannot transition to state <com:Math><semantics>UX,2,(2,2)<annotation encoding="application / x-tex">U_{X,2,(2,2)}< / annotation>< / semantics>< / com:Math> because this state does not share any common labels with state <com:Math><semantics>UX,2,(1,3)<annotation encoding="application / x-tex">U_{X,2,(1,3)}< / annotation>< / semantics>< / com:Math>. Similarly, state <com:Math><semantics>UX,1,(1,1)<annotation encoding="application / x-tex">U_{X,1,(1,1)}< / annotation>< / semantics>< / com:Math> can transition to three states <com:Math><semantics>(UX,1,(1,1),UX,1,(1,2))<annotation encoding="application / x-tex">(U_{X,1,(1,1)}, U_{X,1,(1,2)})< / annotation>< / semantics>< / com:Math> and, <com:Math><semantics>UX,1,(1,3)<annotation encoding="application / x-tex">U_{X,1,(1,3)}< / annotation>< / semantics>< / com:Math>, but cannot transition to states <com:Math><semantics>UX,1,(2,2)<annotation encoding="application / x-tex">U_{X,1,(2,2)}< / annotation>< / semantics>< / com:Math>, <com:Math><semantics>UX,1,(2,3)<annotation encoding="application / x-tex">U_{X,1,(2,3)}< / annotation>< / semantics>< / com:Math>, and, <com:Math><semantics>UX,1,(3,3)<annotation encoding="application / x-tex">U_{X,1,(3,3)}< / annotation>< / semantics>< / com:Math>. In general, when w and w+1 are on the same chromosome, a state <com:Math><semantics>UX,w,(p,q)<annotation encoding="application / x-tex">U_{X,w,(p,q)}< / annotation>< / semantics>< / com:Math> with two different labels (i.e., <com:Math><semantics>p≠q<annotation encoding="application / x-tex">p \neq q< / annotation>< / semantics>< / com:Math>) can transition to <com:Math><semantics>2K−1<annotation encoding="application / x-tex">2K-1< / annotation>< / semantics>< / com:Math> states <com:Math><semantics>UX,w+1,(p′,q′)<annotation encoding="application / x-tex">U_{X,w+1,(p',q')}< / annotation>< / semantics>< / com:Math> and a state <com:Math><semantics>UX,w,(p,p)<annotation encoding="application / x-tex">U_{X,w,(p,p)}< / annotation>< / semantics>< / com:Math> with two of the same labels can transition to K states <com:Math><semantics>UX,w+1,(p′,q′)<annotation encoding="application / x-tex">U_{X,w+1,(p',q')}< / annotation>< / semantics>< / com:Math>.
[0054] In some embodiments, the inter-window HMM module 160 uses the label pair probability distribution <com:Math><semantics>EX,w<annotation encoding="application / x-tex">E_{X,w}< / annotation>< / semantics>< / com:Math> as the emission probabilities for states in window w. That is, the label pair probability <com:Math><semantics>EX,w(p,q)<annotation encoding="application / x-tex">E_{X,w}(p,q)< / annotation>< / semantics>< / com:Math> may be an estimate of the probability of the sequence of SNPs <com:Math><semantics>(XSw,...,<annotation encoding="application / x-tex">(X_{S_w},...,< / annotation>< / semantics>< / com:Math> <com:Math><semantics>X(Sw+Dw−1)<annotation encoding="application / x-tex">X_{(S_w+D_w-1)}< / annotation>< / semantics>< / com:Math>) in window w given that the state for window w is <com:Math><semantics>UX,w,(p,q)<annotation encoding="application / x-tex">U_{X,w,(p,q)}< / annotation>< / semantics>< / com:Math>). The label pair probability distribution may be normalized so that all windows in the inter-window HMM are weighted equally. In some embodiments, the inter-window module calculates a forward function <com:Math><semantics>FX<annotation encoding="application / x-tex">F_X< / annotation>< / semantics>< / com:Math> and a backward function <com:Math><semantics>BX<annotation encoding="application / x-tex">B_X< / annotation>< / semantics>< / com:Math> for the inter-window HMM. For a state <com:Math><semantics>UX,w,(p,q)<annotation encoding="application / x-tex">U_{X,w,(p,q)}< / annotation>< / semantics>< / com:Math> in the inter-window HMM, the forward function <com:Math><semantics>FX(w,p,q)<annotation encoding="application / x-tex">F_X(w,p,q)< / annotation>< / semantics>< / com:Math> may be the probability that the input sample genotype X corresponds to the labels <com:Math><semantics>(p,q)<annotation encoding="application / x-tex">(p,q)< / annotation>< / semantics>< / com:Math> in window w given the SNP sequences of the first w windows. Similarly, the backward function <com:Math><semantics>BX(w,p,q)<annotation encoding="application / x-tex">B_X(w,p,q)< / annotation>< / semantics>< / com:Math> may be the probability that the input sample genotype X corresponds to the label <com:Math><semantics>(p,q)<annotation encoding="application / x-tex">(p,q)< / annotation>< / semantics>< / com:Math> in the window w given the SNP sequences in window w to window W. The inter-window HMM module may also calculate the vector of label probabilities <com:Math><semantics>πX<annotation encoding="application / x-tex">\pi_X< / annotation>< / semantics>< / com:Math> and the label change probability <com:Math><semantics>τX<annotation encoding="application / x-tex">\tau_X< / annotation>< / semantics>< / com:Math> based on the label pair probability distribution <com:Math><semantics>EX,w<annotation encoding="application / x-tex">E_{X,w}< / annotation>< / semantics>< / com:Math>. Label Assignment
[0055] Returning now to FIG. 1, the label assignment module 170 determines one or more labels for the input sample genotype X based on the inter-window HMM. In some embodiments, the label assignment module 170 may determine a proportion of the input sample genotype X that corresponds to each label. For example, the label assignment module 170 may determine that 25% of the input sample genotype X corresponds to label 1, 0% corresponds to label 2, 50% corresponds to label 3, and 25% corresponds to label 4. The proportion of each label may be based on the states in the Viterbi path, based on the probability of being in each state (e.g., as calculated with the forward-backward algorithm), or otherwise based on the inter-window HMM. The determination of these proportions may also be based on a weight assigned to each window w. The weight of each window w may be based on the size of the window (e.g., in number of bases). The weighting of each window w may be adjusted based on portions of the windows w that overlaps with other windows.
[0056] In some embodiments, the label assignment module 170 assigns a pair of labels to each window w of the input sample genotype X. In some embodiments, the label assignment module 170 determines the Viterbi path through the inter-window HMM 400. In alternate embodiments, the label assignment module 170 computes a number (e.g., 1000) of stochastic paths through the inter-window HMM and determines a range of each label's proportion based on the states taken by the stochastic process. For example, the label assignment module 170 may determine that 18-30% of the input sample genotype X corresponds to a particular label. The range may be based on the maximum and minimum proportion of the genotype X that corresponds to a label in the stochastic paths. Alternately, the range may be based on percentiles of the proportions of the input sample genotype X that corresponds to a label in the stochastic paths. For example, the upper bound of a range for label k may be based on a 95th percentile of the proportions of the states that correspond to label k in the stochastic paths and the lower bound may be based on the 5th percentile.
[0057] In some embodiments, the label assignment module 170 assigns labels to specific portions of the input sample genotype X. The label assignment module 170 may specifically assign labels to a portion of the input sample genotype X that corresponds to one or more overlapping regions with a second genotype. For example, if the input sample genotype and the second genotype are the genotypes of related individuals (e.g., first cousins), then the one or more overlapping are the regions of genetic information that correspond to one or more shared ancestors (e.g., a grandmother and a grandfather shared by the cousins). If, in an overlapping region, there is only one haplotype (in each genotype) that overlaps between the input sample genotype X and the second genotype, the label assignment module 170 may assign labels specifically to the overlapping haplotype.
[0058] The phasing module 180 may probabilistically separate the input sample genotype X into its constituent haplotypes based on the assigned labels. In one embodiment, a pair of labels for each window w is assigned based on the Viterbi path through the inter-window HMM. Phasing (i.e., separating the input sample genotype X into haplotypes) may be performed based diploid HMMs 300 for each window w modified by the annotations <com:Math><semantics>Aw<annotation encoding="application / x-tex">A_w< / annotation>< / semantics>< / com:Math> for the assigned labels. For example, the diploid HMM for the input sample genotype X may be modified so that the probability of the diploid state <com:Math><semantics>(u1,u2)<annotation encoding="application / x-tex">(u_1,u_2)< / annotation>< / semantics>< / com:Math> in the window w is given by <com:Math><semantics>Aw(u1,p)×Aw(u2,q)×fX,w(u1,u2)×bX,w(u1,u2) / bX,w(𝕊w,𝕊w)<annotation encoding="application / x-tex">A_w(u_1,p) \times A_w(u_2,q) \times f_{X,w}(u_1,u_2) \times b_{X,w}(u_1,u_2) / b_{X,w}(\mathbb{S}_w,\mathbb{S}_w)< / annotation>< / semantics>< / com:Math>. The SNPs in the window w may be phased into the constituent haplotypes by determining the Viterbi path through the modified diploid HMM. In this way, the genome X may be phased so as to maximize the agreement with the label assignment. The haplotypes may also be combined across windows. For example, if the labels <com:Math><semantics>(p,q)<annotation encoding="application / x-tex">(p,q)< / annotation>< / semantics>< / com:Math> were assigned to window w and the labels <com:Math><semantics>(p,q′)<annotation encoding="application / x-tex">(p,q')< / annotation>< / semantics>< / com:Math> were assigned to window w+1, then the sequence of alleles in the phased haplotype corresponding to label p in window w may be combined with the sequence of alleles in the phased haplotype corresponding to label p in window w+1. Similarly, the sequence of alleles in the phased haplotype corresponding to label q in window w may be combined with those of label <com:Math><semantics>q′<annotation encoding="application / x-tex">q'< / annotation>< / semantics>< / com:Math> in window <com:Math><semantics>w+1<annotation encoding="application / x-tex">w+1< / annotation>< / semantics>< / com:Math>.
[0059] The label determination system 100 comprises one or more processors and one or more non-transitory computer readable storage mediums. The one or more processors may implement the functions attributed above to modules. The modules may be hardware modules (i.e., computer hardware specially configured to perform specific functions), software modules, or some combination thereof. The non-transitory computer readable mediums may store computer instructions that, when executed, perform the methods described herein. In some embodiments, the label determination system 100 is a single computing system. In alternate embodiments, the label determination system 100 may be a distributed system including spatially-separated databases and computing systems (e.g., servers) that communicate via a network. Training the Label Determination System
[0060] FIG. 5 is a flowchart illustrating a method for calculating annotations, according to some embodiments. The model training method may be performed by the label determination system 100 during the training stage. For each window w, the model training method produces a haploid MM 200 and a set of annotations <com:Math><semantics>Aw<annotation encoding="application / x-tex">A_w< / annotation>< / semantics>< / com:Math>. The annotations <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_w(k,u)< / annotation>< / semantics>< / com:Math> for label k and window w may be based on the set of reference panel samples <com:Math><semantics>Rk<annotation encoding="application / x-tex">R_k< / annotation>< / semantics>< / com:Math> and the haploid MM for window w.
[0061] In the model training method 500, haplotype data is received 510 by the label determination system 100. The haplotype data may be a sequence of alleles corresponding to individuals. Each sequence of haplotype data may include alleles corresponding to the L SNPs of the genotypes stored in the genotype store 130, or some subset thereof. Some or all of the haplotype data may be phased haplotype data produced by the method described in the PCT application entitled "Haplotype Phasing Modules" (International Publication Number WO 2016 / 061568 A1) which was filed on October 19, 2015. In alternate embodiments, some or all of the haplotype data may be phased haplotypes produced by PHASE, BEAGLE, HAPI-UR, SHAPEIT2, IMPUTE2, or some other phase estimation method. Based on the received haplotype data, the haploid MM module 140 builds 520 haploid MMs 200 for each window w. The haploid MMs may be stored in the haploid MM store 110.
[0062] The label determination system 100 also receives 530 a set of reference panel samples <com:Math><semantics>Rk<annotation encoding="application / x-tex">R_k< / annotation>< / semantics>< / com:Math> for each label k (for <com:Math><semantics>1≤k≤K<annotation encoding="application / x-tex">1 \le k \le K< / annotation>< / semantics>< / com:Math>). The set of reference panel samples <com:Math><semantics>Rk<annotation encoding="application / x-tex">R_k< / annotation>< / semantics>< / com:Math> may be accessed from the reference panel sample store 115. Based on the set of reference panel samples <com:Math><semantics>Rk<annotation encoding="application / x-tex">R_k< / annotation>< / semantics>< / com:Math> for label k and the haploid MMs for window w, the diploid HMM module 150 may calculate a set of annotations <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_w(k,u)< / annotation>< / semantics>< / com:Math> of every label k and every state u in the window w. The annotations <com:Math><semantics>Aw<annotation encoding="application / x-tex">A_w< / annotation>< / semantics>< / com:Math> may be stored in the annotation store 125. Determining Labels for a Genotype
[0063] FIG. 6 is a flowchart illustrating a method for assigning labels to a genotype, according to some embodiments. The label determination method 600 may be performed by the label determination system 100.
[0064] The label determination system 100 receives 610 an input sample genotype X. Based on the input sample genotype X, the diploid HMM module 150 builds 620 a diploid HMM 300 for X each window w. When building 620 the diploid HMMs, the diploid HMM module 150 may determine <com:Math><semantics>αX,w(d)<annotation encoding="application / x-tex">\alpha_{X,w}(d)< / annotation>< / semantics>< / com:Math>, the set of possible diploid states <com:Math><semantics>(u,v)<annotation encoding="application / x-tex">(u,v)< / annotation>< / semantics>< / com:Math> at level d that the genotype X can traverse. The diploid HMM module 150 may also calculate 630 the forward function <com:Math><semantics>fX,w<annotation encoding="application / x-tex">f_{X,w}< / annotation>< / semantics>< / com:Math> and the backward function <com:Math><semantics>bX,w<annotation encoding="application / x-tex">b_{X,w}< / annotation>< / semantics>< / com:Math> for the diploid HMM of each window w so as to determine the probability that the genotype X corresponds to each diploid state <com:Math><semantics>(u,v)<annotation encoding="application / x-tex">(u,v)< / annotation>< / semantics>< / com:Math> with a forward-backward algorithm. In some embodiments, the set of possible diploid states <com:Math><semantics>aX,ν(d)<annotation encoding="application / x-tex">a_{X,\nu}(d)< / annotation>< / semantics>< / com:Math> is determined with the forward-backward algorithm as discussed above.
[0065] Based on the annotations <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_w(k,u)< / annotation>< / semantics>< / com:Math> and the input sample genotype X, the diploid HMM module 150 may calculate 650 an expected annotation product <com:Math><semantics>LX,w(d,p,q)<annotation encoding="application / x-tex">L_{X,w}(d,p,q)< / annotation>< / semantics>< / com:Math> for level d and for an unordered pair of labels <com:Math><semantics>(p,q)<annotation encoding="application / x-tex">(p,q)< / annotation>< / semantics>< / com:Math>. The expected annotation product <com:Math><semantics>LX,ν(d,p,q)<annotation encoding="application / x-tex">L_{X,\nu}(d,p,q)< / annotation>< / semantics>< / com:Math> may be the probability that a stochastic genotype with haplotypes of respective labels p and q corresponds to the same diploid state at level <com:Math><semantics>d<annotation encoding="application / x-tex">d< / annotation>< / semantics>< / com:Math> as the input sample genotype <com:Math><semantics>X<annotation encoding="application / x-tex">X< / annotation>< / semantics>< / com:Math> given the genotype sequence (i.e., given <com:Math><semantics>(XSw,…,X(Sw+Dw−1))<annotation encoding="application / x-tex">(X_{S_w}, \ldots, X_{(S_w + D_w - 1)})< / annotation>< / semantics>< / com:Math> in window w. The expected annotation product <com:Math><semantics>LX,w(d,p,q)<annotation encoding="application / x-tex">L_{X,w}(d,p,q)< / annotation>< / semantics>< / com:Math> may be based on the annotations for the <com:Math><semantics>Aw(p,u)<annotation encoding="application / x-tex">A_w(p,u)< / annotation>< / semantics>< / com:Math> <com:Math><semantics>Aw(p,v)<annotation encoding="application / x-tex">A_w(p,v)< / annotation>< / semantics>< / com:Math>, <com:Math><semantics>Aw(q,u)<annotation encoding="application / x-tex">A_w(q,u)< / annotation>< / semantics>< / com:Math>, and <com:Math><semantics>Aw(q,v)<annotation encoding="application / x-tex">A_w(q,v)< / annotation>< / semantics>< / com:Math> for the diploid state <com:Math><semantics>(u,v)<annotation encoding="application / x-tex">(u,v)< / annotation>< / semantics>< / com:Math> at level <com:Math><semantics>d<annotation encoding="application / x-tex">d< / annotation>< / semantics>< / com:Math>. The expected annotation product <com:Math><semantics>LX,w(d,p,q)<annotation encoding="application / x-tex">L_{X,w}(d,p,q)< / annotation>< / semantics>< / com:Math> may be given by: [Image disponible dans le document PDF, Image available in the PDF document] (4) where <com:Math><semantics>aX,w(d)<annotation encoding="application / x-tex">a_{X,w}(d)< / annotation>< / semantics>< / com:Math> is the set of possible diploid states <com:Math><semantics>(u,v)<annotation encoding="application / x-tex">(u,v)< / annotation>< / semantics>< / com:Math> at level d that the input sample genotype X can include. In some embodiments, the set of possible diploid states <com:Math><semantics>aX,w(d)<annotation encoding="application / x-tex">a_{X,w}(d)< / annotation>< / semantics>< / com:Math> is determined with the forward-backward algorithm.
[0066] Each expected annotation product <com:Math><semantics>LX,w(d,p,q)<annotation encoding="application / x-tex">L_{X,w}(d,p,q)< / annotation>< / semantics>< / com:Math> may be normalized across all the different values of <com:Math><semantics>(p,q)<annotation encoding="application / x-tex">(p,q)< / annotation>< / semantics>< / com:Math> and averaged together from level 1 to level D to calculate 660 a label pair probability distribution <com:Math><semantics>EX,w(p,q)<annotation encoding="application / x-tex">E_{X,w}(p,q)< / annotation>< / semantics>< / com:Math> for the window w. The label pair probability <com:Math><semantics>EX,w(p,q)<annotation encoding="application / x-tex">E_{X,w}(p,q)< / annotation>< / semantics>< / com:Math> for window w is a metric indicating the likelihood that the window <com:Math><semantics>w<annotation encoding="application / x-tex">w< / annotation>< / semantics>< / com:Math> corresponds to the pair of labels <com:Math><semantics>(p,q)<annotation encoding="application / x-tex">(p,q)< / annotation>< / semantics>< / com:Math> given the input sample genotype X in the window w. The label pair probability <com:Math><semantics>EX,w(p,q)<annotation encoding="application / x-tex">E_{X,w}(p,q)< / annotation>< / semantics>< / com:Math> for window w may be given by: [Image disponible dans le document PDF, Image available in the PDF document] (5)
[0067] Based on the label pair probability distributions <com:Math><semantics>EX,w<annotation encoding="application / x-tex">E_{X,w}< / annotation>< / semantics>< / com:Math> for each window w, the inter- window HMM module 160 may build 670 an inter-window HMM 400. The transition probabilities between states in the inter-window HMM may be based on the label pair probability distributions <com:Math><semantics>EX,w<annotation encoding="application / x-tex">E_{X,w}< / annotation>< / semantics>< / com:Math>. Also, the inter-window HMM module may use the label pair probability distribution <com:Math><semantics>EX,w<annotation encoding="application / x-tex">E_{X,w}< / annotation>< / semantics>< / com:Math> as the probability distribution of the states in window w given the SNPs in the window w. That is, the label pair distribution <com:Math><semantics>EX,w(p,q)<annotation encoding="application / x-tex">E_{X,w}(p,q)< / annotation>< / semantics>< / com:Math> may be used in the inter-window HMM as the probability of the state <com:Math><semantics>UX,w,(p,q)<annotation encoding="application / x-tex">U_{X,w,(p,q)}< / annotation>< / semantics>< / com:Math> in window w given the observation (i.e., the sequence of SNPs of the input sample genotype X in the window w). Building 670 the inter-window HMM 400 for the genotype X may include determining a label probability vector <com:Math><semantics>πX<annotation encoding="application / x-tex">\pi_X< / annotation>< / semantics>< / com:Math> a label change probability <com:Math><semantics>τX<annotation encoding="application / x-tex">\tau_X< / annotation>< / semantics>< / com:Math> for the inter-window HMM.
[0068] The inter-window HMM 400 is used by the label assignment module 170 to assign 680 labels for the input sample genotype X. Assigning labels may include assigning a pair of labels for each window w of the input sample genotype X. Assigning labels may also include determining a proportion of the input sample genotype X that corresponds to each label. In some embodiments, based on the assigned labels, the input sample genotype X is phased by the phasing module 180. Updating Annotations
[0069] FIG. 7 is a flow diagram for the operation of the label determination system for assigning labels to a input sample genotype X based on a model and updating the model based on the labels assigned to the input sample genotype X, according to one embodiment. By updating the model based on the labels assigned to input sample genotypes, the label determination system 100 may be iteratively improved as it processes genotypes.
[0070] The label determination system 100 initializes 710 the annotations <com:Math><semantics>Aν(k,w)<annotation encoding="application / x-tex">A_{\nu}(k,w)< / annotation>< / semantics>< / com:Math> based on the set of reference panel samples <com:Math><semantics>Rk<annotation encoding="application / x-tex">R_k< / annotation>< / semantics>< / com:Math> for label k. Initializing the annotations may include performing the model training method 500 of FIG. 5. The annotations may be stored in the annotations store 125. The label determination system 100 receives 720 an input sample genotype X or accesses the input sample genotype X stored in the genotype store 130. The inter-window HMM module 160 of the label determination system 100 builds 730 an inter-window HMM 400 based on the input sample genotype X and the annotations stored in the annotation store 125.
[0071] Based on the inter-window HMM for the input sample genotype X, the label determination system 100 may determine a probability distribution <com:Math><semantics>γX,w(k)<annotation encoding="application / x-tex">\gamma_{X,w}(k)< / annotation>< / semantics>< / com:Math> for each window w and each label k. In some embodiments, the value of the probability distribution <com:Math><semantics>γX,w(k)<annotation encoding="application / x-tex">\gamma_{X,w}(k)< / annotation>< / semantics>< / com:Math> for label k may be given by: [Image disponible dans le document PDF, Image available in the PDF document] (6) where <com:Math><semantics>FX<annotation encoding="application / x-tex">F_X< / annotation>< / semantics>< / com:Math> and <com:Math><semantics>BX<annotation encoding="application / x-tex">B_X< / annotation>< / semantics>< / com:Math> are the forward and backward functions for the inter-window HMM.
[0072] For each label k and haploid state u, learned annotations <com:Math><semantics>AX,w(k,u)<annotation encoding="application / x-tex">A_{X,w}(k,u)< / annotation>< / semantics>< / com:Math> may be calculated 750 for the input sample genotype X. The learned annotations <com:Math><semantics>AX,w(k,u)<annotation encoding="application / x-tex">A_{X,w}(k,u)< / annotation>< / semantics>< / com:Math> for input sample genotype X may be calculated in a similar manner to the annotations <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_w(k,u)< / annotation>< / semantics>< / com:Math> calculated based on the reference panel samples <com:Math><semantics>Rk<annotation encoding="application / x-tex">R_k< / annotation>< / semantics>< / com:Math> when the annotations <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_w(k,u)< / annotation>< / semantics>< / com:Math> were initialized 710. In some embodiments, learned annotations <com:Math><semantics>AX,w(k,u)<annotation encoding="application / x-tex">A_{X,w}(k,u)< / annotation>< / semantics>< / com:Math> are only calculated for a label k if the input sample genotype X has a probability distribution <com:Math><semantics>γX,ν(k)<annotation encoding="application / x-tex">\gamma_{X,\nu}(k)< / annotation>< / semantics>< / com:Math> greater than some threshold probability. The annotation <com:Math><semantics>AX,ν(k,u)<annotation encoding="application / x-tex">A_{X,\nu}(k,u)< / annotation>< / semantics>< / com:Math> may be given by: [Image disponible dans le document PDF, Image available in the PDF document] (7)
[0073] After the annotations <com:Math><semantics>AX,w(k,u)<annotation encoding="application / x-tex">A_{X,w}(k,u)< / annotation>< / semantics>< / com:Math> for input sample genotype X are calculated 750, the annotations <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_{w}(k,u)< / annotation>< / semantics>< / com:Math> in the annotation store 125 are updated 760 based on the newly calculated learned annotations <com:Math><semantics>AX,w(k,u)<annotation encoding="application / x-tex">A_{X,w}(k,u)< / annotation>< / semantics>< / com:Math> for input sample genotype X and the value of the probability distribution <com:Math><semantics>γX,w(k)<annotation encoding="application / x-tex">\gamma_{X,w}(k)< / annotation>< / semantics>< / com:Math>. In some embodiments, updating the annotations <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_w(k,u)< / annotation>< / semantics>< / com:Math> in the annotation store 125 includes summing the annotations based on the reference panel samples <com:Math><semantics>Rk<annotation encoding="application / x-tex">R_k< / annotation>< / semantics>< / com:Math> and the learned annotations for genotypes weighted by the value of their respective probability distributions for label k. The set of genotypes for which annotations have been calculated may be denoted by <com:Math><semantics>Φ<annotation encoding="application / x-tex">\Phi< / annotation>< / semantics>< / com:Math>. The annotations based on the reference panels <com:Math><semantics>Rk<annotation encoding="application / x-tex">R_k< / annotation>< / semantics>< / com:Math> may be denoted as <com:Math><semantics>AREF,w(k,u)<annotation encoding="application / x-tex">A_{REF,w}(k,u)< / annotation>< / semantics>< / com:Math>. The reference panel annotations <com:Math><semantics>AREF,w(k,u)<annotation encoding="application / x-tex">A_{REF,w}(k,u)< / annotation>< / semantics>< / com:Math> may have been calculated with equation 1 (or something analogous thereto) during initialization. The value of the updated annotation <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_w(k,u)< / annotation>< / semantics>< / com:Math> may be given by: [Image disponible dans le document PDF, Image available in the PDF document] (8) where <com:Math><semantics>θ<annotation encoding="application / x-tex">\theta< / annotation>< / semantics>< / com:Math> is a weighing factor <com:Math><semantics>(0≤θ≤1)<annotation encoding="application / x-tex">(0 \le \theta \le 1)< / annotation>< / semantics>< / com:Math> for determining the relative weight accorded to the reference panel annotations <com:Math><semantics>AREF,w(k,u)<annotation encoding="application / x-tex">A_{\text{REF},w}(k,u)< / annotation>< / semantics>< / com:Math> and the learned annotations <com:Math><semantics>AX,w(k,u)<annotation encoding="application / x-tex">A_{X,w}(k,u)< / annotation>< / semantics>< / com:Math> (for <com:Math><semantics>X∈Φ<annotation encoding="application / x-tex">X \in \Phi< / annotation>< / semantics>< / com:Math>). The weighting factor <com:Math><semantics>θ<annotation encoding="application / x-tex">\theta< / annotation>< / semantics>< / com:Math> may increase as the number of learned annotations increases. In some embodiments, the set of genotypes <com:Math><semantics>Φ<annotation encoding="application / x-tex">\Phi< / annotation>< / semantics>< / com:Math> used to calculate the updated annotation <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_{w}(k,u)< / annotation>< / semantics>< / com:Math> is based on the label k. For example, the set of genotypes <com:Math><semantics>Φ<annotation encoding="application / x-tex">\Phi< / annotation>< / semantics>< / com:Math> used to calculate the annotation <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_w(k,u)< / annotation>< / semantics>< / com:Math> for label k may only include genotypes <com:Math><semantics>X∈Φ<annotation encoding="application / x-tex">X \in \Phi< / annotation>< / semantics>< / com:Math> where <com:Math><semantics>γX,w(k)<annotation encoding="application / x-tex">\gamma_{X,w}(k)< / annotation>< / semantics>< / com:Math> is greater than some threshold.
[0074] In alternate embodiments, the phasing module 180 separates an input sample genotype X in the window w that has an assigned label pair <com:Math><semantics>(pX,w,qX,w)<annotation encoding="application / x-tex">(p_{X,w},q_{X,w})< / annotation>< / semantics>< / com:Math> into two constituents haplotypes, each corresponding to a respective assigned label. The annotation <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_w(k,u)< / annotation>< / semantics>< / com:Math> for a label k and a haploid state u may be based on a set <com:Math><semantics>Φk<annotation encoding="application / x-tex">\Phi_k< / annotation>< / semantics>< / com:Math>, which refers to the set or a subset of the input sample genomes that were assigned to a label pair that includes <com:Math><semantics>k<annotation encoding="application / x-tex">k< / annotation>< / semantics>< / com:Math> (i.e., for each <com:Math><semantics>X∈Φk<annotation encoding="application / x-tex">X \in \Phi_k< / annotation>< / semantics>< / com:Math>, <com:Math><semantics>k=pX,w<annotation encoding="application / x-tex">k = p_{X,w}< / annotation>< / semantics>< / com:Math> or <com:Math><semantics>k=qX,w<annotation encoding="application / x-tex">k = q_{X,w}< / annotation>< / semantics>< / com:Math>). In such an embodiment, the updated annotation <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_w(k,u)< / annotation>< / semantics>< / com:Math> for window w, haploid state u, and label k may be given by: [Image disponible dans le document PDF, Image available in the PDF document] (9) where <com:Math><semantics>δX,k(u)<annotation encoding="application / x-tex">\delta_{X,k}(u)< / annotation>< / semantics>< / com:Math> is a function that is equal to 1 if the phased haplotype for genotype X corresponding to label k includes haploid state u and is equal to 0 otherwise. Alternately, <com:Math><semantics>δX,k(u)<annotation encoding="application / x-tex">\delta_{X,k}(u)< / annotation>< / semantics>< / com:Math> may be a calculation of the probability that the phased haplotype for genotype X corresponding to label k includes haploid state u.
[0075] By updating 760 the annotations for a label, based on the learned annotations <com:Math><semantics>AX,w(k,u)<annotation encoding="application / x-tex">A_{X,w}(k,u)< / annotation>< / semantics>< / com:Math>, the accuracy of the label determination system 100 may be improved. In some embodiments, the label determination system 100 may re-assign labels for a genotype X that was previously assigned labels based on earlier annotations. In such an embodiment, the label determination system 100 may use annotations <com:Math><semantics>Aw<annotation encoding="application / x-tex">A_w< / annotation>< / semantics>< / com:Math> that are not based on the learned annotations <com:Math><semantics>AX,w<annotation encoding="application / x-tex">A_{X,w}< / annotation>< / semantics>< / com:Math> for input sample genotype X when assigning new labels to the input sample genotype X. For example, the set of genotypes <com:Math><semantics>Φ<annotation encoding="application / x-tex">\Phi< / annotation>< / semantics>< / com:Math> that the annotation <com:Math><semantics>Aw(k,u)<annotation encoding="application / x-tex">A_w(k,u)< / annotation>< / semantics>< / com:Math> is based on excludes the input sample genotype X. After labels are determined for genotype X, the learned annotations <com:Math><semantics>AX,w<annotation encoding="application / x-tex">A_{X,w}< / annotation>< / semantics>< / com:Math> for X may be updated for use in determining annotations <com:Math><semantics>AX<annotation encoding="application / x-tex">A_X< / annotation>< / semantics>< / com:Math> used to assign labels for other genotypes.
[0076] In some embodiments, a set of genotypes is divided into batches. Each batch <com:Math><semantics>β<annotation encoding="application / x-tex">\beta< / annotation>< / semantics>< / com:Math> is associated with annotations calculated based on the genotypes in the batch <com:Math><semantics>β<annotation encoding="application / x-tex">\beta< / annotation>< / semantics>< / com:Math>. The batch annotations for a batch <com:Math><semantics>β<annotation encoding="application / x-tex">\beta< / annotation>< / semantics>< / com:Math> may be based on the annotations <com:Math><semantics>AX,w<annotation encoding="application / x-tex">A_{X,w}< / annotation>< / semantics>< / com:Math> for each input sample genotype X in the batch <com:Math><semantics>β<annotation encoding="application / x-tex">\beta< / annotation>< / semantics>< / com:Math>. The annotation <com:Math><semantics>Aw<annotation encoding="application / x-tex">A_w< / annotation>< / semantics>< / com:Math> used when determining labels for a genotype X in batch <com:Math><semantics>β<annotation encoding="application / x-tex">\beta< / annotation>< / semantics>< / com:Math> may be based on the batch annotations of the other batches, but not on the batch annotations of the batch <com:Math><semantics>β<annotation encoding="application / x-tex">\beta< / annotation>< / semantics>< / com:Math> itself. Forward-Backward Calculation for Diploid HMM
[0077] The diploid HMM module 150 may calculate a forward function <com:Math><semantics>fG,w<annotation encoding="application / x-tex">f_{G,w}< / annotation>< / semantics>< / com:Math> for a genotype G in a window w. The diploid HMM module 150 may calculate the forward function <com:Math><semantics>fG,w<annotation encoding="application / x-tex">f_{G,w}< / annotation>< / semantics>< / com:Math> based on a haploid MM <com:Math><semantics>Hw<annotation encoding="application / x-tex">H_w< / annotation>< / semantics>< / com:Math> for window w. The haploid MM <com:Math><semantics>Hw<annotation encoding="application / x-tex">H_w< / annotation>< / semantics>< / com:Math> may include a transition function t and a transition probability function <com:Math><semantics>ρ<annotation encoding="application / x-tex">\rho< / annotation>< / semantics>< / com:Math>. The haploid MM <com:Math><semantics>Hw<annotation encoding="application / x-tex">H_w< / annotation>< / semantics>< / com:Math> may start at a start state <com:Math><semantics>Sw<annotation encoding="application / x-tex">S_w< / annotation>< / semantics>< / com:Math>. The procedure by which the diploid HMM module 150 calculates the forward function <com:Math><semantics>fG,w<annotation encoding="application / x-tex">f_{G,w}< / annotation>< / semantics>< / com:Math> may return the forward function <com:Math><semantics>fG,w<annotation encoding="application / x-tex">f_{G,w}< / annotation>< / semantics>< / com:Math>; a mapping from each level d to the set of possible diploid states for genotype G at that level d, <com:Math><semantics>αG,w(d)<annotation encoding="application / x-tex">\alpha_{G,w}(d)< / annotation>< / semantics>< / com:Math>; and a mapping of each diploid state in <com:Math><semantics>αG,w<annotation encoding="application / x-tex">\alpha_{G,w}< / annotation>< / semantics>< / com:Math> to the set of its possible transitions for genotype G and the corresponding transition probabilities, <com:Math><semantics>ΩG,w<annotation encoding="application / x-tex">\Omega_{G,w}< / annotation>< / semantics>< / com:Math>.
[0078] Pseudo-code for performing the forward calculation with a genotype G for a window w, according to an example embodiment, is below: procedure DIPLOID-FORWARD(<com:Math><semantics>G,Hw,w<annotation encoding="application / x-tex">G, H_w, w< / annotation>< / semantics>< / com:Math>) Let <com:Math><semantics>Dw<annotation encoding="application / x-tex">D_w< / annotation>< / semantics>< / com:Math> be the number of SNPs in the window w Let <com:Math><semantics>𝕊w<annotation encoding="application / x-tex">\mathbb{S}_w< / annotation>< / semantics>< / com:Math> be the start state of the Markov model <com:Math><semantics>Hw<annotation encoding="application / x-tex">H_w< / annotation>< / semantics>< / com:Math> Let t and <com:Math><semantics>ρ<annotation encoding="application / x-tex">\rho< / annotation>< / semantics>< / com:Math> be the transition functions and transition probability functions for <com:Math><semantics>Hw<annotation encoding="application / x-tex">H_w< / annotation>< / semantics>< / com:Math> Let <com:Math><semantics>αG,w(d)<annotation encoding="application / x-tex">\alpha_{G,w}(d)< / annotation>< / semantics>< / com:Math> be an initially empty list of diploid states at level d Let <com:Math><semantics>ΩG,w<annotation encoding="application / x-tex">\Omega_{G,w}< / annotation>< / semantics>< / com:Math> be an initially empty mapping of diploid states to a list of possible transitions [Image disponible dans le document PDF, Image available in the PDF document] Add state (<com:Math><semantics>𝕊w,w<annotation encoding="application / x-tex">\mathbb{S}_{w,w}< / annotation>< / semantics>< / com:Math>) to <com:Math><semantics>αG,w(0)<annotation encoding="application / x-tex">\alpha_{G,w}(0)< / annotation>< / semantics>< / com:Math> for <com:Math><semantics>d∈0,1,2,...,Dw<annotation encoding="application / x-tex">d \in 0,1,2,...,D_w< / annotation>< / semantics>< / com:Math>-1 do Let <com:Math><semantics>g=G(Sw+d)<annotation encoding="application / x-tex">g = G_{(S_w + d)}< / annotation>< / semantics>< / com:Math> be the genotype at SNP <com:Math><semantics>d+1<annotation encoding="application / x-tex">d+1< / annotation>< / semantics>< / com:Math> of the window <com:Math><semantics>w<annotation encoding="application / x-tex">w< / annotation>< / semantics>< / com:Math>. for each diploid state <com:Math><semantics>(u1,u2)∈αG,w(d)<annotation encoding="application / x-tex">(u_1,u_2) \in \alpha_{G,w}(d)< / annotation>< / semantics>< / com:Math> do initialize P to an empty list of diploid states and transition likelihood initialize <com:Math><semantics>ΩG,w(u1,u2)<annotation encoding="application / x-tex">\Omega_{G,w}(u_1,u_2)< / annotation>< / semantics>< / com:Math> to an empty list of transitions and transition likelihoods if g is homozygous 0 then [Image disponible dans le document PDF, Image available in the PDF document] else if g is homozygous 1 then [Image disponible dans le document PDF, Image available in the PDF document] else if g is homozygous 1 then [Image disponible dans le document PDF, Image available in the PDF document] [Image disponible dans le document PDF, Image available in the PDF document] else if g is missing then [Image disponible dans le document PDF, Image available in the PDF document] [Image disponible dans le document PDF, Image available in the PDF document] [Image disponible dans le document PDF, Image available in the PDF document] [Image disponible dans le document PDF, Image available in the PDF document] end if for each <com:Math><semantics>((v1,v2),ω)<annotation encoding="application / x-tex">((v_1, v_2), \omega)< / annotation>< / semantics>< / com:Math> in <com:Math><semantics>ΩG,v(u1,u2)<annotation encoding="application / x-tex">\Omega_{G,v}(u_1, u_2)< / annotation>< / semantics>< / com:Math> do if <com:Math><semantics>(v1,v2)<annotation encoding="application / x-tex">(v_1,v_2)< / annotation>< / semantics>< / com:Math> is not in <com:Math><semantics>αG,w(d+1)<annotation encoding="application / x-tex">\alpha_{G,w}(d+1)< / annotation>< / semantics>< / com:Math> then initialize <com:Math><semantics>fG,w(v1,v2)←0<annotation encoding="application / x-tex">f_{G,w}(v_1,v_2) \leftarrow 0< / annotation>< / semantics>< / com:Math> add <com:Math><semantics>(v1,v2)<annotation encoding="application / x-tex">(v_1,v_2)< / annotation>< / semantics>< / com:Math> to <com:Math><semantics>αG,w(d+1)<annotation encoding="application / x-tex">\alpha_{G,w}(d+1)< / annotation>< / semantics>< / com:Math> end if <com:Math><semantics>fG,w(v1,v2)←fG,w(v1,v2)+ω×fG,w(v1,v2)<annotation encoding="application / x-tex">f_{G,w}(v_1,v_2) \leftarrow f_{G,w}(v_1,v_2) + \omega \times f_{G,w}(v_1,v_2)< / annotation>< / semantics>< / com:Math> end for end for <com:Math><semantics>TRIM(αG,w(d+1))<annotation encoding="application / x-tex">TRIM(\alpha_{G,w}(d+1))< / annotation>< / semantics>< / com:Math> end for return <com:Math><semantics>fG,w<annotation encoding="application / x-tex">f_{G,w}< / annotation>< / semantics>< / com:Math>, <com:Math><semantics>ΩG,w<annotation encoding="application / x-tex">\Omega_{G,w}< / annotation>< / semantics>< / com:Math>, <com:Math><semantics>αG,w<annotation encoding="application / x-tex">\alpha_{G,w}< / annotation>< / semantics>< / com:Math>
[0079] This example of a DIPLOID-FORWARD procedure determines the forward probabilities in a window w for a diploid HMM based on the genotype G and the haploid MM. The procedure determines every possible transition to which the genotype G may correspond. In the example of the DIPLOID-FORWARD procedure, the transitions are stored in <com:Math><semantics>ΩG,w(u1,u2)<annotation encoding="application / x-tex">\Omega_{G,w}(u_1,u_2)< / annotation>< / semantics>< / com:Math>, which maps a diploid state <com:Math><semantics>(u1,u2)<annotation encoding="application / x-tex">(u_1,u_2)< / annotation>< / semantics>< / com:Math> to a tuple <com:Math><semantics>((v1,v2),ω)<annotation encoding="application / x-tex">((v_1,v_2),\omega)< / annotation>< / semantics>< / com:Math> where <com:Math><semantics>(v1,v2)<annotation encoding="application / x-tex">(v_1,v_2)< / annotation>< / semantics>< / com:Math> is the diploid state that diploid state <com:Math><semantics>(u1,u2)<annotation encoding="application / x-tex">(u_1,u_2)< / annotation>< / semantics>< / com:Math> transitions to and where <com:Math><semantics>ω<annotation encoding="application / x-tex">\omega< / annotation>< / semantics>< / com:Math> is the probability of the transition, which is based on the probabilities of the haploid transitions in the haploid MM <com:Math><semantics>Hw<annotation encoding="application / x-tex">H_w< / annotation>< / semantics>< / com:Math>. Thus, the DIPLOID-FORWARD procedure builds a diploid HMM 300 for the genotype G characterized by the set of transitions <com:Math><semantics>ΩG,w<annotation encoding="application / x-tex">\Omega_{G,w}< / annotation>< / semantics>< / com:Math> while calculating the forward function <com:Math><semantics>fG,w<annotation encoding="application / x-tex">f_{G,w}< / annotation>< / semantics>< / com:Math>.
[0080] This example of a DIPLOID-FORWARD procedure calculates the forward function for each diploid state <com:Math><semantics>(v1,v2)<annotation encoding="application / x-tex">(v_1, v_2)< / annotation>< / semantics>< / com:Math> at level d based on the probabilities of the diploid states at level d - 1 that transition to it and the respective probabilities of those transitions. The procedure also generates a mapping <com:Math><semantics>αG,w<annotation encoding="application / x-tex">\alpha_{G,w}< / annotation>< / semantics>< / com:Math> of each level d to the set of diploid states at level d to which the genotype G may possibly correspond. The TRIM(<com:Math><semantics>αG,w(d+1)<annotation encoding="application / x-tex">\alpha_{G,w}(d+1)< / annotation>< / semantics>< / com:Math>) subroutine may remove low probability diploid states from the list of diploid states <com:Math><semantics>αG,w(d+1)<annotation encoding="application / x-tex">\alpha_{G,w}(d+1)< / annotation>< / semantics>< / com:Math>. TRIM may remove diploid states with probabilities smaller than some threshold value, or remove probabilities up to a certain likelihood mass threshold. In some embodiments, the TRIM subroutine is omitted.
[0081] The diploid HMM module 150 may also calculate a backward function <com:Math><semantics>bw,G<annotation encoding="application / x-tex">b_{w,G}< / annotation>< / semantics>< / com:Math> for a genotype G in a window w. The diploid HMM module 150 may calculate the backward function <com:Math><semantics>bw,G<annotation encoding="application / x-tex">b_{w,G}< / annotation>< / semantics>< / com:Math> based on the mappings <com:Math><semantics>αG,w<annotation encoding="application / x-tex">\alpha_{G,w}< / annotation>< / semantics>< / com:Math> and <com:Math><semantics>ΩG,w<annotation encoding="application / x-tex">\Omega_{G,w}< / annotation>< / semantics>< / com:Math> generated by the procedure that calculated the forward function. Pseudo-code for performing the backward calculation with a genotype G for a window w, according to an example embodiment, is below: procedure DIPLOID-BACKWARD(<com:Math><semantics>αG,w<annotation encoding="application / x-tex">\alpha_{G,w}< / annotation>< / semantics>< / com:Math>, <com:Math><semantics>ΩG,w<annotation encoding="application / x-tex">\Omega_{G,w}< / annotation>< / semantics>< / com:Math>, <com:Math><semantics>w<annotation encoding="application / x-tex">w< / annotation>< / semantics>< / com:Math>) initialize <com:Math><semantics>bG,w←∅<annotation encoding="application / x-tex">b_{G,w} \leftarrow \emptyset< / annotation>< / semantics>< / com:Math> <com:Math><semantics>bG,w(𝔼w,𝔼w)←1<annotation encoding="application / x-tex">b_{G,w}(\mathbb{E}_{w}, \mathbb{E}_{w}) \leftarrow 1< / annotation>< / semantics>< / com:Math> for <com:Math><semantics>d∈Dw−1,Dw−2,...,2,1,0<annotation encoding="application / x-tex">d \in D_w - 1, D_w - 2, ..., 2, 1, 0< / annotation>< / semantics>< / com:Math> do for each diploid state <com:Math><semantics>(u1,u2)∈αG,w(d)<annotation encoding="application / x-tex">(u_1, u_2) \in \alpha_{G,w}(d)< / annotation>< / semantics>< / com:Math> initialize <com:Math><semantics>bG,w(u1,u2)←0<annotation encoding="application / x-tex">b_{G,w}(u_1,u_2) \leftarrow 0< / annotation>< / semantics>< / com:Math> for each <com:Math><semantics>((v1,v2),ω)<annotation encoding="application / x-tex">((v_1, v_2), \omega)< / annotation>< / semantics>< / com:Math> in <com:Math><semantics>ΩG,w(u1,u2)<annotation encoding="application / x-tex">\Omega_{G,w}(u_1, u_2)< / annotation>< / semantics>< / com:Math> do <com:Math><semantics>bG,w(u1,u2)←bG,w(u1,u2)+bG,w(v1,v2)×ω<annotation encoding="application / x-tex">b_{G,w}(u_1,u_2) \leftarrow b_{G,w}(u_1,u_2) + b_{G,w}(v_1,v_2) \times \omega< / annotation>< / semantics>< / com:Math> end for end for end for return <com:Math><semantics>bG,w<annotation encoding="application / x-tex">b_{G,w}< / annotation>< / semantics>< / com:Math>
[0082] The DIPLOID-BACKWARD procedure operates similarly to the DIPLOID-FORWARD procedure. The DIPLOID-BACKWARD procedure starts at the end state <com:Math><semantics>(𝔼w,w)<annotation encoding="application / x-tex">(\mathbb{E}_{w,w})< / annotation>< / semantics>< / com:Math> and iteratively steps through the diploid HMM built with the DIPLOID-FORWARD procedure. For a diploid state <com:Math><semantics>(u1,u2)<annotation encoding="application / x-tex">(u_1,u_2)< / annotation>< / semantics>< / com:Math>, the backward function <com:Math><semantics>bG,w(u1,u2)<annotation encoding="application / x-tex">b_{G,w}(u_1,u_2)< / annotation>< / semantics>< / com:Math> is based on the based on the backwards probabilities of the diploid states that transition to the diploid state <com:Math><semantics>(u1,u2)<annotation encoding="application / x-tex">(u_1, u_2)< / annotation>< / semantics>< / com:Math>. The backward function <com:Math><semantics>bG,w(u1,u2)<annotation encoding="application / x-tex">b_{G,w}(u_1, u_2)< / annotation>< / semantics>< / com:Math> is based on the product of the backward functions <com:Math><semantics>bG,w(v1,v2)<annotation encoding="application / x-tex">b_{G,w}(v_1,v_2)< / annotation>< / semantics>< / com:Math> of all the diploid states <com:Math><semantics>(v1,v2)<annotation encoding="application / x-tex">(v_1,v_2)< / annotation>< / semantics>< / com:Math> that transition to the diploid state <com:Math><semantics>(u1,u2)<annotation encoding="application / x-tex">(u_1,u_2)< / annotation>< / semantics>< / com:Math> and the respective probabilities of those transitions. Building the Inter-Window HMM
[0083] The forward functions <com:Math><semantics>FX<annotation encoding="application / x-tex">F_X< / annotation>< / semantics>< / com:Math> and the backwards functions <com:Math><semantics>BX<annotation encoding="application / x-tex">B_X< / annotation>< / semantics>< / com:Math> for an inter-window HMM <com:Math><semantics>MX<annotation encoding="application / x-tex">M_X< / annotation>< / semantics>< / com:Math> that includes W windows may be calculated by the inter-window HMM module 160. The forward and backwards functions of the start state of the inter-window HMM <com:Math><semantics>MX<annotation encoding="application / x-tex">M_X< / annotation>< / semantics>< / com:Math> may be denoted by <com:Math><semantics>FX(0)<annotation encoding="application / x-tex">F_X(0)< / annotation>< / semantics>< / com:Math> and <com:Math><semantics>BX(0)<annotation encoding="application / x-tex">B_X(0)< / annotation>< / semantics>< / com:Math>, respectively. Similarly, the forward and backwards functions of the end state of the inter- window HMM <com:Math><semantics>MX<annotation encoding="application / x-tex">M_X< / annotation>< / semantics>< / com:Math> may be denoted by <com:Math><semantics>FX(W+1)<annotation encoding="application / x-tex">F_X(W+1)< / annotation>< / semantics>< / com:Math> and <com:Math><semantics>BX(W+1)<annotation encoding="application / x-tex">B_X(W+1)< / annotation>< / semantics>< / com:Math>, respectively, and the forwards and backwards functions for a window <com:Math><semantics>w<annotation encoding="application / x-tex">w< / annotation>< / semantics>< / com:Math> <com:Math><semantics>(1≤w≤W)<annotation encoding="application / x-tex">(1 \le w \le W)< / annotation>< / semantics>< / com:Math> and for a label pair <com:Math><semantics>(p,q)<annotation encoding="application / x-tex">(p,q)< / annotation>< / semantics>< / com:Math> may be denoted by <com:Math><semantics>FX(w,p,q)<annotation encoding="application / x-tex">F_X(w,p,q)< / annotation>< / semantics>< / com:Math> and <com:Math><semantics>BX(w,p,q)<annotation encoding="application / x-tex">B_X(w,p,q)< / annotation>< / semantics>< / com:Math>, respectively.
[0084] The inter-window HMM <com:Math><semantics>MX<annotation encoding="application / x-tex">M_X< / annotation>< / semantics>< / com:Math> may include transition probabilities <com:Math><semantics>PX(UX,w,(p,q),(p′,q′))<annotation encoding="application / x-tex">P_X(U_{X,w,(p,q)},(p',q'))< / annotation>< / semantics>< / com:Math> for each transition between states in the HMM <com:Math><semantics>MX<annotation encoding="application / x-tex">M_X< / annotation>< / semantics>< / com:Math>. Some of the transition probabilities <com:Math><semantics>PX(UX,w,(p,q),(p′,q′))<annotation encoding="application / x-tex">P_X(U_{X,w,(p,q)},(p',q'))< / annotation>< / semantics>< / com:Math> may be based on a label probability vector <com:Math><semantics>πX<annotation encoding="application / x-tex">\pi_X< / annotation>< / semantics>< / com:Math>. The inter-window HMM <com:Math><semantics>MX<annotation encoding="application / x-tex">M_X< / annotation>< / semantics>< / com:Math> may also include the label pair probability distribution <com:Math><semantics>EX,w<annotation encoding="application / x-tex">E_{X,w}< / annotation>< / semantics>< / com:Math>. Each label pair probability <com:Math><semantics>EX,w(p,q)<annotation encoding="application / x-tex">E_{X,w}(p,q)< / annotation>< / semantics>< / com:Math> may be the probability of the state <com:Math><semantics>UX,w,(p,q)<annotation encoding="application / x-tex">U_{X,w,(p,q)}< / annotation>< / semantics>< / com:Math> given the observation of window w.
[0085] Pseudo-code for performing the forward–backward calculation, according to an example embodiment, is below: procedure INTER-WINDOW_FORWARD-BACKWARD(<com:Math><semantics>MX<annotation encoding="application / x-tex">M_X< / annotation>< / semantics>< / com:Math>) for <com:Math><semantics>1≤p≤q≤K<annotation encoding="application / x-tex">1 \le p \le q \le K< / annotation>< / semantics>< / com:Math>: [Image disponible dans le document PDF, Image available in the PDF document] [Image disponible dans le document PDF, Image available in the PDF document] end for for <com:Math><semantics>2≤w≤W<annotation encoding="application / x-tex">2 \le w \le W< / annotation>< / semantics>< / com:Math> and for <com:Math><semantics>1≤p≤q≤K<annotation encoding="application / x-tex">1 \le p \le q \le K< / annotation>< / semantics>< / com:Math>: [Image disponible dans le document PDF, Image available in the PDF document] end for [Image disponible dans le document PDF, Image available in the PDF document] for <com:Math><semantics>1≤p≤q≤K<annotation encoding="application / x-tex">1 \le p \le q \le K< / annotation>< / semantics>< / com:Math>: [Image disponible dans le document PDF, Image available in the PDF document] end for [Image disponible dans le document PDF, Image available in the PDF document] for <com:Math><semantics>W−1≤w≤1<annotation encoding="application / x-tex">W - 1 \le w \le 1< / annotation>< / semantics>< / com:Math> and for <com:Math><semantics>1≤p≤q≤K<annotation encoding="application / x-tex">1 \le p \le q \le K< / annotation>< / semantics>< / com:Math>: [Image disponible dans le document PDF, Image available in the PDF document] end for for <com:Math><semantics>1≤p≤q≤K<annotation encoding="application / x-tex">1 \le p \le q \le K< / annotation>< / semantics>< / com:Math>: [Image disponible dans le document PDF, Image available in the PDF document] end for return <com:Math><semantics>FX<annotation encoding="application / x-tex">F_X< / annotation>< / semantics>< / com:Math>, <com:Math><semantics>BX<annotation encoding="application / x-tex">B_X< / annotation>< / semantics>< / com:Math>
[0086] The inter-window HMM module 160 may build an inter-window HMM <com:Math><semantics>MX<annotation encoding="application / x-tex">M_X< / annotation>< / semantics>< / com:Math> for a input sample genotype X. Building the inter-window HMM <com:Math><semantics>MX<annotation encoding="application / x-tex">M_X< / annotation>< / semantics>< / com:Math> may include calculating a label probability vector <com:Math><semantics>πX<annotation encoding="application / x-tex">\pi_X< / annotation>< / semantics>< / com:Math> and the label change probability <com:Math><semantics>τX<annotation encoding="application / x-tex">\tau_X< / annotation>< / semantics>< / com:Math>. The label probability vector <com:Math><semantics>πX<annotation encoding="application / x-tex">\pi_X< / annotation>< / semantics>< / com:Math> may be initialized to a uniform distribution (i.e., <com:Math><semantics>πX,(p,q)=1 / T<annotation encoding="application / x-tex">\pi_{X,(p,q)} = 1 / T< / annotation>< / semantics>< / com:Math> for all <com:Math><semantics>p<annotation encoding="application / x-tex">p< / annotation>< / semantics>< / com:Math> and <com:Math><semantics>q<annotation encoding="application / x-tex">q< / annotation>< / semantics>< / com:Math> where <com:Math><semantics>T=K×(K+1) / 2<annotation encoding="application / x-tex">T = K \times (K+1) / 2< / annotation>< / semantics>< / com:Math>). In some embodiments, because each unordered pair of labels with different labels corresponds to two ordered pairs while each unordered pair of the same label corresponds to a single ordered pair, the label probability vector <com:Math><semantics>πX<annotation encoding="application / x-tex">\pi_X< / annotation>< / semantics>< / com:Math> is initialized to <com:Math><semantics>πX,(p,q)=2 / K2<annotation encoding="application / x-tex">\pi_{X,(p,q)} = 2 / K^2< / annotation>< / semantics>< / com:Math> for all values of p and q where <com:Math><semantics>p≠q<annotation encoding="application / x-tex">p \neq q< / annotation>< / semantics>< / com:Math> and <com:Math><semantics>πX,(p,p)=1 / K2<annotation encoding="application / x-tex">\pi_{X,(p,p)} = 1 / K^2< / annotation>< / semantics>< / com:Math> for all p. The label probability vector <com:Math><semantics>πX<annotation encoding="application / x-tex">\pi_X< / annotation>< / semantics>< / com:Math> may be iteratively updated with expectation-maximization (e.g., with the Baum-Welch algorithm). In some embodiments, the inter-window HMM module may perform N iterations of the Baum-Welch algorithm to calculate the label probability vector <com:Math><semantics>πX<annotation encoding="application / x-tex">\pi_X< / annotation>< / semantics>< / com:Math>. The label change probability <com:Math><semantics>τX<annotation encoding="application / x-tex">\tau_X< / annotation>< / semantics>< / com:Math> may be initialized to a low value (e.g., between 0.5 to <com:Math><semantics>10−4<annotation encoding="application / x-tex">10^{-4}< / annotation>< / semantics>< / com:Math>) and iteratively updated. Pseudo-code for building the inter-window HMM <com:Math><semantics>MX<annotation encoding="application / x-tex">M_X< / annotation>< / semantics>< / com:Math>, according to an example embodiment, is below: procedure BUILD_INTER-WINDOW_HMM(<com:Math><semantics>EX,w<annotation encoding="application / x-tex">E_{X,w}< / annotation>< / semantics>< / com:Math>) initialize the inter-window HMM <com:Math><semantics>Mx<annotation encoding="application / x-tex">M_x< / annotation>< / semantics>< / com:Math> where the label probability vector of <com:Math><semantics>MX<annotation encoding="application / x-tex">M_X< / annotation>< / semantics>< / com:Math> is <com:Math><semantics>πX<annotation encoding="application / x-tex">\pi_X< / annotation>< / semantics>< / com:Math>, where the label change probability of <com:Math><semantics>MX<annotation encoding="application / x-tex">M_X< / annotation>< / semantics>< / com:Math> is <com:Math><semantics>τX<annotation encoding="application / x-tex">\tau_X< / annotation>< / semantics>< / com:Math>, and where the emission probabilities of <com:Math><semantics>MX<annotation encoding="application / x-tex">M_X< / annotation>< / semantics>< / com:Math> is <com:Math><semantics>EX,w<annotation encoding="application / x-tex">E_{X,w}< / annotation>< / semantics>< / com:Math> [Image disponible dans le document PDF, Image available in the PDF document] for <com:Math><semantics>1≤p≤q≤K<annotation encoding="application / x-tex">1 \le p \le q \le K< / annotation>< / semantics>< / com:Math>: [Image disponible dans le document PDF, Image available in the PDF document] end for [Image disponible dans le document PDF, Image available in the PDF document] repeat (N) [Image disponible dans le document PDF, Image available in the PDF document] for <com:Math><semantics>1≤p≤q≤K<annotation encoding="application / x-tex">1 \le p \le q \le K< / annotation>< / semantics>< / com:Math>: [Image disponible dans le document PDF, Image available in the PDF document] end for for <com:Math><semantics>1≤p≤q≤K<annotation encoding="application / x-tex">1 \le p \le q \le K< / annotation>< / semantics>< / com:Math>: [Image disponible dans le document PDF, Image available in the PDF document] end for [Image disponible dans le document PDF, Image available in the PDF document] [Image disponible dans le document PDF, Image available in the PDF document] end repeat loop return <com:Math><semantics>Mx<annotation encoding="application / x-tex">M_x< / annotation>< / semantics>< / com:Math>
[0087] In the example BUILD_INTER-WINDOW_HMM procedure, the label pair expectation <com:Math><semantics>𝔼[πX,(p,q)]<annotation encoding="application / x-tex">\mathbb{E}[\pi_{X,(p,q)}]< / annotation>< / semantics>< / com:Math> is calculated for each of the pair of labels <com:Math><semantics>(p,q)<annotation encoding="application / x-tex">(p,q)< / annotation>< / semantics>< / com:Math>. The label pair expectation <com:Math><semantics>𝔼[πX,(p,q)]<annotation encoding="application / x-tex">\mathbb{E}[\pi_{X,(p,q)}]< / annotation>< / semantics>< / com:Math> is the sum of the probabilities of each state <com:Math><semantics>UX,w,(p,q)<annotation encoding="application / x-tex">U_{X,w,(p,q)}< / annotation>< / semantics>< / com:Math> for each window w and is therefore equal to the expected number of windows w that have a hidden state <com:Math><semantics>UX,w,(p,q)<annotation encoding="application / x-tex">U_{X,w,(p,q)}< / annotation>< / semantics>< / com:Math> corresponding to the label pair <com:Math><semantics>(p,q)<annotation encoding="application / x-tex">(p,q)< / annotation>< / semantics>< / com:Math>. Each label probability <com:Math><semantics>πX,(p,q)<annotation encoding="application / x-tex">\pi_{X,(p,q)}< / annotation>< / semantics>< / com:Math> is updated to a new value: the label pair expectation <com:Math><semantics>𝑬[πX,(p,q)]<annotation encoding="application / x-tex">\mathbf{E}[\pi_{X,(p,q)}]< / annotation>< / semantics>< / com:Math> of the label pair <com:Math><semantics>(p,q)<annotation encoding="application / x-tex">(p,q)< / annotation>< / semantics>< / com:Math> divided by the sum of label pair expectations for all label pair probabilities, so that the label probabilities <com:Math><semantics>πX,(p,q)<annotation encoding="application / x-tex">\pi_{X,(p,q)}< / annotation>< / semantics>< / com:Math> sum to unity (i.e., <com:Math><semantics>ΣπX=1<annotation encoding="application / x-tex">\Sigma \pi_X = 1< / annotation>< / semantics>< / com:Math>).
[0088] In the example BUILD_INTER-WINDOW_HMM procedure, the label change probability <com:Math><semantics>τX<annotation encoding="application / x-tex">\tau_X< / annotation>< / semantics>< / com:Math> is initialized to 10<com:Sup>-3< / com:Sup> and then iteratively updated to the expected number of transitions that do not change label assignments. That is, the label change probability <com:Math><semantics>τX<annotation encoding="application / x-tex">\tau_X< / annotation>< / semantics>< / com:Math> is updated to the complement of the expected number of transitions between states that correspond to the same labels (i.e., the expected number of transitions from a state <com:Math><semantics>UX,w+1,(p,q)<annotation encoding="application / x-tex">U_{X,w+1,(p,q)}< / annotation>< / semantics>< / com:Math> to a state <com:Math><semantics>UX,w+1,(p,q)<annotation encoding="application / x-tex">U_{X,w+1,(p,q)}< / annotation>< / semantics>< / com:Math>) divided by the expected number of all transitions between states. In the example BUILD_INTER-WINDOW_HMM procedure, the expected number of all transitions between states is represented as <com:Math><semantics>σ<annotation encoding="application / x-tex">\sigma< / annotation>< / semantics>< / com:Math>. Additional Considerations
[0089] The label determination system 100 is implemented using one or more computers having one or more processors executing application code to perform the steps described herein, and data may be stored on any conventional non-transitory storage medium and, where appropriate, include a conventional database server implementation. For purposes of clarity and because they are well known to those of skill in the art, various components of a computer system, for example, processors, memory, input devices, network devices and the like are not shown in Fig. 1. In some embodiments, a distributed computing architecture is used to implement the described features. One example of such a distributed computing platform is the Apache Hadoop project available from the Apache Software Foundation.
[0090] In addition to the embodiments specifically described above, those of skill in the art will appreciate that the invention may additionally be practiced in other embodiments. Within this written description, the particular naming of the components, capitalization of terms, the attributes, data structures, or any other programming or structural aspect is not mandatory or significant unless otherwise noted, and the mechanisms that implement the described invention or its features may have different names, formats, or protocols. Further, the system may be implemented via a combination of hardware and software, as described, or entirely in hardware elements. Also, the particular division of functionality between the various system components described here is not mandatory; functions performed by a single module or system component may instead be performed by multiple components, and functions performed by multiple components may instead be performed by a single component. Likewise, the order in which method steps are performed is not mandatory unless otherwise noted or logically required. It should be noted that the process steps and instructions of the present invention could be embodied in software, firmware or hardware, and when embodied in software, could be downloaded to reside on and be operated from different platforms used by real time network operating systems.
[0091] Algorithmic descriptions and representations included in this description are understood to be implemented by computer programs. Furthermore, it has also proven convenient at times, to refer to these arrangements of operations as modules or code devices, without loss of generality.
[0092] Unless otherwise indicated, discussions utilizing terms such as "selecting" or "computing" or "determining" or the like refer to the action and processes of a computer system, or similar electronic computing device, that manipulates and transforms data represented as physical (electronic) quantities within the computer system memories or registers or other such information storage, transmission or display devices.
[0093] The algorithms and displays presented are not inherently related to any particular computer or other apparatus. Various general-purpose systems may also be used with programs in accordance with the teachings above, or it may prove convenient to construct more specialized apparatus to perform the required method steps. The required structure for a variety of these systems will appear from the description above. In addition, a variety of programming languages may be used to implement the teachings above.
[0094] Finally, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, the disclosure of the present invention is intended to be illustrative, but not limiting, of the scope of the invention.
Claims
CLAIMS:
1. A computer-implemented method for assigning, to an input sample genotype, one or more labels from a set of labels, the method comprising: generating the input sample genotype using a DNA extraction service, wherein the input sample genotype is generated at least in part by the DNA extraction service genotyping a biological sample received from a respective individual; accessing the input sample genotype; dividing the input sample genotype into a plurality of windows of sequential single nucleotide polymorphisms (SNPs); building, for each window, a diploid hidden Markov model (HMM) based on the input sample genotype, wherein each diploid state in the diploid HMM is a reduced state corresponding to an unordered pair of haploid states from a haploid Markov model (MM) for the window; calculating, for each diploid state in each diploid HMM, a diploid state probability indicating a likelihood that the input sample genotype corresponds to the diploid state; accessing, for each window, a set of annotations, each annotation corresponding to a haploid state from the haploid MM for the window and to a label of the set of labels, wherein the annotation indicates a probability that a haplotype having the label corresponds to the haploid state; calculating, for each window, a label pair probability distribution based on the set of annotations for the window and the diploid state probabilities for the diploid HMM of the window; building an inter-window HMM, the inter-window HMM including a plurality of states that each correspond to a pair of labels and a window, wherein the inter-window HMM is based on the label pair probability distribution for each window; trimming the inter-window HMM to remove transitions between states that have no common labels to simplify the inter-window HMM; and assigning the one or more labels to the input sample genotype based on the inter- window HMM.
2. The method of claim 1, wherein, for each label pair probability distribution for a respective window: the label pair probability distribution includes a label pair probability for each of a plurality of label pairs, each including a first label and a second label from the set of labels, and the label pair probability of the label pair probability distribution is based on the annotations for the window and the first label and the annotations for the window and the second label.
3. The method of claim 2, wherein each label pair probability for each label pair probability distribution for a respective window is proportional to the probability of the SNPs of the input sample genotype in the window given the pair of labels.
4. The method of claim 1, wherein, for each window, the label pair probability distribution is used as emission probabilities for the states in the inter-window HMM corresponding to the window.
5. The method of claim 1, wherein assigning the one or more labels to the input sample genotype comprises at least one from the group consisting of calculating a Viterbi path for the inter-window HMM, calculating a plurality of stochastic paths calculated for the inter-window HMM, and determining, for each of the one or more labels, a proportion of the input sample genotype that correspond to the label.
6. The method of claim 1, wherein assigning the one or more labels to the input sample genotype comprises: accessing a second genotype; determining one or more overlapping genetic regions between the input sample genotype and the second genotype; and assigning the one or more labels for the one or more overlapping genetic regions.
7. The method of claim 1, wherein assigning the one or more labels to the input sample genotype comprises: accessing a second genotype; determining an overlapping genetic region between the input sample genotype and the second genotype; and assigning the one or more labels for the overlapping genetic region.
8. The method of claim 1, wherein each label in the set of labels corresponds to an ethnic origin group.
9. The method of claim 1, further comprising calculating a label probability vector for the inter-window HMM based on the label pair probability distributions, wherein transition probabilities of the inter-window HMM are based on the label probability vector.
10. The method of claim 9, further comprising calculating a label change probability for the inter-window HMM based on the label pair probability distributions, the label change probability indicating a likelihood that two sequential states in sequential windows do not correspond to the pair of labels given that sequential windows correspond to a same chromosome, wherein transition probabilities of the inter-window HMM are based on the label probability vector.
11. A non-transitory computer-readable storage medium storing executable computer program instructions for assigning, to an input sample genotype, one or more labels from a set of labels, the computer program instructions when executed by one or more computer processors cause the one or more computer processors to perform steps comprising: generating the input sample genotype using at least one laboratory, the input sample genotype generated by at least in part by, sequencing, at the at least one laboratory, a biological sample received from a respective individual; accessing the input sample genotype; dividing the input sample genotype into a plurality of windows of sequential single nucleotide polymorphisms (SNPs); building, for each window, a diploid hidden Markov model (HMM) based on the input sample genotype, wherein each diploid state in the diploid HMM is a reduced state corresponding to an unordered pair of haploid states from a haploid Markov model (MM) for the window; calculating, for each diploid state in each diploid HMM, a diploid state probability indicating a likelihood that the input sample genotype corresponds to the diploid state; accessing, for each window, a set of annotations, each annotation corresponding to a haploid state from the haploid MM for the window and to a label of the set of labels, wherein the annotation indicates a probability that a haplotype having the label corresponds to the haploid state; calculating, for each window, a label pair probability distribution based on the set of annotations for the window and the diploid state probabilities for the diploid HMM of the window; building an inter-window HMM, the inter-window HMM including a plurality of states that each correspond to a pair of labels and a window, wherein the inter-window HMM is based on the label pair probability distribution for each window; trimming the inter-window HMM to remove transitions between states that have no common labels to simplify the inter-window HMM; and assigning the one or more labels to the input sample genotype based on the inter- window HMM.
12. The computer-readable storage medium of claim 11, wherein, for each label pair probability distribution for a respective window: the label pair probability distribution includes a label pair probability for each of a plurality of label pairs, each including a first label and a second label from the set of labels, and the label pair probability of the label pair probability distribution is based on the annotations for the window and the first label and the annotations for the window and the second label.
13. The computer-readable storage medium of claim 12, wherein each label pair probability for each label pair probability distribution for a respective window is proportional to the probability of the SNPs of the input sample genotype in the window given the pair of labels.
14. The computer-readable storage medium of claim 11, wherein, for each window, the label pair probability distribution is used as emission probabilities for the states in the inter-window HMM corresponding to the window.
15. The computer-readable storage medium of claim 11, wherein assigning the one or more labels to the input sample genotype comprises at least one from the group consisting of calculating a Viterbi path for the inter-window HMM, calculating a plurality of stochastic paths calculated for the inter-window HMM, and determining, for each of the one or more labels, a proportion of the input sample genotype that correspond to the label.
16. The computer-readable storage medium of claim 11, further comprising instructions for: calculating a probability that a haplotype of the input sample genotype corresponds to a label of the set of labels in a window of the plurality of windows; calculating new annotations for the label based on the window; and updating the annotations based on the new annotations and based on the probability that the haplotype of the input sample genotype corresponds to the label in the window.
17. The computer-readable storage medium of claim 11, wherein assigning the one or more labels to the input sample genotype comprises: accessing a second genotype; determining one or more overlapping genetic regions between the input sample genotype and the second genotype; and assigning the one or more labels for the one or more overlapping genetic regions.
18. The computer-readable storage medium of claim 11, wherein each label in the set of labels corresponds to an ethnic origin group.
19. The computer-readable storage medium of claim 11, further comprising instructions for calculating a label probability vector for the inter-window HMM based on the label pair probability distributions, wherein transition probabilities of the inter-window HMM are based on the label probability vector.
