Skip to content

Commit

Permalink
fix coloring of bare maps needed for grids when draw_bare_maps is Fal…
Browse files Browse the repository at this point in the history
…se: original ortholog coloring of basemap needed to be obscured in KGML
  • Loading branch information
semiller10 committed Oct 6, 2024
1 parent 744d20b commit 6b33f06
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions anvio/keggmapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -3007,17 +3007,27 @@ def _draw_map_grids(
drawn_pathway_number[pathway_number] = {category: drawn_map}

# Draw empty maps as needed, for pathways with some but not all maps drawn.
progress = self.progress
self.progress = terminal.Progress(verbose=False)
run = self.run
self.run = terminal.Run(verbose=False)

for pathway_number, drawn_category in drawn_pathway_number.items():
if set(drawn_category.values()) != set([True, False]):
continue
pathway = self._get_pathway(pathway_number)

pathway_name = f'_{self._name_pathway(pathway_number)}' if self.name_files else ''
pathway_basename = f'kos_{pathway_number}{pathway_name}.pdf'
for category, drawn_map in drawn_category.items():
if drawn_map:
continue

out_dir = os.path.join(output_dir, category)
self._draw_map(pathway, out_dir)

self._map_kos_fixed_colors(
[], out_dir, [pathway_number], draw_maps_lacking_kos=True
)

if self.pathway_categorization is None:
out_path = os.path.join(out_dir, pathway_basename)
else:
Expand All @@ -3028,6 +3038,9 @@ def _draw_map_grids(
if self.categorize_files:
paths_to_remove.append(os.path.join(out_dir, 'symlink', pathway_basename))

self.progress = progress
self.run = run

# Draw map grids.
grid_dir = os.path.join(output_dir, 'grid')
filesnpaths.gen_output_directory(grid_dir, progress=self.progress, run=self.run)
Expand Down

0 comments on commit 6b33f06

Please sign in to comment.