A Joint Spatiotemporal Differential Expression Modeling of Exposure Effects in Spatial Transcriptomics Data
Abstract
This work presents a framework that identifies DEGs in spatial transcriptomics by incorporating spatial information through a hierarchical network-based model. This approach accounts for spatial confounding and leverages tissue architecture to align biological signals across conditions. The framework was validated through simulation studies and comparative benchmarks with existing popular methods.
Full text
A Join Spa io empo al Di e en ial Exp ession Modeling
o Exposu e E ec s in Spa ial T ansc ip omics Da a
Osa u Augus ine Egbon1,2 and Benedic Anchang1,2
1Na ional Ins i u e o En i onmen al Heal h Sciences (NIEHS/NIH), Du ham, NC 27709, Uni ed S a es
2Na ional Cance Ins i u e, Be hesda, MD 20892, Uni ed S a es
Abs ac
Di e en ial exp ession analysis in spa ial ansc ip omics da a is impo an o iden i ying local-
ized biological p ocesses and spa ially s uc u ed gene egula ion. While nume ous me hods ha e
been de eloped o iden i ying di e en ially exp essed genes (DEGs) in con en ional single-cell
RNA-seq da a, app oaches ha explici ly accoun o spa ial and empo al con ex emain sca ce. A
majo challenge in spa ial DEG analysis is he spa ial misalignmen be ween issue sec ions unde
con ol and pe u bed condi ions, which ende s coo dina e-based compa isons un eliable. To ad-
d ess his gap, we de eloped Spa ialDENe , a amewo k ha iden i ies DEGs in spa ially s uc u ed
single-cell da a by inco po a ing spa ial in o ma ion h ough a hie a chical ne wo k-based model.
This app oach accoun s o spa ial con ounding and le e ages issue a chi ec u e o align biological
signals ac oss condi ions. We alida ed Spa ialDENe h ough simula ion s udies and compa a i e
benchma ks wi h exis ing popula me hods. Ou indings demons a e ha Spa ialDENe p o ides
a powe ul and in e p e able al e na i e o spa ial ansc ip omics analysis and may in o m he
de elopmen o a ge ed he apies.
Key Wo ds: Bayesian in e ence, Ne wo k model, Di e en ial exp ession analysis, Gaussian Ma ko
Random Field, Ze o-in la ion.
1 In oduc ion
Spa ial ansc ip omics echnologies a e inc easingly popula o in es iga ing he spa ial a chi ec u e
o issues, unco e ing cell-cell in e ac ions, and analyzing gene exp ession pa e ns in si u wi h high
esolu ion1,2. Howe e , conduc ing Di e en ial Exp ession (DE) analysis o iden i y di e en ially
exp essed genes (DEG) be ween wo biological condi ions on spa ial ansc ip omics da a p esen s
signi ican challenges due o i s high dimensionali y, noise, spa si y, and spa ial s uc u e.
Me hods o DE analysis in s udying biological a ia ions a he single-cell le el a e eme ging
quickly. Fo ins ance, he popula ly used me hods include DESeq23, EdgeR4, Lima5, MAST6,
Zinbwa e7, among o he s. Howe e , mos o hese me hods do no accoun o spa ial a ia ion, an
impo an sou ce o biological and echnical a iabili y ha can con ound di e en ial exp ession
analysis esul s8. Exis ing s a is ical and compu a ional me hods8β13 o analyzing spa ially esol ed
1
single-cell da a a e pa icula ly designed o iden i y spa ially a iable genes (SVGs), and no adequa e
a en ion has been gi en o iden i ying DEGs be ween con ol and ea men scena ios in spa ially
esol ed single-cell da a.
To add ess his conce n, we p oposed a s a is ical amewo k, Spa ialDENe (Sp ial Di e en ial
Exp ession Analysis h ough Ne wo k), o iden i y di e en ial exp ession genes be ween con ol and
pe u bed condi ions while co ec ing o spa ial con ounding (SC). Spa ialDENe add esses h ee
main analy ical conce ns in spa ially esol ed single-cell da a. Fi s ly, Spa ialDENe adjus s o he
SC issue h ough spa ial hie a chical modeling. This me hod allows he accu a e es ima ion o he
impac o a speci ic ea men on cells a e con olling o he spa ial e ec s. Secondly, spa ially
esol ed single-cell da a is associa ed wi h spa ial misalignmen due o he non-longi udinal and non-
homologous na u e o he da a ac oss samples. Tha is, he spa ial coo dina es change om issue
samples o samples. To add ess his conce n, Spa ialDENe le e ages ne wo k models o map
cellula spa ial neighbo hoods be ween mul iple issues un o a la en space, c ea ing a uni ied spa ial
ield o adjus ing o SC and iden i ying DEGs. Las ly, Spa ialDENe accoun s o he spa si y in
he exp ession da a. The ze os due o spa si y can a ise om echnical limi a ions in he sequencing
p ocess o e lec ue biological absences o gene exp ession o speci ic cells. Dis inguishing
be ween hese wo sou ces o ze os is c i ical o accu a e in e p e a ion. Spa ialDENe u ilizes a
wo-pa (coun and ac i a ion) ze o-in la ed model o accoun o excess ze os.
The emainde o his pape is o ganized as ollows. We i s b ie ly desc ibe he s a is ical ame-
wo k o Spa ialDENe and i s ex ension o accommoda e ze o-in la ed da a. We hen benchma k
he amewo k wi h popula ly used di e en ial exp ession analysis me hods h ough a simula ion
s udy. Finally, we conclude wi h a summa y o ou con ibu ions and po en ial di ec ions o u u e
esea ch.
2 S a is ical F amewo k
2.1 Backg ound o di e en ial analysis amewo k
In single-cell DE analysis, he gene al amewo k adop ed by exis ing me hods can be desc ibed
as ollows. Le πππ be he obse ed exp ession le el (e.g., ead coun ) o gene πin cell π , whe e
π=1, . . . , πΊ and π =1, . . . , π. A gene alized linea model (GLM) is ypically used o model gene
exp ession as:
πππ βΌNB(πππ , ππ),(1)
whe e NB deno es a Nega i e Binomial dis ibu ion, πππ is he expec ed exp ession le el o gene π
in cell π ,ππis a gene-speci ic dispe sion pa ame e . The pa ame e πππ is hen linked o co a ia es
2
h ough a log-linea model gi en as
log(πππ )=π½π0+log(ππ ) +ππ π½π1+xβ€
π π·π,(2)
whe e ππ is a size ac o o lib a y size no maliza ion o cell π ,π½0is he model in e cep , ππ β {0,1}
is he ea men indica o , wi h e ec size π½1,xπ is a ec o o co a ia es o adjus o obse ed
con ounding a iables, and π·πis a co esponding ec o o eg ession coe icien s o gene π.
To es o di e en ially exp essed genes be ween con ol and ea men condi ions, we de ine he
hypo hesis (Hypo hesis 1) o a speci ic gene πas
π»0:π½π1=0 s. π»1:π½π1β 0,(3)
whe e π½π1is he coe icien co esponding o he condi ion o in e es .
In single-cell spa ially esol ed da a wi h genes exhibi ing spa ial a ia ion and ze o in la ion,
Hypo hesis 1 becomes p oblema ic and inapp op ia e o inding di e en ial exp ession genes in
single-cell analysis.
2.2 Spa ialDENe : The p oposed amewo k
To add ess he abo e conce n, we p oposed a uni ied amewo k ha add esses spa ial con ounding,
spa ial misalignmen , he empo al e olu ion o gene exp ession, and ze o-in la ion p oblems in
single-cell spa ially esol ed da a.
2.2.1 Response model
Conside a scena io whe e we ha e p e-p ocessed single-cell exp ession da a collec ed o e ime.
Le πππ π‘, π =1,2, ..., π;π=1,2, ..., πΊ,π‘=1,2, ..., π be a gene exp ession coun a spa ial loca ion
deno ed by π a ime π‘ o gene π.πis he o al numbe o spo s/cells ac oss all issues. No e he e ha
he cell index π p e iously de ined as a cell is now ede ined as a spo index π in spa ial ansc ip omics
da a. We assume ha
πππ π‘ |π½π0, π½π1,π·πβΌNB(πππ π‘ , ππ),
log(πππ π‘)=π½π0+log(ππ π‘ ) +ππ π‘ π½π1+xβ€
π π‘ π·π+πππ π‘,
(4)
whe e πππ π‘ is a spa io empo al la en a ia ion used o adjus o spa ial con ounding in he gene
exp ession da a, ππ π‘ is he size ac o , ππ π‘ β {0,1}is he condi ion indica o o spa ial poin π a ime
π‘. The di e en ial genes a e hen iden i ied using Hypo hesis 1.
In s anda d spa ial s a is ical modeling, whe e he spa ial loca ion domain emains ixed, πππ π‘
in Equa ion (4) can be easily es ima ed by assuming a Gaussian Ma ko andom ield (GMRF)
p io dis ibu ion. Howe e , in single-cell analysis, he spa ial domain ( issue sample) dissocia es
du ing da a collec ion and hus, di e en issues a e used in he ea men and con ol condi ions,
3
causing spa ial misalignmen due o non-homologous issue samples. To add ess his challenge, we
model πππ π‘ using a Ne wo k-Based-GMRF p io dis ibu ion, which is discussed in he subsequen
subsec ion.
2.2.2 De i ing ne wo k-based-GMRF
To de ine a ne wo k-based Gaussian Ma ko Random Field (GMRF) p io o modeling spa io em-
po al la en e ec s, we in oduce a amewo k ha cons uc s a dynamic cell-neighbo hood ne wo k
o e a spa ial domain, in o med by gene exp ession summa ies14.
Le Ddeno e a egula spa ial domain o a speci ic issue sample, such ha π β D. Fo each ime
π‘o a speci ic issue sample, he domain Dπ‘β D is non-linea ly pa i ioned in o non-o e lapping
spa ial egions π·ππ‘ ,π=1,2, ..., πΌ, called a node, such ha
Dπ‘=
πΌπ‘
Γ
π=1
π·ππ‘ , π·ππ‘ β©π·πβ²π‘=β
o πβ πβ².(5)
Fo each pa i ion π·ππ‘ , we calcula e a ep esen a i e cen oid using a summa y s a is ic, such as he
mean exp ession o he p incipal componen s (PCs) de i ed om he gene exp ession da a. Suppose
he educed gene exp ession space consis s o 10 PCs; o each pa i ion π·ππ‘ , we compu e he mean
alue o each PC ac oss all cells wi hin ha pa i ion. Consequen ly, each π·ππ‘ is ep esen ed by a
ec o o 10 mean alues, co esponding o he 10 PCs. The numbe o nodes is chosen o esul in
op imal p ecision. We hen de ine a cell-neighbo hood ne wo k Tby connec ing each node π·ππ‘ o i s
π-nea es neighbo s based on cen oid p oximi y. Fo mally, de ine an undi ec ed g aph T=(G,E),
whe e Gis he se o nodes (pa i ions ac oss all π‘) and Eis he se o edges, such ha (π, π‘)βΌ(π, π‘β²)
i and only i π·ππ‘β²is among he πnea es neighbo s o π·ππ‘ based on cen oid dis ance. Fo example,
i he e exis s a o al o 1000 non-o e lapping pa i ions o D, he ne wo k Twill ha e 1000 nodes
(#G=1000), indica ing ha each cell/spo belongs o only one o he 1000 nodes. Gi en he nodes
in G, he Ne wo k Tis used o inco po a e he spo /cell in e ac ion and dependencies in o med by
he ela ionship be ween he cellβs exp ession s a us ac oss all he genes.
To ob ain he ne wo k-based GMRF, suppose ne wo k Thas πnodes, wi h ππππ‘ βR ep e-
sen ing he node la en e ec o node πa ime π‘. Le πππ‘ =(ππ1π‘, ππ2π‘, ..., ππππ‘ )πand ππ=
(ππ1,ππ2, ..., πππ )π. We assumed a Gaussian Ma ko Random Field (GMRF) on he la en a i-
ables ππππ‘ , which cap u es he ne wo k s uc u e. Le Nπbe he collec ion o all he index se s o
nodes ha ing an edge wi h node πon ne wo k T, hen he ne wo k-based GMRF is de ined as
ππππ‘ |πβπ
π,NπβΌπξΓπβNπππ ππ‘
#Nπ
,1
#Nπππξ,(6)
whe e #Nπis he o al numbe o nodes connec ed o node π.πβπ
πis ππbu excluding componen
ππππ‘ om he ec o . Equa ion (6) shows ha he expec ed alue o he la en a iable in node πis
4
he a e age o he alues o he la en a iables ep esen ing he nodes connec ed o node π, and he
a iance is scaled by he numbe o edges o node π. The equa ion cap u es he dependency be ween
he nodes ac oss he ne wo k. Fo example conside a ne wo k T=(G,E) such ha he node se is
G={1,2,3,4,5}and edge se E={1βΌ3,1βΌ2,2βΌ3,2βΌ4,3βΌ4,3βΌ5}, whe e πβΌπindica es
ha node πis connec ed o node πon he ne wo k. The e o e, N1={2,3},N2={1,3,4},N3=
{1,2,4,5},N4={2,3},N5={3}. The join dis ibu ion o he ne wo k-based-GMRF o he la en
a iable ππ|ππβΌπ(0,πΊ(ππ)), whe e πΊ(ππ)=(ππQ)β1and Qis a s uc u ed ma ix ha cap u es
he spa ial s uc u e gi en in Equa ion (6), which is de ined as
πππβ²=ο£±






ο£³
|Nπ|,i π=πβ²,
β1,i πβ Nπ,
0,o he wise.
(7)
2.2.3 Ze o-In la ion join model
A se ious conce n wi h single-cell da a is i s spa si y. The exp ession con ains excessi e ze os ha
can bias mos modeling app oaches, especially in e p e able models. As a esul , i is impo an
o accoun o hese ze oes in he modeling amewo k o di e en ia e be ween ue ze oes and
biological ze os. To add ess his conce n, we adop ed a β wo-pa " modeling echnique. In he i s
pa , we model he ac i a ion p ocess o gene π h ough a logis ic model. We model he p obabili y
ha a speci ic gene is ac i a ed (exp essed) o no . In he second s ep, he ex en o ac i a ion is
modeled h ough a di e en s anda d p obabili y model.
Ma hema ically, de ine a new a iable πππ π‘ such ha
πππ π‘ =(1i πππ π‘ >0,
0o he wise. (8)
Thus, o a gi en gene π, we assume ha πππ π‘ βΌBe noulli(πππ π‘), whe e πππ π‘ deno es he p obabili y
o obse ing non-ze o exp ession. Mo eo e , we de ine ano he a iable πππ π‘ =πππ π‘ only i πππ π‘ =1,
and πππ π‘ is modeled using a ze o- unca ed nega i e binomial dis ibu ion.
We de ine ππππ‘ as he la en e ec associa ed wi h node πa ime π‘. Each spo π is assigned
o a node π(π ), and hus he spo -le el e ec is gi en by πππ π‘ =ππ,π(π ),π‘ . The ull model o he
Spa ialDENe is gi en as
5
πππ π‘ |.βΌBe noulli(πππ π‘),
log ξπππ π‘
1βπππ π‘ ξ=πΌπ0+ππ π‘ πΌπ1+xπ
π π‘ πΆπ+ππππ‘ , π βnode π
πππ π‘ |.βΌNega i eBinomial(πππ π‘, ππ),
log(πππ π‘ )=π½π0+log(ππ π‘ ) +ππ π‘ π½π1+xπ
π π‘ π·π+ππππ‘ ,
ππβΌπξ0,πΊ(ππ)ξ,
(πΌπ0, πΌπ1,πΆπ, π½π0, π½π1,π·π)πβΌπππ(0,104I),
π²βΌπ(π²),
(9)
whe e πππ π‘ is he p obabili y ha a speci ic gene πis biologically ac i a ed. Each spo π belongs
o a node π(π ). Thus, in he linea p edic o e m, ππππ‘ is included h ough ππ,π(π )π‘, which is sha ed
be ween he bina y and he coun componen s. As p e iously de ined, ππππ‘ adjus s o he spa ial
con ounding in he ac i a ion componen o he model using he ne wo k-based-GMRF. π²is a ec o
o hype pa ame e s, π²=(ππ, ππ)πand π(π²)is he p io dis ibu ion o π². We assigned log-
gamma p io o ππ,log(ππ) βΌ πππ βπΊππππ(1,0.00005). We adop ed he PC p io dis ibu ion
o ππ, which is among he mos widely used p io dis ibu ions due o i s obus ness. The PC p io
dis ibu ion o π=ππis gi en as
π(π)=π
2πβ3/2exp ξβπ πβ1/2ξ, o π > 0,(10)
whe e π=βlog πΌ
π’, such ha π(1
βπ> π’)=πΌ. The p io is ully speci ied i π’and πΌa e ixed o
known, which can be in o ma i ely de i ed om he empi ical da a.
3 Simula ion s udy
We conduc ed a simula ion s udy o benchma k Spa ialDENe wi h commonly used me hods in
he li e a u e. To simula e he gene exp ession da a, we adop ed a ze o in la ed nega i e binomial
dis ibu ion. To simula e he spa ially andom e o , we adop ed a Gaussian bump model. The da a
gene a ion model is gi en as
xcoo d βΌuni o m(0,1)
ycoo d βΌuni o m(0,1)
ππ(π , π‘)=exp ξβ2π‘((xcoo d β0.5)2+ (ycoo d β0.5)2)ξ
log(πππ π‘)=π½π0+ππ π‘ π½π1+ππ(π , π‘)
πππ π‘ βΌBe noulli(πππ π‘)
πππ π‘ =(0i πππ π‘ =0,
NB(πππ π‘ , ππ)i πππ π‘ =1.
(11)
6
whe e xcoo d and ycoo d ep esen he spa ial coo dina es o each loca ion, and ππ(π , π‘)deno es
he spa ially a ying e o e m, which can po en ially con ound he es ima ion o π½π1. The e o is
highe owa ds he cen e o he domain and ades away owa ds he edges. We assumed an e ec
size o π½π1=[2,4], π =1,2, ..., πΊ be ween he ea men and con ol condi ions. We delibe a ely
in oduced his spa ial e o o e alua e how e ec i ely he ne wo k-based model cap u es spa ial
s uc u e, wi hou di ec ly simula ing om he ne wo k-based GMRF.
To simula e he di e en ially exp essed genes, we se ππ π‘ =1in he ea men condi ion and
ππ π‘ =0in he con ol condi ion. To simula e non-di e en ially exp essed genes, we se π½π1=0 o
bo h ea men and con ol. In he simula ion, πππ π‘ =0.6,βπ, π , π‘.π½0was ixed o 1and he dispe sion
pa ame e ππ=ππ=1,βπ.
Gi en he simula ed da a, we compa e Spa ialDENe wi h commonly used di e en ial analysis
me hods in he li e a u e. Speci ically, we conside ed DESeq23, EdgeR4, Limma5, MAST6, and
monocle315. Figu e 1a shows he andomly selec ed spa ial loca ion wi h he spa ial domain (0,1)2.
Using π(π , π‘), he igu e shows ha he spa ial pa e n exhibi s highe in ensi y mo ing close o he
cen e o he spa ial domain. This indica es ha genes ha a e mo e exp essed in he cen e egion
end o be ela i ely mo e a ec ed by spa ial con ounding issues. Using he spa ial e ec π(π , π‘)in
he s ochas ic ep esen a ion in Equa ion (11), di e en ially and non-di e en ially exp essed genes
a e simula ed. Figu e 1b shows he Spa ialDENe ep esen a ion o he spa ial domain. Each node
is a clus e o neighbo ing poin s, and he size o he ne wo k de e mines he numbe o neighbo ing
spa ial loca ions p esen in he da a. La ge nodes ha e a highe numbe o spa ial loca ions. The
g aph is colo ed by he node-a e aged simula ed spa ial e ec .
(a) (b)
Spa ialDENe
EdgeR
DESeq2
MAST
Monocol3
False Disco e y Ra e
Powe
(c)
Figu e 1: Simula ion s udy: (a) The simula ed spa ial con ounding a iable dis ibu ed ac oss (0,1)
in bo h x and y axes. (b) The ne wo k ep esen a ion o he simula ed spa ial egion. (c) The powe
agains alse disco e y a es o he compe ing models.
We simula ed 1000 genes in o al. O hose, 100 (10%) di e en ially exp essed genes be ween
con ol and ea men condi ions we e simula ed. The plo o he powe agains he alse disco e y
a e be ween Monocle 3, MAST, DESeq2, EdgeR, and spa ialDENe is shown in Figu e 1c. The
7
powe and he FDR we e compu ed using
Powe =π π
ππ +πΉπ ,FDR =πΉπ
ππ +πΉπ ,(12)
whe e ππ is ue posi i e, πΉπ is alse posi i e, and πΉπ is alse nega i e. The esul s showed ha
DESeq2 achie ed a powe o 0.80 a an FDR o 0.005, pe o ming ela i ely well compa ed o o he
me hods. Howe e , spa ialDENe ou pe o med DESeq2, a aining a powe o o e 0.82 a an
FDR o 0.01 and exceeding 0.90 a an FDR o 0.02. In con as , DESeq2 eached only 0.81 powe
a he same FDR le el o 0.02. These indings highligh he impo ance o accoun ing o spa ial
con ounding e ec s when iden i ying di e en ially exp essed genes.
We u he conduc ed 30 independen simula ion uns o compa e spa ialDENe wi h o he
compe ing models using FDR and powe as p ima y e alua ion me ics. Fo each simula ion scena io,
we calcula ed he FDR, powe , and he co esponding composi e me ics, F1 sco e, and Youdenβs J
s a is ic, o assess he o e all pe o mance o he models comp ehensi ely. The F1 sco e and Youdenβs
J s a is ic a e de ined as
F1 =2(1βFDR)Powe
(1βFDR) +Powe ,Youdenβs J =Powe βFDR.(13)
Bo h he F1 sco e and Youdenβs J s a is ic in eg a e powe and FDR o p o ide a uni ied measu e o
a me hodβs ue pe o mance. Me hods ha achie e highe alues o hese me ics a e conside ed o
pe o m be e o e all, as hey e ec i ely balance sensi i i y and alse disco e y con ol.
8
YoudenJ
F1
FDR Powe
(a) (b)
(d)
(c)
Figu e 2: Benchma king analysis in syn he ic da a: (a) False disco e y a e, (b) Powe , (c) uni ied F1
sco e, (d) Youdenβs J s a is ic.
Figu e 2a & b show he box plo o he FDR and powe o DESeq2, EdgeR, Limma, MAST,
Monocle, and Spa ialDENe . Findings showed ha DESeq2 and Spa ialDENe had simila le els
o FDR, which is be e han o he compe ing models. Howe e , judging by he powe , Spa ialDENe
ou pe o med DESeq2 and o he compe ing models (Figu e 2b). Mo eo e , Monocle had he highes
9