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
Siu, Pui Chung
bioinformatics algorithms
Commits
84d81f0f
Commit
84d81f0f
authored
Jul 21, 2021
by
Siu, Pui Chung
Browse files
Upload New File
parent
e8c4a35e
Changes
1
Hide whitespace changes
Inline
Side-by-side
rosalind solutions/Constructing a De Bruijn Graph/debruijngraphv2.py
0 → 100644
View file @
84d81f0f
def
debruijn
(
patterns
):
result
=
{}
for
i
in
patterns
:
if
i
[:
-
1
]
not
in
result
.
keys
():
result
[
i
[:
-
1
]]
=
i
[
1
:]
else
:
result
[
i
[:
-
1
]]
+=
','
+
i
[
1
:]
return
result
if
__name__
==
'__main__'
:
with
open
(
'rosalind_dbru.txt'
,
'r'
)
as
f
:
p
=
[
line
.
strip
()
for
line
in
f
.
readlines
()]
res
=
debruijn
(
p
)
for
i
in
sorted
(
res
.
keys
()):
print
(
i
+
' -> '
+
res
[
i
])
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