diff --git a/additional_benchmarks/Snakefile b/additional_benchmarks/Snakefile index b6eb714..0fe6696 100644 --- a/additional_benchmarks/Snakefile +++ b/additional_benchmarks/Snakefile @@ -101,5 +101,28 @@ rule combine: combined_df = pd.concat(dfs, ignore_index=True) combined_df.to_csv(output[0], sep="\t", index=False) -rule merge: +rule figure: input: "combined_benchmarks.tsv" + output: "benchmark_figure.pdf" + run: + import matplotlib.pyplot as plt + import matplotlib as mpl + mpl.use('agg') + import pandas as pd + d = pd.read_csv(input[0], sep="\t") + d = d.groupby(['tool', 'size'], as_index=False)['s'].median() + fig, ax = plt.subplots() + for tool in d['tool'].unique(): + data = d[d['tool'] == tool] + ax.plot(data['size'], data['s'], '-o', label=tool) + ax.set_title('Benchmark Results') + ax.semilogx() + ax.semilogy() + ax.set_xlabel('Number of BED ranges') + ax.set_ylabel('Time (s)') + ax.legend() + plt.tight_layout() + plt.savefig('benchmark_figure.pdf') + +rule merge: + input: "benchmark_figure.pdf"