adjust environment check
@@ -326,6 +326,8 @@ def check_environment(strain_list, metadata, annotations_append):
if host != "Environment":
annotations_append.append(strain + "\t" + id + "\t" + "host" + "\t" + "Environment")
print("Sequence " + id + " has " + host + " as host instead of Environment. Correcting annotation was produced.")
+ else:
+ print("No adjustment necessary for " + id + " (host is environment)")
return annotations_append
@@ -654,7 +656,7 @@ def check_additional_info(additional_info, path_to_config_files):
if info in environment:
answer = input("Interpreted as \"Environment\". Press " + bold("ENTER") + " to approve and double check hosts, otherwise press any key: ")
if answer == "":
- annotations_append = check_environment(strain_list, metadata. annotations_append)
+ annotations_append = check_environment(strain_list, metadata, annotations_append)
break
annotations_append, info_found = check_travel_history(info, strain_list, travel_pattern, ordering, metadata,
@@ -669,6 +671,7 @@ def check_additional_info(additional_info, path_to_config_files):
s = bold(info) + " did not contain known pattern or could not be interpreted. You have the following options:"
s += "\n" + bold("l") + " - force interpretation as " + bold("patient residence")
s += "\n" + bold("t") + " - force interpretation as " + bold("travel exposure")
+ s += "\n" + bold("e") + " - force interpretation as " + bold("environment")
s += "\n" + bold("i") + " - add info to " + bold("ignore")
s += "\n" + bold("a") + " - add to annotations as a " + bold("comment")
s += "\n" + bold("nl") + " - add new " + bold("patient residence") + " pattern"
@@ -694,6 +697,9 @@ def check_additional_info(additional_info, path_to_config_files):
elif answer == "t":
print("Process " + bold(info) + " now as " + bold(info + " (interpreted as travel exposure)"))
info = info + " (interpreted as travel exposure)"
+ elif answer == "e":
+ print("Process " + bold(info) + " as environment")
+ environment.append(info)
elif answer == "nl":
pattern = input("Type pattern here (don't forget XXX as placeholder): ")
add_to_simple_file(path_to_config_files + "location_pattern.txt", pattern)
