biolab / orange3-single-cell

🍊🔬 Orange add-on for gene expression of single cell data
https://singlecell.biolab.si/
Other
17 stars 25 forks source link

Preprocess logarithm #369

Closed Hrovatin closed 4 years ago

Hrovatin commented 4 years ago

Orange 3.23, single cell 1.2.1

When applying the 'logarithmic scale' base 10 transformation to data via SC preprocessing the resulting data does not seem to be log10(data). Could you add documentation explaining what the 'logarithmic scale' is then if it is not the above?

Screenshot from 2019-10-03 11-22-42

JakaKokosar commented 4 years ago

Hi,

yes, the documentation is missing for this add-on. It is something we should consider soon. Parts of code used by single-cell preprocessor can be found here.

To avoid division by zero, +1 is applied to the transformation.

In [1]: import numpy as np       

In [2]: np.log10(0)                                                                                                                                                                                                                                                                                                                                          
RuntimeWarning: divide by zero encountered in log10
Out[2]: -inf

In [3]: np.log10(1)                                                                                                                                                                                                                                                                                                                                          
Out[3]: 0.0