Comments (5)
Hi Muhammad5577,
Can you confirm for me which version of seaborn you're using?
from nanocompore.
Hi lmulroney
seaborn is v 0.11.2
from nanocompore.
Hi lmulroney
After updating to seaborn 0.12.2 i get this error now
ValueError Traceback (most recent call last)
Cell In [12], line 1
----> 1 fig, ax = db.plot_position ("YKL096W_mRNA",pos=1)
File ~/.local/lib/python3.8/site-packages/nanocompore/SampCompDB.py:865, in SampCompDB.plot_position(self, ref_id, pos, split_samples, figsize, palette, plot_style, xlim, ylim, alpha, pointSize, scatter, kde, model, gmm_levels)
863 for label, d in plot_data_dict.items():
864 if kde:
--> 865 _ = sns.kdeplot(
866 data=d["intensity"],
867 data2=d["dwell"],
868 cmap=sns.light_palette(d["color"], as_cmap=True),
869 ax=ax,
870 clip=((min(d["intensity"]), max(d["intensity"])), (min(d["dwell"]),max(d["dwell"]))))
871 if scatter:
872 _ = ax.scatter(
873 x=d["intensity"],
874 y=d["dwell"],
(...)
877 alpha=alpha,
878 s=pointSize)
File ~/.local/lib/python3.8/site-packages/seaborn/distributions.py:1717, in kdeplot(data, x, y, hue, weights, palette, hue_order, hue_norm, color, fill, multiple, common_norm, common_grid, cumulative, bw_method, bw_adjust, warn_singular, log_scale, levels, thresh, gridsize, cut, clip, legend, cbar, cbar_ax, cbar_kws, ax, **kwargs)
1713 if p.univariate:
1715 plot_kws = kwargs.copy()
-> 1717 p.plot_univariate_density(
1718 multiple=multiple,
1719 common_norm=common_norm,
1720 common_grid=common_grid,
1721 fill=fill,
1722 color=color,
1723 legend=legend,
1724 warn_singular=warn_singular,
1725 estimate_kws=estimate_kws,
1726 **plot_kws,
1727 )
1729 else:
1731 p.plot_bivariate_density(
1732 common_norm=common_norm,
1733 fill=fill,
(...)
1743 **kwargs,
1744 )
File ~/.local/lib/python3.8/site-packages/seaborn/distributions.py:937, in _DistributionPlotter.plot_univariate_density(self, multiple, common_norm, common_grid, warn_singular, fill, color, legend, estimate_kws, **plot_kws)
934 log_scale = self._log_scaled(self.data_variable)
936 # Do the computation
--> 937 densities = self._compute_univariate_density(
938 self.data_variable,
939 common_norm,
940 common_grid,
941 estimate_kws,
942 log_scale,
943 warn_singular,
944 )
946 # Adjust densities based on the multiple
rule
947 densities, baselines = self._resolve_multiple(densities, multiple)
File ~/.local/lib/python3.8/site-packages/seaborn/distributions.py:349, in _DistributionPlotter._compute_univariate_density(self, data_variable, common_norm, common_grid, estimate_kws, log_scale, warn_singular)
345 try:
346 if not singular:
347 # Convoluted approach needed because numerical failures
348 # can manifest in a few different ways.
--> 349 density, support = estimator(observations, weights=weights)
350 except np.linalg.LinAlgError:
351 singular = True
File ~/.local/lib/python3.8/site-packages/seaborn/_statistics.py:192, in KDE.call(self, x1, x2, weights)
190 """Fit and evaluate on univariate or bivariate data."""
191 if x2 is None:
--> 192 return self._eval_univariate(x1, weights)
193 else:
194 return self._eval_bivariate(x1, x2, weights)
File ~/.local/lib/python3.8/site-packages/seaborn/_statistics.py:151, in KDE._eval_univariate(self, x, weights)
149 support = self.support
150 if support is None:
--> 151 support = self.define_support(x, cache=False)
153 kde = self._fit(x, weights)
155 if self.cumulative:
File ~/.local/lib/python3.8/site-packages/seaborn/_statistics.py:127, in KDE.define_support(self, x1, x2, weights, cache)
125 """Create the evaluation grid for a given data set."""
126 if x2 is None:
--> 127 support = self._define_support_univariate(x1, weights)
128 else:
129 support = self._define_support_bivariate(x1, x2, weights)
File ~/.local/lib/python3.8/site-packages/seaborn/_statistics.py:101, in KDE._define_support_univariate(self, x, weights)
99 kde = self._fit(x, weights)
100 bw = np.sqrt(kde.covariance.squeeze())
--> 101 grid = self._define_support_grid(
102 x, bw, self.cut, self.clip, self.gridsize
103 )
104 return grid
File ~/.local/lib/python3.8/site-packages/seaborn/_statistics.py:93, in KDE._define_support_grid(self, x, bw, cut, clip, gridsize)
91 clip_lo = -np.inf if clip[0] is None else clip[0]
92 clip_hi = +np.inf if clip[1] is None else clip[1]
---> 93 gridmin = max(x.min() - bw * cut, clip_lo)
94 gridmax = min(x.max() + bw * cut, clip_hi)
95 return np.linspace(gridmin, gridmax, gridsize)
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
from nanocompore.
It looks like seaborn changed the way that the do internal indexing in the versions you're using compared to the version recommended in nanocompore. Can you try using version 0.11.0 instead of 0.11.2 or 0.12.2?
Also, just to make sure, do you have data at position 1 of YKL096W_mRNA or pos 456 of YAL003W_mRNA? It might be throwing the error due to no data at those positions?
from nanocompore.
Hi lmulroney
thank you for your help.
after reinstalling seaborn 0.11 it worked !
cheers for the support !
from nanocompore.
Related Issues (20)
- 'event_l' referenced before assignment HOT 4
- nanocompore sampcomp defunct
- About SK1 transcriptome reference and m6A sites for Yeast HOT 1
- eventalign_collapse error HOT 9
- Where is the fold change value HOT 3
- samcomp
- Script for generating the "sharkfin plot of the p-values compared with Log Odds Ratio" HOT 6
- SampCompDB error HOT 1
- dbm.error: db file doesn't exist; use 'c' or 'n' flag to create a new db HOT 21
- cluster_counts interpretation HOT 1
- Issues on reproducing the synthetic oligo results from the nanocompore paper HOT 3
- Request for demo data & getting ValueError: 'read_name' is not in list when running nanocompore eventalign_collapse with nanopolishComp data HOT 11
- nanocompore to be used for SHAPEseq data HOT 1
- returns numpy error while intsalling nanocompore on Ubuntu 22.04 HOT 2
- miCLIP dataset HOT 2
- A question about the result HOT 1
- nanocompore-sampcomp-References found in index: 0 HOT 2
- nanocompore sampcomp output question. HOT 5
- Problems with save_to_bed. And questions with bed file annotation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nanocompore.