Quote:
Depression is related to AS more directly because of the severe calcium deficiency caused by this disease.

AS doesn't appear to be related to calcium deficiency. "Calcium homeostasis and testosterone levels were normal in subjects with AS ... BMD of subjects with AS is decreased, in spite of normal calcium homeostasis and bone remodeling indices." - http://ukpmc.ac.uk/abstract/MED/9598894 . I can't find any links between calcium deficiency and depression. In fact excess calcium and calcium supplementation has been implicated as a cause of depression. As you mentioned, magnesium appears to be useful in depression with one of the proposed mechanisms being that it counters the negative effects of excess calcium - http://www.sciencedirect.com/science/article/pii/S0306987706001034