huayc09 / SeuratExtend

GNU General Public License v3.0
80 stars 8 forks source link

stats functionality doesnt work for VlnPlot2 #10

Open Eomesodermin opened 2 weeks ago

Eomesodermin commented 2 weeks ago

I'm not sure how to debug this because not getting any error. The below function call works fine in that a plot is generated. But stats are not computed or put on the plot.

I have tried many iterations but can't seem to work out why stats are not being applied.

Any advice.

VlnPlot2(srt_tcells, features = "P2rx7", group.by = "genotype", stats.method = "wilcox.test", hide.ns = F)

Screenshot 2024-08-28 at 11 21 50 am
huayc09 commented 2 weeks ago

Hi, you should use 'stat.method' instead of 'stats.method' :)

Eomesodermin commented 2 weeks ago

omg, how silly of me.

but now I actually have an error

Error: unable to find an inherited method for function ‘select’ for signature ‘x = "grouped_df"’

huayc09 commented 2 weeks ago

Thank you for reporting this issue. It appears to be similar to the problem described in #5.

Previously, my suspicion was that this might be related to the select function. Multiple packages have a select function, and it's possible that when VlnPlot2 was trying to use dplyr::select internally, it was being masked by another package's select function.

I've recently updated the VlnPlot2 function to explicitly specify that it's using the select function from the dplyr package. Could you please try upgrading SeuratExtend to the latest version and see if the error still persists?