Commit 08993b8c authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

fix flake8

parent 2c1e3d6b
Pipeline #13212 passed with stage
in 1 minute and 18 seconds
......@@ -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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment