Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python_one_week_4_biologists_solutions
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hub-courses
python_one_week_4_biologists_solutions
Commits
919f6144
Commit
919f6144
authored
1 month ago
by
Bertrand NÉRON
Browse files
Options
Downloads
Patches
Plain Diff
remove exercise in Data_Types
parent
466668a6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/Data_Types.rst
+2
-34
2 additions, 34 deletions
source/Data_Types.rst
with
2 additions
and
34 deletions
source/Data_Types.rst
+
2
−
34
View file @
919f6144
...
@@ -330,39 +330,6 @@ Exercise
...
@@ -330,39 +330,6 @@ Exercise
.. #. Using the shorter string ``s = 'gaattc'`` draw what happens in memory when you reverse ``s``.
.. #. Using the shorter string ``s = 'gaattc'`` draw what happens in memory when you reverse ``s``.
Exercise
--------
| The ``il2_human`` sequence contains 4 cysteins (C) in positions 9, 78, 125, 145.
| We want to generate the sequence of a mutant where the cysteins 78 and 125 are replaced by serins (S)
| Write the pseudocode, before proposing an implementation:
We have to take care of the difference between Python string numbering and usual position numbering:
| C in seq -> in string
| 9 -> 8
| 78 -> 77
| 125 -> 124
| 145 -> 144
| *generate 3 slices from the il2_human*
| *head <- from the begining and cut between the first cystein and the second*
| *body <- include the 2nd and 3rd cystein*
| *tail <- cut after the 3rd cystein until the end*
| *replace body cystein by serin*
| *make new sequence with head body_mutate tail*
::
il2_human = 'MYRMQLLSCIALSLALVTNSAPTSSSTKKTQLQLEHLLLDLQMILNGINNYKNPKLTRMLTFKFYMPKKATELKHLQCLEEELKPLEEVLNLAQSKNFHLRPRDLISNINVIVLELKGSETTFMCEYADETATIVEFLNRWITFCQSIISTLT'
head = il2_human[:77]
body = il2_human[77:125]
tail = il2_human[126:]
body_mutate = body.replace('C', 'S')
il2_mutate = head + body_mutate + tail
Exercise
Exercise
--------
--------
...
@@ -388,7 +355,8 @@ Use the sv40 sequence to test your function.
...
@@ -388,7 +355,8 @@ Use the sv40 sequence to test your function.
>>>
>>>
>>> sequence = fasta_to_one_line(sv40)
>>> sequence = fasta_to_one_line(sv40)
>>> gc_pc = gc_percent(sequence)
>>> gc_pc = gc_percent(sequence)
>>> report = "The sv40 is {0} bp length and has {1:.2%} gc".format(len(sequence), gc_pc)
>>> # report = "The sv40 is {0} bp length and has {1:.2%} gc".format(len(sequence), gc_pc)
>>> report = f"The sv40 is {len(sequence)} bp length and has {gc_pc:.2%} gc"
>>> print report
>>> print report
'The sv40 is 5243 bp length and has 40.80% gc'
'The sv40 is 5243 bp length and has 40.80% gc'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment