Interplay between somatic alterations and the microenvironment in response to cancer immunotherapy