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
f732f95e
Unverified
Commit
f732f95e
authored
Jun 07, 2021
by
Bertrand NÉRON
Browse files
fix docstrings in restriction.py
parent
0e7a0e61
Pipeline
#57965
passed with stages
in 13 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
source/_static/code/restriction.py
View file @
f732f95e
from
operator
import
itemgetter
# we decide to implement enzyme as tuple with the following structure
# (
"
name
"
,
"
comment
"
,
"
sequence
"
,
"
cut
"
,
"
end
"
)
# (name, comment, sequence, cut, end)
# 0 1 2 3 4
def
one_enz_one_binding_site
(
dna
,
enzyme
):
"""
:return: the first position of enzyme binding site in dna or None if there is not
...
...
@@ -19,7 +20,7 @@ def one_enz_all_binding_sites(dna, enzyme):
:param dna: the dna sequence to search enzyme binding sites
:type dna: str
:param enzyme: the enzyme to looking for
:type enzyme: a
named
tuple
RestrictEnzyme
:type enzyme: a tuple
(str name, str comment, str sequence, int cut, str end)
:return: all positions of enzyme binding sites in dna
:rtype: list of int
"""
...
...
@@ -36,7 +37,7 @@ def one_enz_all_binding_sites2(dna, enzyme):
:param dna: the dna sequence to search enzyme binding sites
:type dna: str
:param enzyme: the enzyme to looking for
:type enzyme: a
named
tuple
RestrictEnzyme
:type enzyme: a tuple
(str name, str comment, str sequence, int cut, str end)
:return: all positions of enzyme binding sites in dna
:rtype: list of int
"""
...
...
@@ -60,8 +61,8 @@ def binding_sites(dna, enzymes):
:param dna: the dna sequence to search enzyme binding sites
:type dna: str
:param enzyme: the enzyme to looking for
:type enzyme:
a
namedtuple RestrictEnzym
e
:param enzyme
s
: the enzyme
s
to looking for
:type enzyme
s
: a
sequence of enzyme tupl
e
:return: all positions of each enzyme binding sites in dna
:rtype: list of int
"""
...
...
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