  Spatially resolved transcriptomics brings exciting breakthroughs to
single-cell analysis by providing physical locations along with gene
expression. However, as a cost of the extremely high spatial resolution, the
cellular level spatial transcriptomic data suffer significantly from missing
values. While a standard solution is to perform imputation on the missing
values, most existing methods either overlook spatial information or only
incorporate localized spatial context without the ability to capture long-range
spatial information. Using multi-head self-attention mechanisms and positional
encoding, transformer models can readily grasp the relationship between tokens
and encode location information. In this paper, by treating single cells as
spatial tokens, we study how to leverage transformers to facilitate spatial
tanscriptomics imputation. In particular, investigate the following two key
questions: (1) $\textit{how to encode spatial information of cells in
transformers}$, and (2) $\textit{ how to train a transformer for transcriptomic
imputation}$. By answering these two questions, we present a transformer-based
imputation framework, SpaFormer, for cellular-level spatial transcriptomic
data. Extensive experiments demonstrate that SpaFormer outperforms existing
state-of-the-art imputation algorithms on three large-scale datasets while
maintaining superior computational efficiency.
