Skip to content

Commit ae6273b

Browse files
committed
add benchmark source code for reproducibility
1 parent e4b186f commit ae6273b

1 file changed

Lines changed: 79 additions & 0 deletions

File tree

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#! /data/salomonis2/LabFiles/Frank-Li/citeseq/scanpy_new_env/bin/python3.6
2+
3+
import pandas as pd
4+
import numpy as np
5+
import os,sys
6+
import scanpy as sc
7+
import matplotlib.pyplot as plt
8+
import matplotlib as mpl
9+
10+
mpl.rcParams['pdf.fonttype'] = 42
11+
mpl.rcParams['ps.fonttype'] = 42
12+
mpl.rcParams['font.family'] = 'Arial'
13+
14+
# plot for effects on annotations
15+
16+
n_anno = [3,6,9,12]
17+
time_run = [389,497,639,2090]
18+
time_cpu = [1061,2511,6511,40515]
19+
20+
fig,ax = plt.subplots()
21+
ax.plot(np.arange(len(n_anno)),[item/60 for item in time_run],linestyle='--',marker='o',label='run time')
22+
ax.plot(np.arange(len(n_anno)),[item/60 for item in time_cpu],linestyle='--',marker='o',label='cpu time')
23+
ax.set_xticks(np.arange(len(n_anno)))
24+
ax.set_xticklabels(n_anno)
25+
ax.set_xlabel('# annotations')
26+
ax.set_ylabel('Running time (mins)')
27+
ax.set_title('Effects of number of annotations on Running time -- CITE')
28+
ax.legend(frameon=False,loc='upper left',bbox_to_anchor=(1,1))
29+
plt.savefig('anno.pdf',bbox_inches='tight')
30+
plt.close()
31+
32+
33+
# plot for effects on cells
34+
35+
n_cells = [10000,20000,30000,40000]
36+
time_run = [714,1341,1991,2456]
37+
38+
fig,ax = plt.subplots()
39+
ax.plot(np.arange(len(n_cells)),[item/60 for item in time_run],linestyle='--',marker='o',label='run time')
40+
ax.set_xticks(np.arange(len(n_cells)))
41+
ax.set_xticklabels(n_cells)
42+
ax.set_xlabel('# cells')
43+
ax.set_ylabel('Running time (mins)')
44+
ax.set_title('Effects of number of cells on Running time -- LUNG')
45+
ax.legend(frameon=False,loc='upper left',bbox_to_anchor=(1,1))
46+
plt.savefig('cells.pdf',bbox_inches='tight')
47+
plt.close()
48+
49+
50+
# plot for effects on
51+
52+
n_features = [40000,60000,80000,100000]
53+
time_run = [1233,1759,2547,3632]
54+
55+
fig,ax = plt.subplots()
56+
ax.plot(np.arange(len(n_features)),[item/60 for item in time_run],linestyle='--',marker='o',label='run time')
57+
ax.set_xticks(np.arange(len(n_features)))
58+
ax.set_xticklabels(n_features)
59+
ax.set_xlabel('# features')
60+
ax.set_ylabel('Running time (mins)')
61+
ax.set_title('Effects of number of features on Running time -- MULTIOME')
62+
ax.legend(frameon=False,loc='upper left',bbox_to_anchor=(1,1))
63+
plt.savefig('features.pdf',bbox_inches='tight')
64+
plt.close()
65+
66+
67+
68+
69+
70+
71+
72+
73+
74+
75+
76+
77+
78+
79+

0 commit comments

Comments
 (0)