Commit 71ed45c0 authored by Bertrand Néron's avatar Bertrand Néron
Browse files

mv solution of matrix in dive into function as in course

parent 555491c4
......@@ -492,4 +492,36 @@ This function have to take the phase as parameter
:download:` <_static/code/>` .
\ No newline at end of file
.. _matrix_exercise:
Write a program that calculates the similarity of 2 RNA sequences.
* To compute the similarity you need to parse a file containing the :download:`similarity matrix <_static/data/similarity_matrix>`.
**Hint**: use the module containing the functions that handle a matrix from previous chapter.
put this file in a directory named "my_python_lib" in your home or Desktop
and import it in your current program (the similarity script must be placed elsewhere).
* The similarity of the 2 sequences is the sum of base similarities.
so you have to compare the first base of two sequences and use the matrix to get the similarity
from the similarity table, on so on for all bases then sum these similarities.
First implementation
.. literalinclude:: _static/code/
:language: python
:download:` <_static/code/>` .
Second implementation
.. literalinclude:: _static/code/
:language: python
:download:` <_static/code/>` .
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment