Skip to content

Commit

Permalink
Fix error in map creation
Browse files Browse the repository at this point in the history
  • Loading branch information
tcezard committed Jul 3, 2024
1 parent 370c08a commit e2f1d05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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}
Expand All @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down

0 comments on commit e2f1d05

Please sign in to comment.