Giter Site home page Giter Site logo

peteprattis / hidden-markov-model-for-sequence-state-decoding Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 29 KB

A Python script that implements an HMM with two states a and b. When the model is in state a it is more likely to emit purines A and G. When it is in state b it is more likely to emit pyramidines C and T. Decode the most likely sequence of states for the GGCT sequence using logarithmic scoring instead of normal probability scoring.

License: MIT License

Python 100.00%
python bioinformatics hmm hmm-viterbi-algorithm decoding states sequence nucleotides student computer-science

hidden-markov-model-for-sequence-state-decoding's Introduction

A Python Program / Project

This is a Python project from my early days as a Computer Science student

This programm was created for the sixth semester class Bioinformatics and is one of the final projects for the class

Description of project

A Python script that implements an HMM with two states a and b. When the model is in state a it is more likely to emit purines A and G. When it is in state b it is more likely to emit pyramidines C and T. Decode the most likely sequence of states for the GGCT sequence using logarithmic scoring instead of normal probability scoring.

Implementtion of project

In more detail, Table A corresponds to:

  1. probability 0.9 to be found from state a to state a and state b to state b
  2. probability 0.1 to be found from state a to b and from state b to a.

Table π corresponds to:
Initial probability 0.5 to be first in state a, and 0.5 to be first in state b.
Finally, our model is described by the last figure that matches the shape of the book, adding the 0.5, 0.5 probabilities we have described above.
Let's make the model more illustrative. This holds that when we are in state a, the probability that A will emit is 0.4, G 0.4, T 0.1 and C 0.1. Also, state b is given the probability of emitting A 0.2, G 0.2, T 0.3 and C 0.3.
Giving better path for Q = GGTC sequence A -> A -> A -> A.
And Viterbi score = ln (0.2) + ln (0.072) + ln (0.00648) + ln (0.0005832) = -1.609 - 2.631 - 5.039 - 7.446 ~ = - 16.725

About this project

  • The comments to make the code understandable, are within the .py archive
  • This project was written in IDLE, Python’s Integrated Development and Learning Environment.
  • This program runs for Python version 2.7
  • This repository was created to show the variety of the work I did and experience I gained as a student

hidden-markov-model-for-sequence-state-decoding's People

Contributors

peteprattis avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.