Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

violinplot error #3

Open
H1889 opened this issue May 31, 2023 · 0 comments
Open

violinplot error #3

H1889 opened this issue May 31, 2023 · 0 comments

Comments

@H1889
Copy link

H1889 commented May 31, 2023

Thank you for this wonderfull tool.
I am running a Single-methylome analysis, everything goes well. preprocess, correlation, ordinal, metagene, grouping with boxplot...but when running grouping violinplot an error is produced:

python grouping.py -n WDM -p violinplot

Traceback (most recent call last):
File "grouping.py", line 217, in
main()
File "grouping.py", line 211, in main
groupingplot(All_value,name, plot=args.plot, context=con, target=tar, skip0=eval(args.skip0), n=args.numberofgroup,showmeans=eval(args.showmeans),showfliers=eval(args.showfliers),ylim=args.ylimit,corr=args.correlation,figuresize=(8,6),dotsize=args.dotsize,textsize=args.textsize,ticksize=args.ticksize,labelsize=args.labelsize,titlesize=args.titlesize)
File "grouping.py", line 140, in groupingplot
plt.violinplot(dataforplot,showmeans=showmeans)
File "/home/yomismo/mambaforge/envs/METHGET/lib/python2.7/site-packages/matplotlib/pyplot.py", line 3737, in violinplot
points=points, bw_method=bw_method, data=data)
File "/home/yomismo/mambaforge/envs/METHGET/lib/python2.7/site-packages/matplotlib/init.py", line 1870, in inner
return func(ax, *args, **kwargs)
File "/home/yomismo/mambaforge/envs/METHGET/lib/python2.7/site-packages/matplotlib/axes/_axes.py", line 7958, in violinplot
vpstats = cbook.violin_stats(dataset, _kde_method, points=points)
File "/home/yomismo/mambaforge/envs/METHGET/lib/python2.7/site-packages/matplotlib/cbook/init.py", line 2183, in violin_stats
stats['vals'] = method(x, coords)
File "/home/yomismo/mambaforge/envs/METHGET/lib/python2.7/site-packages/matplotlib/axes/_axes.py", line 7953, in _kde_method
if np.all(X[0] == X):
File "/home/yomismo/mambaforge/envs/METHGET/lib/python2.7/site-packages/pandas/core/series.py", line 868, in getitem
result = self.index.get_value(self, key)
File "/home/yomismo/mambaforge/envs/METHGET/lib/python2.7/site-packages/pandas/core/indexes/base.py", line 4375, in get_value
tz=getattr(series.dtype, 'tz', None))
File "pandas/_libs/index.pyx", line 81, in pandas._libs.index.IndexEngine.get_value
File "pandas/_libs/index.pyx", line 89, in pandas._libs.index.IndexEngine.get_value
File "pandas/_libs/index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 987, in pandas._libs.hashtable.Int64HashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 993, in pandas._libs.hashtable.Int64HashTable.get_item
KeyError: 0
(METHGET) yomismo@onuba:/media/yomismo/Datos/MethGET$ python grouping.py -n MDM -p violinplot
Traceback (most recent call last):
File "grouping.py", line 217, in
main()
File "grouping.py", line 211, in main
groupingplot(All_value,name, plot=args.plot, context=con, target=tar, skip0=eval(args.skip0), n=args.numberofgroup,showmeans=eval(args.showmeans),showfliers=eval(args.showfliers),ylim=args.ylimit,corr=args.correlation,figuresize=(8,6),dotsize=args.dotsize,textsize=args.textsize,ticksize=args.ticksize,labelsize=args.labelsize,titlesize=args.titlesize)
File "grouping.py", line 140, in groupingplot
plt.violinplot(dataforplot,showmeans=showmeans)
File "/home/yomismo/mambaforge/envs/METHGET/lib/python2.7/site-packages/matplotlib/pyplot.py", line 3737, in violinplot
points=points, bw_method=bw_method, data=data)
File "/home/yomismo/mambaforge/envs/METHGET/lib/python2.7/site-packages/matplotlib/init.py", line 1870, in inner
return func(ax, *args, **kwargs)
File "/home/yomismo/mambaforge/envs/METHGET/lib/python2.7/site-packages/matplotlib/axes/_axes.py", line 7958, in violinplot
vpstats = cbook.violin_stats(dataset, _kde_method, points=points)
File "/home/yomismo/mambaforge/envs/METHGET/lib/python2.7/site-packages/matplotlib/cbook/init.py", line 2183, in violin_stats
stats['vals'] = method(x, coords)
File "/home/yomismo/mambaforge/envs/METHGET/lib/python2.7/site-packages/matplotlib/axes/_axes.py", line 7953, in _kde_method
if np.all(X[0] == X):
File "/home/yomismo/mambaforge/envs/METHGET/lib/python2.7/site-packages/pandas/core/series.py", line 868, in getitem
result = self.index.get_value(self, key)
File "/home/yomismo/mambaforge/envs/METHGET/lib/python2.7/site-packages/pandas/core/indexes/base.py", line 4375, in get_value
tz=getattr(series.dtype, 'tz', None))
File "pandas/_libs/index.pyx", line 81, in pandas._libs.index.IndexEngine.get_value
File "pandas/_libs/index.pyx", line 89, in pandas._libs.index.IndexEngine.get_value
File "pandas/_libs/index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 987, in pandas._libs.hashtable.Int64HashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 993, in pandas._libs.hashtable.Int64HashTable.get_item
KeyError: 0

I have checked all dependencies and are ok

Thank you for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant