4.7. Visualization

UC Uthsav Chitra
BA Brian J. Arnold
HS Hirak Sarkar
CM Cong Ma
SL Sereno Lopez-Darwin
KS Kohei Sanno
BR Benjamin J. Raphael
ask Ask a question
Favorite

The neural network in GASTON learns an isodepth d(x,y) that smoothly varies across a tissue slice T; however, the scaling of the learned isodepth d(x,y) is arbitrary. To improve the interpretability of the isodepth d(x,y) learned by the neural network, we scale the isodepth in each spatial domain to reflect approximate physical distances inside the domain. Briefly, we derive an estimate γp of the “average width” of each spatial domain Rp in μm, and we linearly transform the isodepth d(x,y) in each spatial domain such that the range of isodepth values in domain RP is γp.

We scale the isodepth in each spatial domain as follows. Given the isodepth d(x,y), spatial domains R1,,RP, and breakpoints b1,,bP-1 estimated from (10) and (11), we assume without loss of generality that the isodepth is linearly transformed such that min(x,y)Td(x,y)=0 and max(x,y)Td(x,y)=1, i.e. the breakpoints satisfy b0=0<b1<<bP-1<1=bP, where we set b0=0 and bP=1 for convenience. For each spatial domain Rp, let γp be the average width of the domain, whose computation we describe below. We compute the “scaled” isodepth d~(x,y) as

where ep,fp are chosen such that d~(x,y) is continuous, and d~(x,y)=q=1pγq if d(x,y)=bp for p=1,,P. With this choice of ep,fp, the range of scaled isodepth values d~(x,y) in a spatial domain Rp is given by

That is, the range of isodepth values d~(x,y) in each spatial domain is the average width γp of the domain Rp.

We estimate the average width γp of each spatial domain Rp by computing the median physical distance between the two boundaries of the domain Rp. Specifically, let Γlower=xi,yiRp:bp-1<dxi,yi<bp-1+ϵ and let Γupper=xi,yiRp:bp-ϵ<dxi,yi<bp be the set of spatial locations on the lower and upper boundary curves of the spatial domain Rp, respectively. We set γp to be the median distance between each spot (x,y)Γlower and the closest spot in Γupper We choose ϵ,ϵ such that Γlower and Γupper visually correspond to the spatial domain boundaries.

For 10x Genomics Visium data, we multiply each average width γp by 100, since the physical distance between the centers of adjacent spots in the 10x Visium slide is 100μm. For Slide-seqV2 data, we multiply each average width γp by 64/100, since two beads that are 100 pixels apart in the Slide-SeqV2 microscopy image have a physical distance of roughly 64μm [116].

To simplify the visualization of the 1-D expression functions h, we aggregate the counts ai,g for spots xi,yi with approximately equal isodepth values dxi,yi, as in [83]. Specifically, we partition the range of isodepth values into a union B1BM of intervals Bj, and we compute the total expression value a˜j,g=i:dxi,yiBjai,g for gene g in each interval Bj. We call a~j,g the pooled expression value of gene g at pooled spot j. Pooling does not affect inference of the 1-D expression function h in the STP, as the function h obtained by maximizing the log-likelihood (9) with pooled data is equal to the function obtained by maximizing (9) with the original data, as shown in [83].

We plot expression as log pooled counts per million (CPM) loga~j,g/D~j106+1, where D~j is the sum of the total UMI counts across all spots in the jth pooled spot. The log pooled CPM has approximately the same scale as the expression function hg(w)+log106 for each gene g.

Do you have any questions about this protocol?

Post your question to gather feedback from the community. We will also invite the authors of this article to respond.

post Post a Question
0 Q&A