๐ University of Piraeus ๐ Department of Informatics ๐ Academic Year: 2022 โ 2023 ๐ Course: Bioinformatics ๐ Semester: 6th
Given an HMM with two states, ฮฑ and ฮฒ:
- State ฮฑ favors purines (A, G)
- State ฮฒ favors pyrimidines (C, T) The goal is to decode the most probable state sequence (ฮฑ/ฮฒ) for the observed sequence GGCT using logarithmic scores instead of raw probabilities.
We apply the Viterbi algorithm ๐ค, which uses dynamic programming to find the most probable path of hidden states by:
- Using logarithmic probabilities to avoid underflow
- Tracking scores and backpointers for each state
- Performing backtracking to reconstruct the optimal path
-
Language: Python ๐
-
Library: NumPy
-
Main Components:
emissions
: list of emission symbolsstates
: list of statestransition_prob
: NumPy matrix of transition probabilitiesemission_prob
: NumPy matrix of emission probabilitiesinitial_prob
: initial state probabilitiesscores
,backpointers
: dynamic programming tablesViterbi
: main function implementing the algorithm
1๏ธโฃ Install Python and NumPy (pip install numpy
)
2๏ธโฃ Navigate to the directory containing 11_4.py
3๏ธโฃ Run:
python3 11_4.py
Two players play a game with two โchromosomesโ of length n and m. On each turn, a player can:
- Destroy one chromosome
- Split the other into two non-empty parts The player who removes the last nucleotide wins.
- Read sequences from
.fna
files - Use logical lists (
canWin
,winning
) to track win conditions - Determine which moves lead to victory by simulating all possible splits
- Print the winning splits and identify the winner
-
Language: Python ๐
-
Functions:
loadSeq
: loads a sequence from a filevalidateInput
: checks user inputgame
: runs the main game loop
1๏ธโฃ Install Python
2๏ธโฃ Navigate to the directory containing 6_12.py
3๏ธโฃ Run:
python3 6_12.py
Two players play with two sequences (n, m nucleotides). On each turn, a player removes:
- Two nucleotides from one sequence
- One nucleotide from the other The player who cannot make a move wins.
- Read enzyme sequences from
brain.fna
andliver.fna
- Simulate turns, alternating players
- Identify winning strategies for all combinations of n and m
-
Language: Python ๐
-
Library: Biopython (
pip install biopython
) -
Main Components:
liver_sequences
,brain_sequences
: loaded sequencesmakeMove
: function simulating each turn
1๏ธโฃ Install Python and Biopython (pip install biopython
)
2๏ธโฃ Navigate to the directory containing 6_14.py
3๏ธโฃ Run:
python3 6_14.py
Topic 1
- NumPy Documentation
- Viterbi Algorithm (Wikipedia)
- Bioinformatics course notes, University of Piraeus
- Introduction to Bioinformatics Algorithms, Neil C. Jones & Pavel A. Pevzner
Topic 2
- Bioinformatics course notes, University of Piraeus
- Introduction to Bioinformatics Algorithms, Neil C. Jones & Pavel A. Pevzner
Topic 3