soorajachar / plateypus

Processes and plots high throughput cytometry experiments through a GUI
GNU General Public License v3.0
5 stars 2 forks source link

Bug: Unable to create kde plots due to error "ValueError: window_length must be odd" #8

Closed emanuelsc87 closed 3 years ago

emanuelsc87 commented 3 years ago

I get the error shown below when trying to plot Single Cell kde's. I shared with you the dataframe, and I'm copying the steps followed to create a test figure with kde plots (for the last step, I left the default values). When trying the same steps for histograms, it worked fine (see figure at the end). Thanks!!

image image image image

image

soorajachar commented 3 years ago

Try increasing the smoothing window by 1 on the last screen as a quick fix right now

emanuelsc87 commented 3 years ago

Default is 27, and I could an only increase or decrease by 2, and it gives the same error. It's weird because the values are indeed odd values.

soorajachar commented 3 years ago

This is actually very strange as my default is 28 and it works fine for me:

Screen Shot 2021-06-08 at 4 28 22 AM

temporaryFirstPlot However our code is identical... I'll have to take a deeper look into this. Hopefully the histograms are good enough for you right now.

soorajachar commented 3 years ago

In the meantime though I've pushed an update (0.2.3) that should hopefully fix the problem by making sure the filtering value is odd (and if not subtracting 1) before passing it to the smoothing function. This was the point of starting the slider at an odd number and only allowing a user to increment it by 2 in the first place but somehow that wasn't enough (?). Once you've confirmed it works for you let me know and I'll close the issue, as right now my default is 28 for some reason so I can't really check to make sure the solution worked myself.

emanuelsc87 commented 3 years ago

Thank you so much! That fixed the problem. It was almost neccesary to use kde's instead of histograms because I needed to create 30 plots as the one below, and with histograms multiple overlayed curves don't look good. It's so nice with these plots because we will be able to assess easily the specific signal in the intended channel, and the unintended signal or spread caused during unmixing in the rest of the channels. Thanks again!

image

soorajachar commented 3 years ago

Fixed in 0.2.3