Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hub-courses
python_one_week_4_biologists_solutions
Commits
b115e671
Commit
b115e671
authored
Aug 11, 2014
by
Bertrand NÉRON
Browse files
add exercise on reverse complement a sequence
parent
0a9e74b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
source/Collection_Data_Types.rst
View file @
b115e671
...
...
@@ -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
--------
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment