Skip to content

Commit

Permalink
Bug fixes for webpage generation
Browse files Browse the repository at this point in the history
  • Loading branch information
josiahseaman committed Dec 4, 2017
1 parent 8f4f773 commit 72d359e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions DDV.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,18 +209,22 @@ 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)))
except shutil.SameFileError:
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)

Expand All @@ -231,17 +235,19 @@ 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:
# pass # not a problem
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__":
Expand Down
2 changes: 1 addition & 1 deletion TileLayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


small_title_bp = 10000
title_skip_padding = self.levels[0].modulo
title_skip_padding = 100


def hex_to_rgb(h):
Expand Down

0 comments on commit 72d359e

Please sign in to comment.