These are the custom R scripts for the generation of the Figure 2d and Figure S4a for the following publication: Huaqiang Zhou, Yi Hu, Rongzhen Luo et al. Multi-region exome sequencing reveals the intratumoral heterogeneity of surgically resected small cell lung cancer.