Write a function lcs that takes two arguments: i) the location of a FASTA file containing two DNA strings $$v$$ and $$w$$ and ii) another file location. The function must write a longest common subsequence of $$v$$ and $$w$$ in FASTA format to the file whose location is passed as the second argument.

Example

In the following interactive session, we assume the FASTA file data01.fna1 to be located in the current directory.

>>> lcs('data01.fna', 'output01.fna')
>>> print(open('output01.fna').read().rstrip())
>seq01
AACTTG

Resources