From 72d359e5c3d18227f986eee73db8d04d4f9da336 Mon Sep 17 00:00:00 2001 From: Josiah Seaman Date: Mon, 4 Dec 2017 14:00:40 +0000 Subject: [PATCH] Bug fixes for webpage generation --- DDV.py | 10 ++++++++-- TileLayout.py | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/DDV.py b/DDV.py index a5f22e9..cb95d69 100644 --- a/DDV.py +++ b/DDV.py @@ -209,7 +209,6 @@ def create_parallel_viz_from_fastas(args, n_genomes, output_dir, output_name, fa layout = ParallelLayout(n_genomes=n_genomes) layout.process_file(output_dir, output_name, fastas) layout_final_output_location = layout.final_output_location - del layout try: for extra_fasta in fastas: shutil.copy(extra_fasta, os.path.join(output_dir, os.path.basename(extra_fasta))) @@ -217,10 +216,15 @@ def create_parallel_viz_from_fastas(args, n_genomes, output_dir, output_name, fa pass # not a problem print("Done creating Large Image.") if not args.no_webpage: + layout.generate_html(fasta, output_dir, output_name) + del layout print("Creating Deep Zoom Structure from Generated Image...") create_deepzoom_stack(os.path.join(output_dir, layout_final_output_location), os.path.join(output_dir, 'GeneratedImages', "dzc_output.xml")) print("Done creating Deep Zoom Structure.") + else: + del layout + if args.run_server: run_server(output_dir) @@ -231,7 +235,6 @@ def create_tile_layout_viz_from_fasta(args, fasta, output_dir, output_name, layo layout = TileLayout(use_titles=not args.no_titles, sort_contigs=args.sort_contigs) layout.process_file(fasta, output_dir, output_name) layout_final_output_location = layout.final_output_location - del layout # try: # shutil.copy(fasta, os.path.join(output_dir, os.path.basename(fasta))) # except shutil.SameFileError: @@ -239,9 +242,12 @@ def create_tile_layout_viz_from_fasta(args, fasta, output_dir, output_name, layo print("Done creating Large Image at ", layout_final_output_location) if not args.no_webpage: layout.generate_html(fasta, output_dir, output_name) + del layout print("Creating Deep Zoom Structure from Generated Image...") create_deepzoom_stack(os.path.join(output_dir, layout_final_output_location), os.path.join(output_dir, 'GeneratedImages', "dzc_output.xml")) print("Done creating Deep Zoom Structure.") + else: + del layout if __name__ == "__main__": diff --git a/TileLayout.py b/TileLayout.py index d1a6173..f8e6ca6 100644 --- a/TileLayout.py +++ b/TileLayout.py @@ -12,7 +12,7 @@ small_title_bp = 10000 -title_skip_padding = self.levels[0].modulo +title_skip_padding = 100 def hex_to_rgb(h):