Hi,
thanks a lot for publishing the code and for this interesting approach!
I am applying your scripts to calculate spatial coherence in 10x visium samples and there I stumbled across this function:
one_val = function(spots_num) {
a = sqrt((4*spots_num)/(6*sqrt(3)))
oneval = (6*spots_num-12*a-6)/spots_num
return(oneval)
}
As I understand it estimates the maximum expected coherence in a window of spots for the given number of spots assigned to the metaprogram/cluster in question.
However, it is unclear to me how the formula that is implemented here works. Could you explain the maths behind this function?
This would help me a lot!!
Thanks in advance,
Erik