diff --git a/README.md b/README.md index 1a319e7..2228e3e 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ * General configuration: [config/config.yaml](config/config.yaml) * Plot configuration: [config/plot_config.yaml](config/plot_config.yaml) -* Meta information: [workflow/scripts/bokeh_plot/components/plot_css_html.py](workflow/scripts/bokeh_plot/components/plot_css_html.py) +* Meta information: [workflow/scripts/plot/components/plot_css_html.py](workflow/scripts/plot/components/plot_css_html.py) ### Setup diff --git a/config/config.yaml b/config/config.yaml index f4ea4b2..808a22b 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -22,6 +22,7 @@ DISPLAY_LAYOUT_BINARY: /srv/data/seiler/hibf_benchmark/display_layout FILENAMES_FILE: /srv/public/leonard/hibf_benchmarks/data/1024/1024.filenames QUERY_FILE: /srv/public/leonard/hibf_benchmarks/data/1024/reads_e2_250/all.fastq +# All the parameters to run with raptor PARAMS: ALPHA: [60.0 ,40.0, 20.0, 10.0, 5.0, 2.0, 1.5, 1.3, 1.0, 0.7, 0.5] T_MAX: ?sorted([192, 768, 8192] + inclusive_range_mult(64, 2048, 2)) @@ -30,10 +31,11 @@ PARAMS: RELAXED_FPR: ?[0.05] + inclusive_range_add(0.1, 0.9, 0.1) MODE: [none, U, U+R] # [none, U, U+R] - +# Neccessary data parameters to run raptor DATA_PARAMETERS: QUERY_ERRORS: 2 +# Default parameters to run raptor DEFAULT_PARAMS: ALPHA: 1.2 T_MAX: 192 @@ -43,4 +45,5 @@ DEFAULT_PARAMS: M_FPR: 0.05 MODE: U+R -NUM_THREADS: 1 # Number of threads to use per task, not for parallel execution +# Number of threads to use per task, not for parallel execution +NUM_THREADS: 1 diff --git a/config/plot_config.yaml b/config/plot_config.yaml index b540011..1c1f736 100644 --- a/config/plot_config.yaml +++ b/config/plot_config.yaml @@ -1,7 +1,8 @@ -PLOT_NAME: "plot1" -EXTRA_FILE_PLOTTING: True +PLOT_NAME: "plot_name" +EXTRA_FILE_PLOTTING: True # if True, ALL htmls in the results/html folder will be plotted +# Names for the different keys in the plot KEYS: alpha: alpha hash: hash @@ -12,6 +13,8 @@ KEYS: U+R: U+R +# Format: all benchmark-times to plot +# Names: names for the different keys in the plot TIME: FORMAT: - determine_query_length_in_seconds @@ -42,6 +45,8 @@ TIME: generate_results_max_percentage: "Generate results (max) percentage" +# Format: all benchmark-sizes to plot +# Names: names for the different keys in the plot SIZE: FORMAT: - LEVEL_0_GB_SIZE diff --git a/workflow/envs/landingpage.yml b/workflow/envs/landingpage.yml index 4687a16..4d259bc 100644 --- a/workflow/envs/landingpage.yml +++ b/workflow/envs/landingpage.yml @@ -3,3 +3,4 @@ channels: - conda-forge dependencies: - html2image=2.0.4.3 + - beautifulsoup4=4.12.3 diff --git a/workflow/rules/plot.smk b/workflow/rules/plot.smk index fd0d52a..d1bf299 100644 --- a/workflow/rules/plot.smk +++ b/workflow/rules/plot.smk @@ -5,7 +5,7 @@ rule plot_data: output: PLOT_FILE=f"results/html/{config['PLOT_NAME']}.html", params: - THEME="workflow/scripts/bokeh_plot/plot_theme.yaml", + THEME="workflow/scripts/plot/plot_theme.yaml", KEYS=config["KEYS"], TIME=config["TIME"], SIZE=config["SIZE"], @@ -14,7 +14,7 @@ rule plot_data: conda: "../envs/bokeh.yml" script: - "../scripts/bokeh_plot/plot.py" + "../scripts/plot/plot.py" rule plot_landingpage: @@ -22,7 +22,6 @@ rule plot_landingpage: PLOT_FILE=f"results/html/{config['PLOT_NAME']}.html", output: OUTPUT_FILE="results/html/index.html", - PNG_FILE=f"results/html/{config['PLOT_NAME']}.png", params: EXTRA_FILE_PLOTTING=config["EXTRA_FILE_PLOTTING"], HTML_DIR="results/html", @@ -31,4 +30,4 @@ rule plot_landingpage: conda: "../envs/landingpage.yml" script: - "../scripts/landingpage.py" + "../scripts/plot/landingpage.py" diff --git a/workflow/scripts/bokeh_plot/components/helpers.py b/workflow/scripts/bokeh_plot/components/helpers.py deleted file mode 100644 index 6b3e44d..0000000 --- a/workflow/scripts/bokeh_plot/components/helpers.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Helper functions.""" - - -def convert_dic_to_list(data): - """Returns a list containing the values of the given list as strings.""" - return [str(i) for i in data] - - -def add_arrays(data): - """Returns a list containing the sum of the given lists.""" - return [sum(float(i) for i in sublist) for sublist in zip(*data)] - - -def get_max_result(data, factor): - """Returns the maximum value of the given list multiplied by the given factor.""" - return round(max(data) * factor, 3) diff --git a/workflow/scripts/landingpage.py b/workflow/scripts/landingpage.py deleted file mode 100644 index 93d4fdb..0000000 --- a/workflow/scripts/landingpage.py +++ /dev/null @@ -1,140 +0,0 @@ -""" -Creates a landing page gallery with screenshots of Bokeh plot HTML files. -""" - -import os -import re - -from bokeh_plot.components.log_init import log_init -from html2image import Html2Image - -html_files = snakemake.input["PLOT_FILE"] -output_file = snakemake.output["OUTPUT_FILE"] -extra_file_plotting = snakemake.params["EXTRA_FILE_PLOTTING"] -html_dir = snakemake.params["HTML_DIR"] - -log_init(snakemake.log[0]) - -# get html files -if extra_file_plotting: - html_files = [os.path.join(html_dir, f) for f in os.listdir(html_dir) if f.endswith(".html")] - -# get html names -html_names = [re.sub(".html", "", html_file) for html_file in html_files] - -# create png for each html -hti = Html2Image(output_path=html_dir, custom_flags=["--headless", "--disable-gpu"]) - -for html_file in html_files: - hti.screenshot(html_file=html_file, save_as=re.sub(".html", ".png", os.path.basename(html_file))) - -# all parts of the landing page -LIST_OF_PARTS = "\n".join( - [ - f""" -
- """ - for (ihtml_name, html_name) in enumerate(html_names) - ] -) - -# create landing page -CSS_TEXT = """ - body { - font-family: Arial, sans-serif; - background-color: #15191c; - margin: 0; - padding: 20px; - } - - .header { - text-align: center; - padding: 20px; - } - - .header h1 { - margin: 0; - font-size: 2em; - color: #ffffff; - } - - .gallery { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); - gap: 20px; - padding: 20px; - } - - .gallery-item { - background-color: #000000; - border-radius: 8px; - box-shadow: 0 0 10px rgba(255, 255, 255, 0.1); - overflow: hidden; - text-align: center; - transform: scale(0.97); - transition: 300ms ease-in-out; - } - - .gallery-item:hover { - box-shadow: 0 0 20px rgba(255, 255, 255, 0.134); - transform: scale(1); - } - - .gallery-item img { - max-width: 100%; - height: auto; - display: block; - margin-bottom: 10px; - } - - .gallery-item a { - text-decoration: none; - color: #ffffff; - display: block; - padding: 10px; - font-size: 1em; - transition: 400ms ease-in-out; - } - - .gallery-item a:hover { - color: #c2c2c2; - } - """ - -HTML_TEXT = ( - """ - - - - - - -