chenkenbio / SpliceBERT

Primary RNA sequence model
BSD 3-Clause "New" or "Revised" License
24 stars 5 forks source link

No module named 'biock' #1

Closed ComDec closed 8 months ago

ComDec commented 8 months ago

Hi there, When I try reproduce example 03, I met with the following error: ModuleNotFoundError: No module named 'biock' when I try to run:

from biock.plot._plot import boxplot_with_scatter
fig = plt.figure(figsize=get_figure_size(0.5, 0.35))
ax = plt.subplot()
# _ = ax.boxplot(scores.values(), positions=xticks, sym='', medianprops=dict(color='black'))
xticks = np.arange(len(scores))
print('\n'.join(["{}\t{:.3e}".format(k, np.mean(v)) for k, v in scores.items()]))
boxplot_with_scatter(
    list(scores.values()), 
    # list(scores_norm.values()), 
    positions=xticks, 
    ax=ax, 
    scatter_kwargs=dict(marker='.', alpha=0.8), max_sample=1000, size=0.5, medianprops=dict(color='black'))
xticklabels = list(scores.keys())
xticklabels = ["D-A(intron)", "D-A(exon)", "D-A(unpair)", "D-D", "A-A", "random pair\n(control)"]
# _ = ax.boxplot(scores.values(), positions=xticks, sym='', medianprops=dict(color='black'))
_ = ax.set_xticks(xticks, xticklabels, rotation=15)
ax.set_yscale("log")
set_spines(ax)
ax.set_ylabel("attention weights")
plt.tight_layout()
# plt.savefig("./Figure_4A.jpg", dpi=600)
# plt.savefig("../figures/attention_pair_by_groups.jpg", dpi=600)
# plt.savefig("../figures/attention_pair_by_groups.svg")
chenkenbio commented 8 months ago

Hello, the missing code is now available at: https://github.com/biomed-AI/SpliceBERT/commit/e7102c85eca68793fea780737e8dc9f00af85aee. You can import the function in jupyter notebook:

sys.path.append("../scripts")
from utils import boxplot_with_scatter