Cell composition inference and identification of layer-specific spatial transcriptional profiles with POLARIS