Predicting the structure of microbial communities