WhirlFirst / somde

Algorithm for finding gene spatial pattern based on Gaussian process accelerated by SOM
MIT License
6 stars 5 forks source link

Explanation of offset in log transform #2

Closed tmchartrand closed 1 year ago

tmchartrand commented 1 year ago

Hi, I'm wondering if you can explain the justification for scaling the offset term in the stabilizing log transform by the NB dispersion phi? In the following line: https://github.com/WhirlFirst/somde/blob/1f015b4ee90100fadfae04631e8855a0fac2c9bf/somde-python/util.py#L521 Unless I missed it, the paper methods just say this is a log transform, and varying the offset makes some intuitive sense to me but I'm curious if there is a rigorous explanation I can't quite grasp. Thanks!

WhirlFirst commented 1 year ago

Some code in util.py comes from the SpatialDE package, this function was first used in https://github.com/Teichlab/NaiveDE/blob/34899669cc210fad62f28243432dc5ecf8697764/NaiveDE/base.py#L67 . You can see https://f1000research.com/posters/4-1041 for motivation.

tmchartrand commented 1 year ago

Thanks!