Commit b115e671 authored by Bertrand  NÉRON's avatar Bertrand NÉRON
Browse files

add exercise on reverse complement a sequence

parent 0a9e74b3
......@@ -340,6 +340,26 @@ solution bonus ::
for kmer, occurence in list_of_kmers:
print kmer, " = ", occurence
Exercise
--------
compute the reversed complement of the following sequence: ::
seq = 'acggcaacatggctggccagtgggctctgagaggagaaagtccagtggatgctcttggtctggttcgtgagcgcaacaca'
base_comp = { 'a' : 't',
'c' : 'g',
'g' : 'c',
't' : 'a'}
complement = ''
for base in seq:
complement += base_comp[base]
reverse_comp = complement[::-1]
print reverse_comp
tgtgttgcgctcacgaaccagaccaagagcatccactggactttctcctctcagagcccactggccagccatgttgccgt
Exercise
--------
......
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