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
Metagenomics
metagenedb
Commits
08993b8c
Commit
08993b8c
authored
Jul 16, 2019
by
Kenzo-Hugo Hillion
♻
Browse files
fix flake8
parent
2c1e3d6b
Pipeline
#13212
passed with stage
in 1 minute and 18 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
backend/metagenedb/utils/parsers.py
View file @
08993b8c
...
...
@@ -29,7 +29,7 @@ class KEGGLineParser(object):
'long_name'
:
names
[
1
].
lstrip
(),
'ec_number'
:
ec_number
}
except
:
except
Exception
:
_LOGGER
.
error
(
f
"Could not parse:
{
line
.
rstrip
()
}
. Are you sure it comes from KEGG KO list?"
)
raise
...
...
@@ -61,23 +61,24 @@ class NCBITaxonomyLineParser(object):
comments -- free-text comments and citations
"""
elements
=
line
.
rstrip
().
split
(
'|'
)
elements
=
[
element
.
strip
()
for
element
in
elements
]
try
:
return
{
"tax_id"
:
elements
[
0
]
.
strip
()
,
"parent_tax_id"
:
elements
[
1
]
.
strip
()
,
"rank"
:
elements
[
2
].
strip
(
),
"embl_code"
:
elements
[
3
]
.
strip
()
,
"division_id"
:
elements
[
4
]
.
strip
()
,
"inherited_div_flag"
:
elements
[
5
]
.
strip
()
,
"genetic_code_id"
:
elements
[
6
]
.
strip
()
,
"inherited_GC_flag"
:
elements
[
7
]
.
strip
()
,
"mitochondrial_genetic_code_id"
:
elements
[
8
]
.
strip
()
,
"inherited_MGC_flag"
:
elements
[
9
]
.
strip
()
,
"GenBank_hidden_flag"
:
elements
[
10
]
.
strip
()
,
"hidden_subtree_root_flag"
:
elements
[
11
]
.
strip
()
,
"comments"
:
elements
[
12
]
.
strip
()
"tax_id"
:
elements
[
0
],
"parent_tax_id"
:
elements
[
1
],
"rank"
:
elements
[
2
].
replace
(
' '
,
'_'
),
"embl_code"
:
elements
[
3
],
"division_id"
:
elements
[
4
],
"inherited_div_flag"
:
elements
[
5
],
"genetic_code_id"
:
elements
[
6
],
"inherited_GC_flag"
:
elements
[
7
],
"mitochondrial_genetic_code_id"
:
elements
[
8
],
"inherited_MGC_flag"
:
elements
[
9
],
"GenBank_hidden_flag"
:
elements
[
10
],
"hidden_subtree_root_flag"
:
elements
[
11
],
"comments"
:
elements
[
12
]
}
except
:
except
Exception
:
_LOGGER
.
error
(
f
"Could not parse:
{
line
.
rstrip
()
}
. Are you sure it comes from nodes.dmp file?"
)
raise
...
...
@@ -102,6 +103,6 @@ class NCBITaxonomyLineParser(object):
"unique_name"
:
elements
[
2
].
strip
(),
"name_class"
:
elements
[
3
].
strip
(),
}
except
:
except
Exception
:
_LOGGER
.
error
(
f
"Could not parse:
{
line
.
rstrip
()
}
. Are you sure it comes from nodes.dmp file?"
)
raise
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