Skip to content

Commit

Permalink
New figure code
Browse files Browse the repository at this point in the history
  • Loading branch information
vsbuffalo committed May 18, 2024
1 parent 19d2459 commit 211c056
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion additional_benchmarks/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 211c056

Please sign in to comment.