add Crimea adjustment, fix Belgium database bug, remove printed annotations
@@ -207,7 +207,7 @@ def pre_sort_lat_longs(lat_longs):
if type == "country":
lat_longs_sorted.append("\n")
lat_longs_sorted += regions_list
- lat_longs_sorted.append("\n\n\n")
+ lat_longs_sorted.append("\n")
return lat_longs_sorted
@@ -293,7 +293,7 @@ def read_metadata(metadata):
division = location
location = ""
- countries_to_division = {"Hunan": "China", "Gibraltar": "United Kingdom", "Faroe Islands": "Denmark", "St Eustatius": "Netherlands"}
+ countries_to_division = {"Hunan": "China", "Gibraltar": "United Kingdom", "Faroe Islands": "Denmark", "St Eustatius": "Netherlands", "Crimea": "Ukraine"}
if country in countries_to_division:
additions_to_annotation.append(strain + "\t" + id + "\tcountry\t"+ countries_to_division[country] +" #previously " + country)
@@ -636,8 +636,9 @@ def adjust_to_database(data): #TODO: temporary solution, needs reworking
continue
if division in variants and variants[division] in location_to_arrondissement:
- division_to_correct.append((region, country, division, region, country, variants[division])) #first correct to properly spelled division
- div_to_loc[variants[division]] = (region, country, location_to_arrondissement[variants[division]]) #then to location
+ #division_to_correct.append((region, country, division, region, country, variants[division])) #first correct to properly spelled division
+ #div_to_loc[variants[division]] = (region, country, location_to_arrondissement[variants[division]]) #then to location
+ location_to_correct.append(((region, country, division, location, region, country, location_to_arrondissement[variants[division]], variants[division])))
continue
print("Missing division in " + country + " database: " + bold(division))
if location != "":
@@ -1337,7 +1338,7 @@ if __name__ == '__main__':
for line in additions_to_annotation:
if line in annotations:
continue
- print(line)
+ #print(line)
if "=" not in line:
annot_lines_to_write.append(line)
if len(line.split("\t")) == 4:
