Skip to content
Snippets Groups Projects
Commit b115e671 authored by Bertrand  NÉRON's avatar Bertrand NÉRON
Browse files

add exercise on reverse complement a sequence

parent 0a9e74b3
No related branches found
No related tags found
No related merge requests found
...@@ -340,6 +340,26 @@ solution bonus :: ...@@ -340,6 +340,26 @@ solution bonus ::
for kmer, occurence in list_of_kmers: for kmer, occurence in list_of_kmers:
print kmer, " = ", occurence 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 Exercise
-------- --------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment