A method of analyzing a biological sample from a subject that has a tumor or cancer, comprising: determining, for target cells having a phenotype of interest spatial resolution of the target cells, density of the spatially resolved target cells in the sample; and proximity between spatially resolved target cells of interest in the sample; and determining an overall score based at least in part on the preceding parameters. A method for identifying a patient as a responder to single agent anti-PD-1 or anti-PD-L1 therapy is provided. Similar methods are provided for detecting adaptive immune resistance, the presence of cancer in a patient sample, determining efficacy of cancer therapy, and determining response to and monitoring the efficacy of cancer therapy.