consider removed additional info
@@ -126,29 +126,41 @@ def read_data(path):
data = f.readlines()
added = False #only consider newly added additional info
+ removed = False
for i in range(len(data)):
k = data[i].strip("\n")
if k.endswith("info added"):
added = True
+ removed = False
if k.endswith("info changed"): #skip changed info
added = False
- if k.endswith("info removed"): #skip removed info
+ removed = False
+ if k.endswith("info removed"): #consider removed info
added = False
+ removed = True
if ":" in k:
- if added:
+ if added or removed:
(key, content) = cut(k)
key = key.strip()
if key == "gisaid_epi_isl":
id = content
+ if added:
if id in additional_info:
print("WARNING: additional info added two times for same strain! (" + id + ")")
additional_info[id] = {}
else:
+ if added:
additional_info[id][key] = content
+ if removed:
+ if id in additional_info:
+ if key in additional_info[id]:
+ additional_info[id].pop(key)
+ if additional_info[id] == {}:
+ additional_info.pop(id)
return additional_info
@@ -791,6 +803,7 @@ def check_additional_info(additional_info, path_to_config_files, auto):
strain_list = sorted_info[key]
for (id, strain) in strain_list:
if metadata[id]["Nextstrain_clade"] == "21K (Omicron)":
+ if not "ZIP Code" in info:
print(id)
print(info)
print()
