gene expression of tumor with different percentage of infiltrates
Consider that while a fair portion of your immune infiltrate will be T cells, that you can also have dendritic cells, macrophages, B cells, NK and NKT cells, and other cell types. I like to use this figure to demonstrate that fact, and also make note that the relative abundance of immune mRNA by cell type differs by indication (figure 1).



Source: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4852857/

Also consider that for T cell markers like CD4 or CD8, these are expressed by antigen-presenting cells, as well.