ACGTGTCAAAATCG
has many palindromic subsequences, including ACGCA and AAAA. On the other hand, the subsequence ACT is not palindromic.
Write a function palindromeLength that takes a DNA string. The function must return the length of the longest palindromic subsequence of the given DNA string.
In the following interactive session, we assume the FASTA file data.fna1
to be located in the current directory.
>>> palindromeLength('ACGTGTCAAAATCG') 8 >>> from Bio import SeqIO >>> palindromeLength(*SeqIO.parse('data.fna', 'fasta')) 11