Discovery and visualization of latent structure with applications to the microbiome