From d1105d5f60ade485a191ce7247bf187b38929fe9 Mon Sep 17 00:00:00 2001 From: Tatiana Gurbich Date: Tue, 19 Nov 2024 14:47:31 +0000 Subject: [PATCH] Added a condition to the removal check --- bin/check_sample_and_mag_validity.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/check_sample_and_mag_validity.py b/bin/check_sample_and_mag_validity.py index 07bef559..38b0b954 100644 --- a/bin/check_sample_and_mag_validity.py +++ b/bin/check_sample_and_mag_validity.py @@ -131,9 +131,10 @@ def load_metadata_table(metadata_table_file, remove_list): matches_in_remove_list += 1 assert len(sample_mag_dictionary) > 0, ("There was an error loading data from the metadata table {}. " "No records were obtained".format(metadata_table_file)) - assert matches_in_remove_list > 0, ("None of the genomes in remove_list are present in the metadata table file {}. " - "Check that the list of genomes to remove is correct". - format(metadata_table_file)) + if len(remove_list) > 0: + assert matches_in_remove_list > 0, ("None of the genomes in remove_list are present in the metadata table file " + "{}. Check that the list of genomes to remove is correct". + format(metadata_table_file)) return sample_mag_dictionary