diff --git a/eva-accession-release-automation/gather_clustering_counts/gather_release_counts.py b/eva-accession-release-automation/gather_clustering_counts/gather_release_counts.py index 11cb6662a..1f52f0c61 100644 --- a/eva-accession-release-automation/gather_clustering_counts/gather_release_counts.py +++ b/eva-accession-release-automation/gather_clustering_counts/gather_release_counts.py @@ -443,7 +443,7 @@ def generate_per_taxonomy_counts(self): species_annotations = defaultdict(dict) for count_groups in self.all_counts_grouped: taxonomy_and_types = set([(count_dict['taxonomy'], count_dict['idtype']) for count_dict in count_groups]) - release_folder_map = dict((count_dict['taxonomy'], count_dict['release_folder'] for count_dict in count_groups)) + release_folder_map = dict((count_dict['taxonomy'], count_dict['release_folder']) for count_dict in count_groups) for taxonomy, rstype in taxonomy_and_types: if taxonomy not in species_annotations: species_annotations[taxonomy] = {'assemblies': set(), 'release_folder': None} @@ -464,7 +464,6 @@ def generate_per_assembly_counts(self): assembly_annotations = {} for count_groups in self.all_counts_grouped: assembly_and_types = set([(count_dict['assembly'], count_dict['idtype']) for count_dict in count_groups]) - release_folder_map = dict((count_dict['taxonomy'], count_dict['release_folder'] for count_dict in count_groups)) for assembly_accession, rstype in assembly_and_types: if assembly_accession not in assembly_annotations: assembly_annotations[assembly_accession] = {'taxonomies': set(), 'release_folder': None} @@ -485,7 +484,7 @@ def generate_per_taxonomy_and_assembly_counts(self): species_assembly_annotations = defaultdict(dict) for count_groups in self.all_counts_grouped: taxonomy_assembly_and_types = set([(count_dict['taxonomy'], count_dict['assembly'], count_dict['idtype']) for count_dict in count_groups]) - release_folder_map = dict((count_dict['taxonomy'], count_dict['release_folder'] for count_dict in count_groups)) + release_folder_map = dict((count_dict['taxonomy'], count_dict['release_folder']) for count_dict in count_groups) for taxonomy, assembly, rstype in taxonomy_assembly_and_types: if (taxonomy, assembly) not in species_assembly_annotations: species_assembly_annotations[(taxonomy, assembly)] = {'release_folder': None} diff --git a/eva-accession-release-automation/gather_clustering_counts/tests/test_gather_release_counts.py b/eva-accession-release-automation/gather_clustering_counts/tests/test_gather_release_counts.py index 747616c63..5cd8c7c23 100644 --- a/eva-accession-release-automation/gather_clustering_counts/tests/test_gather_release_counts.py +++ b/eva-accession-release-automation/gather_clustering_counts/tests/test_gather_release_counts.py @@ -94,6 +94,7 @@ def test_write_counts_to_db(self): assert rs_assembly_count.release_folder == 'GCA_000003205.6' def test_write_counts_to_db2(self): + """This test require a postgres database running on localhost. See config_xml_file.xml for detail.""" log_files_release = [os.path.join(self.resource_folder, 'count_for_haplochromini_oreochromis_niloticus.log')] folder_to_taxonomy = {'oreochromis_niloticus': 8128, 'haplochromini': 319058}