Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
metagenedb
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
Metagenomics
metagenedb
Commits
08993b8c
Commit
08993b8c
authored
5 years ago
by
Kenzo-Hugo Hillion
Browse files
Options
Downloads
Patches
Plain Diff
fix flake8
parent
2c1e3d6b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!3
Integrate taxonomy to database
Pipeline
#13212
passed
5 years ago
Stage: lint_test_coverage_backend
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
backend/metagenedb/utils/parsers.py
+17
-16
17 additions, 16 deletions
backend/metagenedb/utils/parsers.py
with
17 additions
and
16 deletions
backend/metagenedb/utils/parsers.py
+
17
−
16
View file @
08993b8c
...
@@ -29,7 +29,7 @@ class KEGGLineParser(object):
...
@@ -29,7 +29,7 @@ class KEGGLineParser(object):
'
long_name
'
:
names
[
1
].
lstrip
(),
'
long_name
'
:
names
[
1
].
lstrip
(),
'
ec_number
'
:
ec_number
'
ec_number
'
:
ec_number
}
}
except
:
except
Exception
:
_LOGGER
.
error
(
f
"
Could not parse:
{
line
.
rstrip
()
}
. Are you sure it comes from KEGG KO list?
"
)
_LOGGER
.
error
(
f
"
Could not parse:
{
line
.
rstrip
()
}
. Are you sure it comes from KEGG KO list?
"
)
raise
raise
...
@@ -61,23 +61,24 @@ class NCBITaxonomyLineParser(object):
...
@@ -61,23 +61,24 @@ class NCBITaxonomyLineParser(object):
comments -- free-text comments and citations
comments -- free-text comments and citations
"""
"""
elements
=
line
.
rstrip
().
split
(
'
|
'
)
elements
=
line
.
rstrip
().
split
(
'
|
'
)
elements
=
[
element
.
strip
()
for
element
in
elements
]
try
:
try
:
return
{
return
{
"
tax_id
"
:
elements
[
0
]
.
strip
()
,
"
tax_id
"
:
elements
[
0
],
"
parent_tax_id
"
:
elements
[
1
]
.
strip
()
,
"
parent_tax_id
"
:
elements
[
1
],
"
rank
"
:
elements
[
2
].
strip
(
),
"
rank
"
:
elements
[
2
].
replace
(
'
'
,
'
_
'
),
"
embl_code
"
:
elements
[
3
]
.
strip
()
,
"
embl_code
"
:
elements
[
3
],
"
division_id
"
:
elements
[
4
]
.
strip
()
,
"
division_id
"
:
elements
[
4
],
"
inherited_div_flag
"
:
elements
[
5
]
.
strip
()
,
"
inherited_div_flag
"
:
elements
[
5
],
"
genetic_code_id
"
:
elements
[
6
]
.
strip
()
,
"
genetic_code_id
"
:
elements
[
6
],
"
inherited_GC_flag
"
:
elements
[
7
]
.
strip
()
,
"
inherited_GC_flag
"
:
elements
[
7
],
"
mitochondrial_genetic_code_id
"
:
elements
[
8
]
.
strip
()
,
"
mitochondrial_genetic_code_id
"
:
elements
[
8
],
"
inherited_MGC_flag
"
:
elements
[
9
]
.
strip
()
,
"
inherited_MGC_flag
"
:
elements
[
9
],
"
GenBank_hidden_flag
"
:
elements
[
10
]
.
strip
()
,
"
GenBank_hidden_flag
"
:
elements
[
10
],
"
hidden_subtree_root_flag
"
:
elements
[
11
]
.
strip
()
,
"
hidden_subtree_root_flag
"
:
elements
[
11
],
"
comments
"
:
elements
[
12
]
.
strip
()
"
comments
"
:
elements
[
12
]
}
}
except
:
except
Exception
:
_LOGGER
.
error
(
f
"
Could not parse:
{
line
.
rstrip
()
}
. Are you sure it comes from nodes.dmp file?
"
)
_LOGGER
.
error
(
f
"
Could not parse:
{
line
.
rstrip
()
}
. Are you sure it comes from nodes.dmp file?
"
)
raise
raise
...
@@ -102,6 +103,6 @@ class NCBITaxonomyLineParser(object):
...
@@ -102,6 +103,6 @@ class NCBITaxonomyLineParser(object):
"
unique_name
"
:
elements
[
2
].
strip
(),
"
unique_name
"
:
elements
[
2
].
strip
(),
"
name_class
"
:
elements
[
3
].
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?
"
)
_LOGGER
.
error
(
f
"
Could not parse:
{
line
.
rstrip
()
}
. Are you sure it comes from nodes.dmp file?
"
)
raise
raise
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