Scientists are making headway in the search for solutions to one of the most vexing problems in mental health: How to predict who is at risk for suicide.

Researchers are hunting for so-called biomarkers, such as patterns of brain activity on fMRI scans or levels of stress hormones in the blood, linked to suicidal thoughts and acts. They are creating computer algorithms, fed with tens of thousands of pieces of data, to come up with measures of risk. They are looking at sleep patterns and even responses to specialized computer...