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
e1e73d4c
Commit
e1e73d4c
authored
9 years ago
by
Bertrand Néron
Browse files
Options
Downloads
Patches
Plain Diff
comment is now an optional argumnt of the Sequence init
parent
b5dada79
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/_static/code/fasta_object.py
+5
-5
5 additions, 5 deletions
source/_static/code/fasta_object.py
with
5 additions
and
5 deletions
source/_static/code/fasta_object.py
+
5
−
5
View file @
e1e73d4c
class
Sequence
(
object
):
def
__init__
(
self
,
id_
,
comment
,
sequence
):
def
__init__
(
self
,
id_
,
sequence
,
comment
=
''
):
self
.
id
=
id_
self
.
comment
=
comment
self
.
sequence
=
sequence
...
...
@@ -40,8 +40,8 @@ class FastaParser(object):
# a new sequence begin
if
self
.
_current_id
!=
''
:
new_seq
=
Sequence
(
self
.
_current_id
,
self
.
_current_
comment
,
self
.
_current_
sequence
)
self
.
_current_
sequence
,
comment
=
self
.
_current_
comment
)
self
.
_parse_header
(
line
)
return
new_seq
else
:
...
...
@@ -53,8 +53,8 @@ class FastaParser(object):
raise
StopIteration
()
else
:
new_seq
=
Sequence
(
self
.
_current_id
,
self
.
_current_
comment
,
self
.
_current_
sequence
)
self
.
_current_
sequence
,
comment
=
self
.
_current_
comment
)
self
.
_current_id
=
''
self
.
_current_sequence
=
''
return
new_seq
...
...
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