def _parse_single_genbank(chunks):
headers_parsers = {
k: globals().get("_parse_{h}".format(h=k.lower()),
_parse_section_default)
for k in _HEADERS}
metadata = dict.fromkeys(_HEADERS)
metadata["REFERENCE"] = []
metadata["FEATURES"] = []
sequence = ""
// each section starts with a HEADER without indent.
section_splitter = yield_section(lambda x: not x[0].isspace(), strip=False)
for section in section_splitter(chunks):
header = section[0].split(None, 1)[0]
parser = headers_parsers[header]
try:
parsed = parser(section)
except:
raise GenbankFormatError(
After Change
section_splitter = yield_section(lambda x: not x[0].isspace(), strip=False)
for section in section_splitter(chunks):
header = section[0].split(None, 1)[0]
parser = globals().get("_parse_%s" % header.lower())
if not parser:
parser = _parse_section_default
if header == "FEATURES":