A apresentação está carregando. Por favor, espere

A apresentação está carregando. Por favor, espere

Aula Prática Modelagem de Duração

Apresentações semelhantes


Apresentação em tema: "Aula Prática Modelagem de Duração"— Transcrição da apresentação:

1 Aula Prática Modelagem de Duração
Ivan G. Costa Filho Centro de Informática Universidade Federal de Pernambuco

2 Exemplo de HMM Casino Desonesto Σ = {0, 1} (0 for Tails and 1 Heads)
Q = {F,B} – F for Fair & B for Biased coin.

3 Distribuição de Sequencias
Qual a distribuição do tamanho de sequencias do dado justo/injusto? Criar a HMM, gerar dados e plotar gráficos ....

4 Criando o Casino Desonesto
> from ghmm import * > sigma = IntegerRange(1,3) # defining sigma > A = [[0.9, 0.1], [0.1, 0.9]] # transition matrix > #emission probailities > efair = [0.5, 0.5] > eloaded = [3.0/4, 1.0/4] > B = [efair, eloaded] > pi = [0.5, 0.5] #initial state probability > #start a new hmmm > m = HMMFromMatrices(sigma, DiscreteDistribution(sigma), A, B, pi) > print m

5 Gerando dados > # sample data > obs_seq = m.sampleSingle(10000)
> # estimate viterbi > v = m.viterbi(obs_seq) > states = v[0]

6 Distribuições Sequencias I

7 Distribuições Tamanho Sequencias II
> A = [[0.95, 0.05], [0.1, 0.9]] # transition matrix

8 Contando tamanho das Seqüências
# counting distributions distFair = [] distNonFair = [] current = states[0] count = 0 # counting distributions distFair = [] distNonFair = [] current = states[0] count = 0 for i in states: if current == i: count = count + 1 else: if current == 1: distFair.append(count) distNonFair.append(count) current = i count = 0

9 Modeling the Duration of States
Length distribution of region X: Geometric distribution mean = 1/(1-p) 1-p X Y p q 1-q 9

10 Example: exon lengths in genes
Why the algorithm has to be generalized is because in a standard HMM the output in each step would be one base, leading to state durations of geometric length. If we look at empirical data, such as these plots, we see that the intron lengths seem to follow the geometric distribution fairly well, but for the exon that would be a pretty bad model. So in our state space the exons are generalized states, choosing a length from a general distribution and outputting the entire exon in one step, while the intron and intergene states still output one base at a time and follow the geometric distribution. 10

11 Solution : Negative binomial distribution
p p p 1 – p 1 – p 1 – p X(1) X(2) X(n) Y …… Duration in X: m turns, where During first m – 1 turns, exactly n – 1 arrows to next state are followed During mth turn, an arrow to next state is followed 11

12 Solution : Negative binomial distribution
p p p 1 – p 1 – p 1 – p X(1) X(2) X(n) Y …… mean(l) = n*(1-p)/p std(l) = n*(1-p)/p2 12

13 Example: exon lengths in genes
Why the algorithm has to be generalized is because in a standard HMM the output in each step would be one base, leading to state durations of geometric length. If we look at empirical data, such as these plots, we see that the intron lengths seem to follow the geometric distribution fairly well, but for the exon that would be a pretty bad model. So in our state space the exons are generalized states, choosing a length from a general distribution and outputting the entire exon in one step, while the intron and intergene states still output one base at a time and follow the geometric distribution. 13

14 Casino Desonesto Modelagem de Tamanho
[0,0,0.7, 0.3], [0.3,0,0,0.7]] > #emission probailities > efair = [0.5, 0.5] > eloaded = [3.0/4, 1.0/4] > B = [efair, efair, efair, eloaded] > pi = [0.25, 0.25, 0.25, 0.25] #initial state probability > #start a new hmmm > m = HMMFromMatrices(sigma, DiscreteDistribution(sigma), A, B, pi) > ...

15 Distribuições Tamanho Seqüências

16 Lista de Exercicio Dados www.cin.ufpe.br/~igcf/tabc/cpgs.zip
Para ser feita em duplas (todos tem que participar nos projetos) Apresentar dia 20/11. Extender o metodo de deteccao de ilhas para modelagem de tamanho de sequencias Dados

17 Como fazer Extrair dos dados o tamanho das ilhas/nao ilhas
Usar esses dados para definir p e n. Avaliar como no projeto anterior (contig1 e 2 para treino e 3 para validacao). Relatorio Expandir o relatorio anterior, incluido nova analise e comparando com os resultados anteriores. Incluir graficos da predicao X posterior para todos os metodos avaliados.

18 Como fazer - Graficos

19 Material Ver o capitulo 3.4 R Durbin, Sean R Eddy, A Krogh, Biological Sequence Analysis : Probabilistic Models of Proteins and Nucleic Acids, Cambridge University Press. Exercicio de ilhas CpGs inspirados em Dongsup Kim at Korea Advanced Institute of Science and Technology


Carregar ppt "Aula Prática Modelagem de Duração"

Apresentações semelhantes


Anúncios Google