Cancer immunotherapy has made huge success in treating certain types of cancers. However, durable clinical response of immunotherapy is only observed in a subset of patients. For example, approximately 20% of melanoma and lung cancer patients show response to immune checkpoint inhibitors. To improve the efficacy of immunotherapy (e.g., to identify the patients who can benefit from immunotherapy or to develop new treatment strategy), it is crucial to have a mechanistic understanding of immunotherapy failure. One of the most promising biomarkers is immune cell composition around tumors. Using RNA-seq data, we develop a new statistical method to estimate immune cell composition as well cell type specific gene expression, and associate it with immunotherapy response.