Background Assays of the abundance of immune cell populations in the tumor microenvironment promise to inform immune oncology research and the choice of immunotherapy for individual patients. We propose to measure the intratumoral abundance of various immune cell populations with gene expression. In contrast to IHC and flow cytometry, gene expression assays yield high information content from a clinically practical workflow. Previous studies of gene expression in purified immune cells have reported hundreds of genes showing enrichment in a single cell type, but the utility of these genes in tumor samples is unknown. We use co-expression patterns in large tumor gene expression datasets to evaluate previously reported candidate cell type marker genes lists, eliminate numerous false positives and identify a subset of high confidence marker genes. Methods Using a novel statistical tool, we use co-expression patterns in 9986 samples from The Cancer Genome Atlas (TCGA) to evaluate previously reported cell type marker genes. We compare immune cell scores derived from these genes to measurements from flow cytometry and immunohistochemistry. We characterize the reproducibility of our cell scores in replicate runs of RNA extracted from FFPE tumor tissue. Results We identify a list of 60 marker genes whose expression levels measure 14 immune cell populations. Cell type scores calculated from these genes are concordant with flow cytometry and IHC readings, show high reproducibility in replicate RNA samples from FFPE tissue and enable detailed analyses of the anti-tumor immune response in TCGA. In an immunotherapy dataset, they separate responders and non-responders early on therapy and provide an intricate picture of the effects of checkpoint inhibition. Most genes previously reported to be enriched in a single cell type have co-expression patterns inconsistent with cell type specificity. Conclusions Due to their concise gene set, computational simplicity and utility in tumor samples, these cell type gene signatures may be useful in future discovery research and clinical trials to understand how tumors and therapeutic intervention shape the immune response. Electronic supplementary material The online version of this article (doi:10.1186/s40425-017-0215-8) contains supplementary material, which is available to authorized users.