Teichlab / cellphonedb

MIT License
339 stars 105 forks source link

Unexpected behaviors with plot dot_plot function. #278

Open martin-jeremy opened 3 years ago

martin-jeremy commented 3 years ago

Hi !

I have encountered an unexpected behaviors with the cellphonedb plot dot_plot function. In your script plot_dot_plot_by_column_name.R, l.37 you set in Means all the 0 values at 1. So when you plot the log2(mean), the values that they have which are less than 1 at means were plotted as less expressed than one that has 0 expression (i.e. log2(0+1) = 0 , log2(0.5) = -1).

To corrrect it, I commented this line 37, and I edited the line 38 from : plot.data = cbind(plot.data,log2(pr)) to : plot.data = cbind(plot.data,log2(pr+1)).

It could be a good think to prevent this behaviors, perhaps there is a better way to correct it (log1p() ?).

Regards,