Skip to content
GitLab
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
960cb6de
Commit
960cb6de
authored
Feb 18, 2016
by
Bertrand Néron
Browse files
add docstrings
parent
b47d896d
Changes
1
Hide whitespace changes
Inline
Side-by-side
source/_static/code/fasta_object.py
View file @
960cb6de
...
...
@@ -17,6 +17,11 @@ class FastaParser(object):
self
.
_current_sequence
=
''
def
_parse_header
(
self
,
line
):
"""
parse the header line and _current_id|comment|sequence attributes
:param line: the line of header in fasta format
:type line: string
"""
header
=
line
.
split
()
self
.
_current_id
=
header
[
0
]
self
.
_current_comment
=
' '
.
join
(
header
[
1
:])
...
...
@@ -26,6 +31,13 @@ class FastaParser(object):
return
self
def
next
(
self
):
"""
:return: at each call return a new :class:`Sequence` object
:raise: StopIteration
"""
"""
:return:
"""
for
line
in
self
.
_file
:
if
line
.
startswith
(
'>'
):
# a new sequence begin
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment