You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Define a variable to store the match_status (True or False)
201
204
match_status=sample_idinprofile
202
205
# Initialize the error message
203
-
error_message=None
206
+
MLST_message=None
204
207
205
208
ifnotkeys:
206
209
logger.critical(f"{file_name} is missing the 'profile' section or is completely empty!")
207
210
raiseValueError(f"{file_name} is missing the 'profile' section or is completely empty!")
208
-
sys.exit(1)
211
+
209
212
eliflen(keys) >1:
210
213
# Check if sample_id matches any key
211
214
ifnotmatch_status:
212
-
error_message=f"No key in the MLST JSON file ({file_name}) matches the specified sample ID '{sample_id}'. The first key '{original_key}' has been forcefully changed to '{sample_id}' and all other keys have been removed."
215
+
MLST_message=f"No key in the MLST JSON file ({file_name}) matches the specified sample ID '{sample_id}'. The first key '{original_key}' has been forcefully changed to '{sample_id}' and all other keys have been removed."
error_message=f"MLST JSON file ({file_name}) contains multiple keys: {keys}. The MLST JSON file has been modified to retain only the '{sample_id}' entry"
219
+
MLST_message=f"MLST JSON file ({file_name}) contains multiple keys: {keys}. The MLST JSON file has been modified to retain only the '{sample_id}' entry"
217
220
# Retain only the specified sample_id in the profile
error_message=f"{sample_id} ID and JSON key in {file_name} DO NOT MATCH. The '{original_key}' key in {file_name} has been forcefully changed to '{sample_id}': User should manually check input files to ensure correctness."
223
+
MLST_message=f"{sample_id} ID and JSON key in {file_name} DO NOT MATCH. The '{original_key}' key in {file_name} has been forcefully changed to '{sample_id}': User should manually check input files to ensure correctness."
0 commit comments