Matplotlib引发AttributeError:“Annotation”对象没有属性“text_from_points”

c90pui9n  于 2023-08-06  发布在  其他
关注(0)|答案(1)|浏览(167)

我正在尝试运行TOBIAS,一个命令行生物信息学工具的集合,来分析我从ATAC-seq获得的测序数据。我尝试使用以下命令运行管道的最后一步BINDetect:
第一个月
但是,我在输出中得到以下错误:

2023-07-05 08:54:45 (488) [INFO]        Writing all_bindetect files
2023-07-05 08:54:45 (488) [INFO]        Creating BINDetect plot(s)
2023-07-05 08:54:45 (488) [INFO]        - Bcell / Tcell (static plot)
Traceback (most recent call last):
  File "/home/usrname/.local/bin/TOBIAS", line 8, in <module>
    sys.exit(main())
  File "/home/usrname/.local/lib/python3.10/site-packages/tobias/TOBIAS.py", line 154, in main
    args.func(args)
  File "/home/usrname/.local/lib/python3.10/site-packages/tobias/tools/bindetect.py", line 819, in run_bindetect
    fig = plot_bindetect(motif_list, clustering, [cond1, cond2], args)
  File "/home/usrname/.local/lib/python3.10/site-packages/tobias/tools/bindetect_functions.py", line 769, in plot_bindetect
    adjust_text(txts, ax=ax1, add_objects=[l], text_from_points=True, arrowprops=dict(arrowstyle='-', color='black', lw=0.5))  #, expand_text=(0.1,1.2), expand_objects=(0.1,0.1))
  File "/home/usrname/.local/lib/python3.10/site-packages/adjustText/__init__.py", line 730, in adjust_text
    ax.annotate(
  File "/home/usrname/.local/lib/python3.10/site-packages/matplotlib/axes/_axes.py", line 699, in annotate
    a = mtext.Annotation(text, xy, xytext=xytext, xycoords=xycoords,
  File "/home/usrname/.local/lib/python3.10/site-packages/matplotlib/text.py", line 1885, in __init__
    Text.__init__(self, x, y, text, **kwargs)
  File "/home/usrname/.local/lib/python3.10/site-packages/matplotlib/_api/deprecation.py", line 454, in wrapper
    return func(*args, **kwargs)
  File "/home/usrname/.local/lib/python3.10/site-packages/matplotlib/text.py", line 183, in __init__
    self.update(kwargs)
  File "/home/usrname/.local/lib/python3.10/site-packages/matplotlib/text.py", line 231, in update
    super().update(kwargs)
  File "/home/usrname/.local/lib/python3.10/site-packages/matplotlib/artist.py", line 1213, in update
    return self._update_props(
  File "/home/usrname/.local/lib/python3.10/site-packages/matplotlib/artist.py", line 1197, in _update_props
    raise AttributeError(
AttributeError: 'Annotation' object has no property 'text_from_points'

字符串
我尝试使用pip install --upgrade matplotlib升级matplotlib,但我已经有了最新版本3.7.1。我尝试使用pip(分别为pip uninstall matplotlibpip install matplotlib)卸载和重新安装matplotlib,但仍然得到相同的错误。
我还使用了TOBIAS的创建者在运行此命令时提供的测试数据,因此此错误可能不是由我作为命令输入提供的文件的错误引起的。
任何帮助都非常感谢!

mwkjh3gx

mwkjh3gx1#

如果你去bindetect_functions.py文件,使用Ctrl+F搜索text_from_points=TRUE,然后从下面的代码中删除它,然后重新运行相同的命令,它应该工作!
调整文本(txts,ax= ax 1,add_objects=[l],text_from_points=TRUE,arrowprops=dict(arrowstyle ='-',color ='black',lw=0.5))#,扩展文本=(0.1,1.2),扩展对象=(0.1,0.1))

相关问题