-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFig4_SexDE.Rmd
1099 lines (947 loc) · 56.2 KB
/
Fig4_SexDE.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
title: "Fig4_SexDE"
output: html_document
date: "2024-08-28"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(fig.height = 10,fig.width = 7,include = FALSE)
#### sets tab autocompletion for directories to begin from the directory containing the .Rproj session, instead of the script's directory if different
knitr::opts_knit$set(root.dir = here::here())
library(data.table) # Preferred data manipulation package
library(ggplot2) # Dependency for several plotting functions
library(ggtext) # more character types in ggplots
library(ggrepel) # text labels in volcano plots
library(ggrastr) # avoid making raster images one can't even open
library(SpatialExperiment) # Visium data framework
library(SpatialFeatureExperiment) # Xenium data framework
library(spatialLIBD) # one option for plotting cluster assignments, but breaks when the in-tissue portion of a visium area is very un-square.
library(escheR) # alternative spotplotting function, at least for visium
library(viridis) # palettes
library(Polychrome) # better palettes
library(ggstance) # for y axis dodge
library(sf) # define the polygonal boundaries of xenium domains
## rstudio GUI tweaks
require(colorout)
ColorOut()
options("styler.addins_style_transformer" = "biocthis::bioc_style()")
##
## enable forked parallel processing with BiocParallel::multicoreParam, future::, etc. seemed to need this a couple times, but otherwise havent so its here as a preventative measure. part of this is adding the line
# OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
# to Renviron.site. see e.g. top response on https://stackoverflow.com/questions/73638290/python-on-mac-is-it-safe-to-set-objc-disable-initialize-fork-safety-yes-globall
library(parallelly)
options(parallelly.supportsMulticore.disableOn="")
options(parallelly.fork.enable=TRUE)
library(BiocParallel)
options(bphost="localhost")
## ggplot defaults
theme_set(theme_bw() + theme(axis.text.x = element_text(size = 8), axis.title.x = element_text(size = 9), axis.text.y = element_text(size = 8), axis.title.y = element_text(size = 9), plot.title = element_blank(), strip.text = element_text(size = 10), legend.text = element_text(size = 8), legend.title = element_text(size = 8, hjust = 0.5)))
## last of all, unload the base package datasets, whose data keep getting in the way of autocompletions (e.g., Theoph is priortized over TRUE)
unloadNamespace("datasets")
```
#### VISIUM setup ####
```{r}
hyp2 <- readRDS("spatial_HYP/processed-data/03-QC_filters/hypN10_umi210_gene126_chrm50_spotsweeped_lognorm_rotsNmirrors_072224.RDS")
bscl <- fread("spatial_HYP/processed-data/06-BayesSpace/01-bayesspace60kiter_k15-20-31_out/BSpace_k15_HARMONYlmbna_nnsvg10.txt") # main visium clustering (bs=bayesspace)
setnames(bscl,2,"cl")
bscl[,cl:=paste0("Vis",cl)]
bscl[cl=="Vis7",cl:="VMH.1"]
bscl[cl=="Vis12",cl:="VMH.2"]
bscl[cl=="Vis4",cl:="ARC.1"]
bscl[cl=="Vis6",cl:="ARC.2"]
bscl[,dom:=cl]
bscl[dom %in% c("VMH.1","VMH.2"),dom:="VMH"]
bscl[dom %in% c("ARC.1","ARC.2"),dom:="ARC"]
bscl[!(dom %in% c("VMH","ARC")),dom:="Other"]
bscl<-DataFrame(bscl,row.names=bscl$rn)[colnames(hyp2),]
hyp2$k15dom <- bscl$cl
hyp2$`Visium Domain` <- factor(bscl$dom,levels=c("ARC","VMH","Other"))
```
### XENIUM setup ###
```{r}
hypx <- readRDS("xenium_HYP/processed-data/05_Banksy_M0lam0_res2_multisamp/01-sfe-in_staggered-coords_genetarg-only_NONlog-norm.RDS")
bksmooth <- fread("xenium_HYP/processed-data/07_Domains-subdomains_by_knnSmoothing_Banksytypes/03b-ARCVMHdomains_2stepsmooth_VMH-k10-0.2-VMH-k200-0.2_ARC-k50-0.1_ARC-k500-0.5.txt") ## xenium domain assignments after smoothing, by xenium cell
## but drop discarded cell clusters, too
bkcl <- fread("xenium_HYP/processed-data/05_Banksy_M0lam0_res2_multisamp/01-BanksyClusts_M0lam0_leiden_multisamp.txt")
setnames(bkcl,2,"cl")
bkanno <- fread("xenium_HYP/processed-data/05_Banksy_M0lam0_res2_multisamp/02-M0l0kg6_topClusMarkers_celltypes_annotated.txt")
## drop sample-specific clusters, append cluster annotations
bkanno <- unique(bkanno[,.(clus,bjm_annot)])
bkanno <- bkanno[bjm_annot!="DISCARD"&bjm_annot!="VMH_4_DISCARD"]
bkcl <- merge.data.table(bkcl,bkanno,by.x="cl",by.y="clus")
## drop excluded clusters from xenium spe
hypx <- hypx[,colnames(hypx) %in% bkcl$rn]
## append cluster annots to xenium spe
bkcl <- DataFrame(bkcl,row.names=bkcl$rn)[colnames(hypx),]
bkcl$rn <- NULL
hypx$banksyclus <- bkcl$bjm_annot
## assign the domain labels to the xenium cells
bksmooth[dualVMHARC4=="other",dualVMHARC4:="Other"]
bksmooth <- DataFrame(bksmooth,row.names=bksmooth$rn)[colnames(hypx),]
hypx$dom <- bksmooth$dualVMHARC4
mscriptids <- fread("standardized_sampleids_for_plotting.txt")
```
### sex DE results
```{r}
visde <- fread("spatial_HYP/processed-data/09-Sex DE/01c-voomLmFit_nnsvg10-HmnylmbNA-BS-15-VMHARCclpsd.txt")
### exclude sex chromosomal, mito genes (need to append this info)
genelut <- fread("spatial_HYP/raw-data/USEFOR10X_ensg_lut_hg38_fromEns98_111123.txt")
genelut <- unique(genelut[,.(ensembl_gene_id,chromosome_name)])
setnames(genelut,c("ens","chr"))
visde <- merge.data.table(visde,genelut,by.x="gene_id",by.y="ens")
visde <- visde[!(chr %in% c("MT","X","Y"))]
### load by cell type and full-domains xenium results from 4 ARC-cell-type-smoothing domain
xenarcde <- fread("xenium_HYP/processed-data/08_VMH-ARC cell type sex DE within domains/02a-4ARCtypesmoothed_withinARC_celltypeSexDE.txt")
xenvmhde <- fread("xenium_HYP/processed-data/08_VMH-ARC cell type sex DE within domains/02b-4ARCtypesmoothed_withinVMH_celltypeSexDE.txt")
xendomde <- fread("xenium_HYP/processed-data/08_VMH-ARC cell type sex DE within domains/04-4typeARC-and-dualassignVMH_domainwise_sexDE.txt")
### for correlation plot, merge xenium domain and visium arc/vmh stats
vistmp <- copy(visde[assay %in% c("VMH","ARC")])
setnames(vistmp,"logFC","logFC_Visium")
setnames(xendomde,"logFC_MvF","logFC_Xenium")
xendomdecor <- merge.data.table(xendomde[,.(domain,gene_name,logFC_Xenium)],vistmp[,.(assay,gene_name,logFC_Visium)],by.x=c("domain","gene_name"),by.y=c("assay","gene_name"))
### lastly, we need the pseudobulk expression tables for making plots of that stuff
xpb <- readRDS("xenium_HYP/processed-data/08_VMH-ARC cell type sex DE within domains/04b-4typeARC-VMH_domainAllCells_pseudobulkxprs.RDS")
vpb <- readRDS("spatial_HYP/processed-data/09-Sex DE/01d-pseudobulkExpr_01-voomLmFit_svg10-svg20-hvg20_Hmnydflt-mnn30-HmnylmbNA_BS-15-20-31-15VMHARCclpsd.RDS")
vpb <- vpb[["BSpace_k15_HARMONYlmbna_nnsvg10_clpsdARC_clpsdVMH"]]
vpb <- vpb[assay %in% c("VMH","ARC")]
## clean up
rm(genelut,vistmp)
```
## palette set up (shared)
```{r}
pals <- readRDS("manuscript_plot_code/domain_and_xencluster_palettes_CHECKPALNAMESBEFOREUS.RDS")
pal <- pals[["Domains"]]
```
# Panel A, option 1: volcano of Visium ARC, VMH DE, colored by assay
```{r}
visdeplt <- visde[assay %in% c("ARC","VMH")]
## points to label
visdeplt <- visdeplt[assay=="VMH"&gene_name %in% c("MYT1L","TAC1","MC4R","TMEM233","CYP26A1","EGR1","ESR1","PGR"),label:=gene_name]
visdeplt[assay=="ARC"&gene_name %in% c("MYT1L","RDH10","RXRG","CDH13","CYP26A1","EGR1","ESR1","PGR","KCNMB2","SOCS1"),label:=gene_name]
p <- ggplot(visdeplt, aes(y = -log10(P.Value), x = logFC,col=assay)) +
geom_point(aes(size = -log10(P.Value),stroke=0.1*-log10(P.Value))) +
scale_size_continuous(guide = "none",
range = c(0.005,.35),
breaks = seq(0.1,7,0.01)) +
scale_color_manual(values=pal[1:2]) +
geom_hline(yintercept = -log10(0.05),
linetype = "dashed",
color = "black",
linewidth=0.25) +
geom_hline(yintercept = -log10(max(visdeplt[adj.P.Val<0.05,P.Value])),
linetype = "dashed",
color = "red",
linewidth=0.25) +
geom_text_repel(aes(y = -log10(P.Value),
x = logFC,
label = ifelse(is.na(label), "", label)),
#nudge_y = ifelse(vmhde$genelabel %in% c("PTGR1","CACNA1D"), yes = 1.2, no = -0.4),
#nudge_x = ifelse(vmhde$genelabel%in%c("HACE1","CACNA1D"),yes=sign(vmhde$logFC)*1,no=sign(vmhde$logFC)*0.3),
min.segment.length = 0,
size = 0.9,
show.legend=FALSE,
max.overlaps = 10000,
nudge_x=0.6*sign(visdeplt$logFC),
nudge_y=sample(0.4,-0.4,replace=T),
#seed = 10403,
max.iter=100000,
max.time=3,
segment.size=0.125)+
xlab("logFC (M:F)")+
ylab("-log10 (P-value)")+
labs(color="Visium\nDomain")+
theme(axis.text=element_text(size=7),axis.title=element_text(size=7.5),legend.key.height = ggplot2::unit(0.075,"in"),legend.key.width=ggplot2::unit(0.04,"in"),legend.position.inside = c(0.13,0.13),legend.position = "inside",legend.text=element_text(size=5,margin=margin(0,0,0,0,"in")),legend.box=element_blank(),legend.background=element_blank(),legend.title = element_text(size=6,vjust=0.5,margin=margin(0,0,0.01,0,"in")))
# rasterize
p <- rasterize(p,layers="Points",dpi=450,dev="cairo_png")
# save
pdf("manuscript_plots/Fig4/4A-Visium Sex DE Volcano_ptsizeByP.pdf",height=2.5,width=2.3)
p
dev.off()
# clean up
rm(visdeplt,p)
```
Panel A, option 2: Visium VMH volcano
```{r}
visdeplt <- visde[assay=="VMH"]
## points to label
visdeplt <- visdeplt[assay=="VMH"&gene_name %in% c("MYT1L","TAC1","MC4R","CYP26A1","TMEM233","EGR1","ESR1","PGR"),label:=gene_name]
## no fdr sig genes here; min FDR 0.07 and corresponding p value is 6.904826e-05, so conveniently we can approximate FDR ~= p*10^-3 at this range, and use p 5e-05 to draw the line
# additionally, we want all the lines labeling points with genes to be pointing from the right on lfc + or left on LFC -, EXCEPT for CYP26A1, which is negative but we want to the right. so pull out the LFC vector we'll use to draw the lines with a value flip for CYP26A1
nudges <- visdeplt[,.(gene_name,logFC)]
nudges[gene_name=="CYP26A1",logFC:=-logFC]
p <- ggplot(visdeplt[assay=="VMH"], aes(y = -log10(P.Value), x = logFC,col=assay))+
geom_point(aes(size = -log10(P.Value),stroke=0.1*-log10(P.Value))) +
scale_size_continuous(guide = "none",
range = c(0.005,.35),
breaks = seq(0.1,7,0.01)) +
ggtitle("VMH (Visium)")+
scale_color_manual(values=pal[1]) +
geom_hline(yintercept = -log10(0.05),
linetype = "dashed",
color = "black",
linewidth=0.25) +
geom_hline(yintercept = -log10(5e-5),
linetype = "dashed",
color = "red",
linewidth=0.25) +
geom_text_repel(seed = 23942,aes(y = -log10(P.Value),
x = logFC,
label = ifelse(is.na(label), "", label)),
min.segment.length = 0,
size = 1.5,
show.legend=FALSE,
nudge_x=1.25*sign(nudges$logFC),
#seed=10403,
max.iter=100000,
max.overlaps=10000,
max.time=3,
segment.size=0.125)+
scale_x_continuous(limits=c(min(visdeplt$logFC),max(visdeplt$logFC)),expand=c(0.025,0.025))+
xlab("logFC (M:F)")+
ylab("-log10 (P-value)")+
guides(color="none")+
theme(axis.text=element_text(size=7),axis.title=element_text(size=7.5),plot.title=element_text(size=9,hjust=0.5,margin = margin(0,0,0.025,0,"in")))
p <- rasterize(p,layers="Points",dpi=450,dev="cairo_png")
# save
pdf("manuscript_plots/Fig4/4Aalt-Visium VMH Sex DE Volcano_sizeByP.pdf",height=2,width=1.95)
p
dev.off()
rm(nudges)
```
Panel B alt: xenium VMH domain-allcells DE
```{r}
xendomdeplt <- xendomde[domain %in% c("VMH")]
## points to label
xendomdeplt <- xendomdeplt[gene_name %in% c("MYT1L","TAC1","MC4R","CYP26A1","TMEM233","EGR1","ESR1","PGR"),label:=gene_name]
p <- ggplot(xendomdeplt, aes(y = -log10(P.Value), x = logFC_Xenium,col=domain)) +
geom_point(aes(size = -log10(P.Value),stroke=0.1*-log10(P.Value))) +
scale_size_continuous(guide = "none",
range = c(0.1,.5),
breaks = seq(0.1,4,0.01)) +
ggtitle("VMH (Xenium, All Cells)")+
scale_color_manual(values=pal[1]) +
geom_hline(yintercept = -log10(0.05),
linetype = "dashed",
color = "black",
linewidth=0.25) +
geom_hline(yintercept = -log10(5e-5),
linetype = "dashed",
color = "red",
linewidth=0.25) +
geom_text_repel(aes(y = -log10(P.Value),
x = logFC_Xenium,
label = ifelse(is.na(label), "", label)),
min.segment.length = 0,
size = 1.5,
show.legend=FALSE,
nudge_x=1.25*sign(xendomdeplt$logFC_Xenium),
seed=10403,
max.iter=100000,
max.overlaps=10000,
max.time=3,
segment.size=0.125)+
scale_x_continuous(limits=c(-4,2.5),expand=c(0,0))+
xlab("logFC (M:F)")+
ylab("-log10 (P-value)")+
guides(color="none")+
theme(axis.text=element_text(size=7),axis.title=element_text(size=7.5),plot.title=element_text(size=9,hjust=0.5,margin = margin(0,0,0.025,0,"in")))
p <- rasterize(p,layers="Points",dpi=450,dev="cairo_png")
# save
pdf("manuscript_plots/Fig4/4Balt-Xenium VMH domain, all cells considered together_sizeByP.pdf",height=2,width=1.95)
p
dev.off()
```
## panel C alt: Visium ARC volcano plot
```{r}
visdeplt <- visde[assay=="ARC"][gene_name %in% c("MYT1L","RDH10","RXRG","CDH13","CYP26A1","EGR1","ESR1","PGR","KCNMB2","SOCS1"),label:=gene_name]
p <- ggplot(visdeplt, aes(y = -log10(P.Value), x = logFC,col=assay)) +
geom_point(aes(size = -log10(P.Value),stroke=0.1*-log10(P.Value))) +
scale_size_continuous(guide = "none",
range = c(0.005,.35),
breaks = seq(0.1,4,0.01)) +
ggtitle("ARC (Visium)")+
scale_color_manual(values=pal) +
geom_hline(yintercept = -log10(0.05),
linetype = "dashed",
color = "black",
linewidth=0.25) +
geom_hline(yintercept = -log10(5e-5),
linetype = "dashed",
color = "red",
linewidth=0.25) +
geom_text_repel(aes(y = -log10(P.Value),
x = logFC,
label = ifelse(is.na(label), "", label)),
min.segment.length = 0,
size = 1.5,
show.legend=FALSE,
#nudge_x=0.85*sign(visdeplt$logFC),
seed=10403,
max.iter=100000,
max.overlaps=10000,
max.time=3,
segment.size=0.125)+
# scale_x_continuous(limits=c(-4,2.5),expand=c(0,0))+
xlab("logFC (M:F)")+
ylab("-log10 (P-value)")+
guides(color="none")+
theme(axis.text=element_text(size=7),axis.title=element_text(size=7.5),plot.title=element_text(size=9,hjust=0.5,margin = margin(0,0,0.025,0,"in")))
# rasterize
p <- rasterize(p,layers="Points",dpi=450,dev="cairo_png")
# save
pdf("manuscript_plots/Fig4/4Calt-Visium ARC Sex DE Volcano_sizeByP.pdf",height=2,width=1.95)
p
dev.off()
```
### panel D alt: ARC xenium domain-wide DE
```{r}
xendomdeplt <- xendomde[domain %in% c("ARC")]
## points to label
xendomdeplt <- xendomdeplt[gene_name %in% c("MYT1L","RDH10","RXRG","CDH13","CYP26A1","EGR1","ESR1","PGR","KCNMB2","SOCS1"),label:=gene_name]
p <- ggplot(xendomdeplt, aes(y = -log10(P.Value), x = logFC_Xenium,col=domain)) +
geom_point(aes(size = -log10(P.Value),stroke=0.1*-log10(P.Value))) +
scale_size_continuous(guide = "none",
range = c(0.1,.5),
breaks = seq(0.1,4,0.01)) +
ggtitle("ARC (Xenium, All Cells)")+
scale_color_manual(values=pal[2]) +
geom_hline(yintercept = -log10(0.05),
linetype = "dashed",
color = "black",
linewidth=0.25) +
geom_hline(yintercept = -log10(5e-5),
linetype = "dashed",
color = "red",
linewidth=0.25) +
geom_text_repel(aes(y = -log10(P.Value),
x = logFC_Xenium,
label = ifelse(is.na(label), "", label)),
min.segment.length = 0,
size = 1.5,
show.legend=FALSE,
max.iter=100000,
max.overlaps=10000,
max.time=3,
segment.size=0.125)+
#scale_x_continuous(limits=c(-4,2.5),expand=c(0,0))+
xlab("logFC (M:F)")+
ylab("-log10 (P-value)")+
guides(color="none")+
theme(axis.text=element_text(size=7),axis.title=element_text(size=7.5),plot.title=element_text(size=9,hjust=0.5,margin = margin(0,0,0.025,0,"in")))
pdf("manuscript_plots/Fig4/4Dalt-Xenium ARC domain, all cells considered together_sizeByP.pdf",height=2,width=1.95)
p
dev.off()
```
Panels D-E and F-G are our representative male sample from Figure 2 and a female sample (we haven't displayed one yet). showing a VMH and an ARC sex DE in spotplots on Visium. For the VMH gene, we'll use TAC1, and for ARC we'll use RDH10. First we need to define the polygonal outlines that'll trace VMH and ARC in the two samples (which we did previously, including removal of select spots in order to make the spotplots more readable).
## male polygons:
```{r}
rownames(hyp2) <- rowData(hyp2)$gene_name
tac1M <- hyp2["TAC1",hyp2$sample_id=="V12Y31-080_A1"]
## attach the coordinate info to colData so we can subset to VMH points and wrap this gift. it'll take a bit
tmpcoldata <- as.data.table(as.data.frame(cbind(colData(tac1M),spatialCoords(tac1M))))
### these end up looking wacky without some stray spots removed, so we need to manually drop a handful of singletons
tmpcoldata <- tmpcoldata[Visium.Domain %in% c("ARC","VMH")]
# this will be easier to figure out using the array row/col values on a temporary plot with some lines overlaid to help pinpoint array coords to remove from the tracing. this doesn't account for the rotations or mirroring of the visium data, so grab a screenshot and rotate so that the x and y coords are not changed relative to the values we'll use to filter the table.
ggplot(tmpcoldata,aes(x=array_col,y=array_row,color=Visium.Domain))+
geom_point(size=1.5)+
geom_vline(xintercept=seq(0,max(tmpcoldata$array_col),by=5))+
geom_hline(yintercept=seq(0,max(tmpcoldata$array_row),5))
dev.off()
# ok just a couple easy drops here: ARC: drop col 30, row 22; 81,27; anything past col 100; anything in array_col>80&array_row<45
# VMH drop everything at row>35 & col > 78 and anything at array_col>90
tmpcoldata <- rbind(tmpcoldata[Visium.Domain=="ARC"&!((array_row==22&array_col==30)|(array_row==27&array_col==81)|array_col>100|(array_col>80&array_row<45))],
tmpcoldata[Visium.Domain=="VMH"&!(array_col>90|(array_col>78&array_row>35))])
## for plotting with geom_path, we need to add the first point at the end of the sequence as well. for vmh, we can use convex hull because..well, its a convex shape
tmpcoldata.sf <- st_as_sf(tmpcoldata,coords=c("array_col","array_row"))
vhull <- st_convex_hull(st_union(tmpcoldata.sf[tmpcoldata.sf$Visium.Domain=="VMH",]))
vhull <- vhull[[1]][[1]]
vhull <- rbind(vhull,vhull[1,])
rownames(vhull) <- rownames(vhull) <- paste0("pt",seq((1+nrow(vhull)),nrow(vhull)+nrow(vhull),by=1))
vhull <- as.data.table(vhull,keep.rownames=T)
ahull <- st_concave_hull(st_union(tmpcoldata.sf[tmpcoldata.sf$Visium.Domain=="ARC",]),ratio = 0.1)
ahull <- ahull[[1]][[1]]
ahull <- rbind(ahull,ahull[1,])
rownames(ahull) <- rownames(ahull) <- paste0("pt",seq((1+nrow(vhull)),nrow(vhull)+nrow(ahull),by=1))
ahull <- as.data.table(ahull,keep.rownames=T)
dompoly <- rbind(vhull,ahull)
## get the pixel-resolution values corresponding to these spots as pixel res is what escher uses to plot
dompoly2 <- merge.data.table(dompoly,tmpcoldata,by.x=c("V1","V2"),by.y=c("array_col","array_row"))
dompoly2[,rn:=as.numeric(gsub(rn,pattern="pt",replacement=""))]
setorderv(dompoly2,"rn")
rm(vhull,ahull,dompoly,tmpcoldata)
```
## female polygons:
```{r}
tac1F <- hyp2["TAC1",hyp2$sample_id=="V12D05-348_D1"]
## attach the coordinate info to colData so we can subset to VMH points and wrap this gift. it'll take a bit
tmpcoldata <- as.data.table(as.data.frame(cbind(colData(tac1F),spatialCoords(tac1F))))
### these end up looking wacky without some stray spots removed, so we need to manually drop a handful of singletons
tmpcoldata <- tmpcoldata[Visium.Domain %in% c("ARC","VMH")]
# this will be easier to figure out using the array row/col values on a temporary plot with some lines overlaid to help pinpoint array coords to remove from the tracing. this doesn't account for the rotations or mirroring of the visium data, so grab a screenshot and rotate so that the x and y coords are not changed relative to the values we'll use to filter the table.
ggplot(tmpcoldata,aes(x=array_col,y=array_row,color=Visium.Domain))+
geom_point(size=1.5)+
geom_vline(xintercept=seq(0,max(tmpcoldata$array_col),by=5))+
geom_hline(yintercept=seq(0,max(tmpcoldata$array_row),5))
dev.off()
# ok this one is REALLY easy: ARC, drop everything in array col >=30 and array_row > 50; VMH: drop %in% array_row==42
tmpcoldata <- rbind(tmpcoldata[Visium.Domain=="ARC"&!(array_col>=30&array_row>50)],
tmpcoldata[Visium.Domain=="VMH"&array_row!=42])
## for plotting with geom_path, we need to add the first point at the end of the sequence as well. for vmh, we can use convex hull because..well, its a convex shape
tmpcoldata.sf <- st_as_sf(tmpcoldata,coords=c("array_col","array_row"))
vhull <- st_convex_hull(st_union(tmpcoldata.sf[tmpcoldata.sf$Visium.Domain=="VMH",]))
vhull <- vhull[[1]][[1]]
vhull <- rbind(vhull,vhull[1,])
rownames(vhull) <- rownames(vhull) <- paste0("pt",seq((1+nrow(vhull)),nrow(vhull)+nrow(vhull),by=1))
vhull <- as.data.table(vhull,keep.rownames=T)
ahull <- st_concave_hull(st_union(tmpcoldata.sf[tmpcoldata.sf$Visium.Domain=="ARC",]),ratio = 0.1)
ahull <- ahull[[1]][[1]]
ahull <- rbind(ahull,ahull[1,])
rownames(ahull) <- rownames(ahull) <- paste0("pt",seq((1+nrow(vhull)),nrow(vhull)+nrow(ahull),by=1))
ahull <- as.data.table(ahull,keep.rownames=T)
dompoly <- rbind(vhull,ahull)
## get the pixel-resolution values corresponding to these spots as pixel res is what escher uses to plot
femdompoly2 <- merge.data.table(dompoly,tmpcoldata,by.x=c("V1","V2"),by.y=c("array_col","array_row"))
femdompoly2[,rn:=as.numeric(gsub(rn,pattern="pt",replacement=""))]
setorderv(femdompoly2,"rn")
rm(vhull,ahull,dompoly,tmpcoldata)
```
panel D/E. only put the logcounts in D (it's a shared scale for both panels)
```{r}
colData(tac1M)$`log counts` <- logcounts(tac1M)["TAC1",]
### make spotplots
p <- make_escheR(tac1M)
p <- p |> add_fill("log counts",size=0.64,point_size = 0.64)
#p <- p |> add_ground(var = "Visium Domain",stroke=0.15,point_size = 0.6)
pdf("manuscript_plots/Fig4/4D-TAC1_Visium_Male.pdf",height=1.75,width=2)
p+
geom_path(data=dompoly2,aes(x=pxl_col_in_fullres,y=pxl_row_in_fullres,group=Visium.Domain,color=Visium.Domain),size=0.25)+
scale_color_manual(values=pal)+
scale_fill_gradient(low="white",high="black",limits=c(0,5.5))+
ggtitle("*TAC1* (Male)")+
guides(color="none")+
labs(fill="log\ncounts")+
theme(plot.title.position = "plot",plot.title = element_markdown(size=10,hjust=0.5,margin=margin(0,0,-0.05,0,"in")),legend.text = element_text(size=7),legend.key.size = ggplot2::unit(0.125,"in") ,legend.title=element_text(size=7.5,hjust=0.5),plot.margin = margin(-0.05+0.05,0.03,-0.15,0,unit = "in"))
dev.off()
rm(tac1M,p)
###
colData(tac1F)$`log counts` <- logcounts(tac1F)["TAC1",]
### make spotplots
p <- make_escheR(tac1F)
p <- p |> add_fill("log counts",size=0.64,point_size = 0.64)
pdf("manuscript_plots/Fig4/4E-TAC1_Visium_Female.pdf",height=1.75,width=1.6)
p+
scale_color_manual(values=pal)+
geom_path(data=femdompoly2,aes(x=pxl_col_in_fullres,y=pxl_row_in_fullres,group=Visium.Domain,color=Visium.Domain),size=0.25)+
scale_fill_gradient(low="white",high="black",limits=c(0,5.5))+
ggtitle("*TAC1* (Female)")+
guides(color="none",fill="none")+
#labs(fill="log\ncounts")+
theme(plot.title.position = "plot",plot.title = element_markdown(size=10,hjust=0.5),legend.text = element_text(size=7),legend.key.size = ggplot2::unit(0.125,"in") ,legend.title=element_text(size=7.5,hjust=0.5),plot.margin = margin(-0.05,0.03,-0.05,0,unit = "in"))
dev.off()
rm(tac1F,p)
```
# F/G: RDH10, log counts only shown in F as is shared legend
```{r}
RDH10M <- hyp2["RDH10",hyp2$sample_id=="V12Y31-080_A1"]
colData(RDH10M)$`log counts` <- logcounts(RDH10M)["RDH10",]
### make spotplots
p <- make_escheR(RDH10M)
p <- p |> add_fill("log counts",size=0.64,point_size = 0.64)
pdf("manuscript_plots/Fig4/4F-RDH10_Visium_Male.pdf",height=1.75,width=2)
p+
scale_color_manual(values=pal)+
geom_path(data=dompoly2,aes(x=pxl_col_in_fullres,y=pxl_row_in_fullres,group=Visium.Domain,color=Visium.Domain),size=0.25)+
scale_fill_gradient(low="white",high="black",limits=c(0,3.1))+
ggtitle("*RDH10* (Male)")+
guides(color="none")+
labs(fill="log\ncounts")+
theme(plot.title.position = "plot",plot.title = element_markdown(size=10,hjust=0.5,margin=margin(0,0,-0.05,0,"in")),legend.text = element_text(size=7),legend.key.size = ggplot2::unit(0.125,"in") ,legend.title=element_text(size=7.5,hjust=0.5),plot.margin = margin(-0.05+0.05,0.03,-0.15,0,unit = "in"))
#theme(plot.title.position = "plot",plot.title = element_text(size=10,hjust=0.5),legend.text = element_text(size=8),legend.key.size = unit(0.125,"in"),legend.title=element_text(size=9),plot.margin = margin(-0.3,0,-0.1,0,unit = "in"))
dev.off()
rm(RDH10M,p)
###
RDH10F <- hyp2["RDH10",hyp2$sample_id=="V12D05-348_D1"]
colData(RDH10F)$`log counts` <- logcounts(RDH10F)["RDH10",]
### make spotplots
p <- make_escheR(RDH10F)
p <- p |> add_fill("log counts",size=0.64,point_size = 0.64)
pdf("manuscript_plots/Fig4/4G-RDH10_Visium_female.pdf",height=1.75,width=1.6)
p+
scale_color_manual(values=pal)+
geom_path(data=femdompoly2,aes(x=pxl_col_in_fullres,y=pxl_row_in_fullres,group=Visium.Domain,color=Visium.Domain),size=0.25)+
scale_fill_gradient(low="white",high="black",limits=c(0,3.1))+
ggtitle("*RDH10* (Female)")+
guides(color="none",fill="none")+
#labs(fill="log\ncounts")+
theme(plot.title.position = "plot",plot.title = element_markdown(size=10,hjust=0.5),legend.text = element_text(size=7),legend.key.size = ggplot2::unit(0.125,"in") ,legend.title=element_text(size=7.5,hjust=0.5),plot.margin = margin(-0.05,0.03,-0.05,0,unit = "in"))
dev.off()
rm(RDH10F,p)
```
for panels H-K, we want the respective donors' Xenium samples with the VMH/ARC boundaries displayed. so extract the two boundary sets
```{r}
panh <- hypx["TAC1",hypx$sample_id=="X86_reg1"]
pani <- hypx["TAC1",hypx$sample_id=="X97_reg3"]
#
## attach the coordinate info to colData so we can make an sf object out of this for hull extraction. see well-annotated code from DE benchmarking of domain boundaries in xenium_HYP/code/07/03c-DE benchmarks...
tmpcoldatah <- cbind(colData(panh),spatialCoords(panh))
tmpcoldatai <- cbind(colData(pani),spatialCoords(pani))
panhv <- st_as_sf(as.data.frame(tmpcoldatah[tmpcoldatah$dom=="VMH",]),coords = c("sdimx","sdimy"))
paniv <- st_as_sf(as.data.frame(tmpcoldatai[tmpcoldatai$dom=="VMH",]),coords = c("sdimx","sdimy"))
panhv <- st_convex_hull(st_union(panhv))
paniv <- st_convex_hull(st_union(paniv))
panha <- st_as_sf(as.data.frame(tmpcoldatah[tmpcoldatah$dom=="ARC",]),coords=c("sdimx","sdimy"))
pania <- st_as_sf(as.data.frame(tmpcoldatai[tmpcoldatai$dom=="ARC",]),coords=c("sdimx","sdimy"))
panha <- st_concave_hull(st_union(panha),ratio = 0.1)
pania <- st_concave_hull(st_union(pania),ratio = 0.1)
## create the data tables we will use for overlaying the boundary polygons
# panel h (and j)
dompolyh <- cbind(panhv[[1]][[1]],rep("VMH",nrow(panhv[[1]][[1]])))
dompolyh <- rbind(dompolyh,cbind(panha[[1]][[1]],rep("ARC",nrow(panha[[1]][[1]]))))
dompolyh <- as.data.table(dompolyh)
setnames(dompolyh,c("xpol","ypol","dompol"))
dompolyh[,xpol:=as.numeric(xpol)]
dompolyh[,ypol:=as.numeric(ypol)]
# panel i (and k)
dompolyi <- cbind(paniv[[1]][[1]],rep("VMH",nrow(paniv[[1]][[1]])))
dompolyi <- rbind(dompolyi,cbind(pania[[1]][[1]],rep("ARC",nrow(pania[[1]][[1]]))))
dompolyi <- as.data.table(dompolyi)
setnames(dompolyi,c("xpol","ypol","dompol"))
dompolyi[,xpol:=as.numeric(xpol)]
dompolyi[,ypol:=as.numeric(ypol)]
rm(panha,panhv,pania,paniv)
```
## panel H: TAC1 in VMH/ARC domains for male donor and panel I: for female. shared legend so only put in panel H.
```{r}
panh$`log counts` <- logcounts(panh)["TAC1",]
pani$`log counts` <- logcounts(pani)["TAC1",]
panh <- panh[,panh$`log counts`!=0]
pani <- pani[,pani$`log counts`!=0]
## panel h
p <- make_escheR(panh,y_reverse=FALSE)
p <- p |> add_fill("log counts",size=0.125,point_size = 0.125)
p <- p+
scale_fill_continuous("log\ncounts",low= "#FFFFFF",high="#000000",limits=c(0,6.1))+
geom_path(data=dompolyh,aes(x=xpol,y=ypol,group=dompol,col=dompol),linewidth = 0.25)+
scale_color_manual(values=pal,na.value = NA)+
ggtitle("*TAC1* (Male)")+
guides(color="none")+
theme(plot.title.position = "plot",plot.title = element_markdown(size=9,hjust=0.5,margin=margin(0.05,0,-0.05,0,"in")),legend.text = element_text(size=6),legend.key.size = ggplot2::unit(0.125,"in"),legend.title=element_text(size=7,vjust=0.5,hjust=0.5),plot.margin = margin(-0.07,0,-0.07,-0.1,unit = "in"),legend.margin=margin(0,0,0,-0.15,"in"),legend.box=element_blank(),legend.background=element_blank())
p <- rasterize(p,layer="Points",dpi=600)
pdf("manuscript_plots/Fig4/4H-TAC1_Xenium_Male.pdf",height=1.75,width=2)
p
dev.off()
rm(panh,p,tmpcoldatah)
## panel i
p <- make_escheR(pani,y_reverse=FALSE)
p <- p |> add_fill("log counts",size=0.125,point_size = 0.125)
p <- p+
scale_fill_continuous("log\ncounts",low= "#FFFFFF",high="#000000",limits=c(0,6.1))+
geom_path(data=dompolyi,aes(x=xpol,y=ypol,group=dompol,col=dompol),linewidth = 0.25)+
scale_color_manual(values=pal,na.value = NA)+
ggtitle("*TAC1* (Female)")+
guides(color="none",fill="none")+
theme(plot.title.position = "plot",plot.title = element_markdown(size=9,hjust=0.5,margin=margin(0.025,0,-0.08,0,"in")),legend.text = element_text(size=6),legend.key.size = ggplot2::unit(0.125,"in"),legend.title=element_text(size=7,vjust=0.5,hjust=0.5),plot.margin = margin(0,0,-0.09,-0.1,unit = "in"),legend.margin=margin(0,0,0,-0.15,"in"),legend.box=element_blank(),legend.background=element_blank())
p <- rasterize(p,layer="Points",dpi=600)
pdf("manuscript_plots/Fig4/4I-TAC1_Xenium_female.pdf",height=1.75,width=2)
p
dev.off()
rm(pani,tmpcoldatai,p)
```
pan j/k: RDH10 in same, legend only in j
```{r}
panj <- hypx["RDH10",hypx$sample_id=="X86_reg1"]
pank <- hypx["RDH10",hypx$sample_id=="X97_reg3"]
panj$`log counts` <- logcounts(panj)["RDH10",]
pank$`log counts` <- logcounts(pank)["RDH10",]
panj <- panj[,panj$`log counts`!=0]
pank <- pank[,pank$`log counts`!=0]
## panel h
p <- make_escheR(panj,y_reverse=FALSE)
p <- p |> add_fill("log counts",size=0.125,point_size = 0.125)
p <- p+
scale_fill_continuous("log\ncounts",low= "#FFFFFF",high="#000000",limits=c(0,5.02))+
geom_path(data=dompolyh,aes(x=xpol,y=ypol,group=dompol,col=dompol),linewidth = 0.25)+
scale_color_manual(values=pal,na.value = NA)+
ggtitle("*RDH10* (Male)")+
guides(color="none")+
theme(plot.title.position = "plot",plot.title = element_markdown(size=9,hjust=0.5,margin=margin(0.05,0,-0.05,0,"in")),legend.text = element_text(size=6),legend.key.size = ggplot2::unit(0.125,"in"),legend.title=element_text(size=7,vjust=0.5,hjust=0.5),plot.margin = margin(-0.07,0,-0.07,-0.1,unit = "in"),legend.margin=margin(0,0,0,-0.15,"in"),legend.box=element_blank(),legend.background=element_blank())
p <- rasterize(p,layer="Points",dpi=600)
pdf("manuscript_plots/Fig4/4J-RDH10_Xenium_Male.pdf",height=1.75,width=2)
p
dev.off()
# rm(panj,p,dompolyh)
## panel k
p <- make_escheR(pank,y_reverse=FALSE)
p <- p |> add_fill("log counts",size=0.125,point_size = 0.125)
p <- p+
scale_fill_continuous("log\ncounts",low= "#FFFFFF",high="#000000",limits=c(0,5.02))+
geom_path(data=dompolyi,aes(x=xpol,y=ypol,group=dompol,col=dompol),linewidth = 0.25)+
scale_color_manual(values=pal,na.value = NA)+
ggtitle("*RDH10* (Female)")+
guides(color="none",fill="none")+
theme(plot.title.position = "plot",plot.title = element_markdown(size=9,hjust=0.5,margin=margin(0.025,0,-0.08,0,"in")),legend.text = element_text(size=6),legend.key.size = ggplot2::unit(0.125,"in"),legend.title=element_text(size=7,vjust=0.5,hjust=0.5),plot.margin = margin(0,0,-0.09,-0.1,unit = "in"),legend.margin=margin(0,0,0,-0.15,"in"),legend.box=element_blank(),legend.background=element_blank())
p <- rasterize(p,layer="Points",dpi=600)
pdf("manuscript_plots/Fig4/4K-RDH10_Xenium_female.pdf",height=1.75,width=2)
p
dev.off()
# m(pank,p,dompolyi)
```
## to squeeze between visium/xenium panels for each gene: pseudobulk xpr boxplots in domain of interest
```{r}
vpb <- vpb[gene_name %in% c("TAC1","RDH10")]
vpb[,gene_id:=NULL]
setnames(vpb,"assay","domain")
vpb <- melt(vpb,id.vars=c("domain","gene_name"))
vpb <- merge.data.table(vpb,mscriptids,by.x="variable",by.y="sample_id")
vpb[,Sex:=gsub(manuscript_id,pattern="^.*_(.*)$",replacement="\\1")]
xpb <- rbindlist(xpb,idcol = "domain")
xpb <- xpb[rn %in% c("TAC1","RDH10")]
setnames(xpb,"rn","gene_name")
xpb <- melt(xpb,id.vars=c("domain","gene_name"))
xpb <- merge.data.table(xpb,mscriptids[,.(sample_id,manuscript_id)],by.x="variable",by.y="sample_id")
xpb[,Sex:=gsub(manuscript_id,pattern="^.*_(.*)$",replacement="\\1")]
### plots
pdf("manuscript_plots/Fig4/vVMH_TAC1_pbulks.pdf",height=1,width=0.6)
ggplot(vpb[gene_name=="TAC1"&domain=="VMH"],aes(x=Sex,y=value,col=domain,fill=Sex))+
geom_boxplot(outliers = FALSE)+
scale_color_manual(values=pal)+
ylab("Pseudobulk Expr.")+
scale_fill_manual(values=c("#FFFFFF","#000000"))+
guides(col="none",fill="none")+
geom_point(size=0.35,position=position_jitterdodge(jitter.width = 0.15))+
theme(axis.text.x=element_text(size=7),axis.text.y=element_blank(),axis.title.y=element_text(size=7),axis.title.x=element_blank())
dev.off()
pdf("manuscript_plots/Fig4/xVMH_TAC1_pbulks.pdf",height=1,width=0.6)
ggplot(xpb[gene_name=="TAC1"&domain=="VMH"],aes(x=Sex,y=value,col=domain,fill=Sex))+
geom_boxplot(outliers = FALSE)+
scale_color_manual(values=pal)+
ylab("Pseudobulk Expr.")+
scale_fill_manual(values=c("#FFFFFF","#000000"))+
guides(col="none",fill="none")+
geom_point(size=0.35,position=position_jitterdodge(jitter.width = 0.15))+
theme(axis.text.x=element_text(size=7),axis.text.y=element_blank(),axis.title.y=element_text(size=7),axis.title.x=element_blank())
dev.off()
pdf("manuscript_plots/Fig4/vARC_RDH10_pbulks.pdf",height=1,width=0.6)
ggplot(vpb[gene_name=="RDH10"&domain=="ARC"],aes(x=Sex,y=value,col=domain,fill=Sex))+
geom_boxplot(outliers = FALSE)+
scale_color_manual(values=pal)+
ylab("Pseudobulk Expr.")+
scale_fill_manual(values=c("#FFFFFF","#000000"))+
guides(col="none",fill="none")+
geom_point(size=0.35,position=position_jitterdodge(jitter.width = 0.15))+
theme(axis.text.x=element_text(size=7),axis.text.y=element_blank(),axis.title.y=element_text(size=7),axis.title.x=element_blank())
dev.off()
pdf("manuscript_plots/Fig4/xARC_RDH10_pbulks.pdf",height=1,width=0.6)
ggplot(xpb[gene_name=="RDH10"&domain=="ARC"],aes(x=Sex,y=value,col=domain,fill=Sex))+
geom_boxplot(outliers = FALSE)+
scale_color_manual(values=pal)+
ylab("Pseudobulk Expr.")+
scale_fill_manual(values=c("#FFFFFF","#000000"))+
guides(col="none",fill="none")+
geom_point(size=0.35,position=position_jitterdodge(jitter.width = 0.15))+
theme(axis.text.x=element_text(size=7),axis.text.y=element_blank(),axis.title.y=element_text(size=7),axis.title.x=element_blank())
dev.off()
```
## previousyl, fGSEA results sex DE TF-target -- MOVED TO FIG 6
reprod info
```{r}
sessionInfo()
sessioninfo::session_info()
```
R version 4.4.1 RC (2024-06-06 r86719)
Platform: aarch64-apple-darwin20
Running under: macOS Sonoma 14.5
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.0
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
time zone: America/Chicago
tzcode source: internal
attached base packages:
[1] stats4 stats graphics grDevices utils methods base
other attached packages:
[1] BiocParallel_1.38.0 parallelly_1.38.0
[3] colorout_1.3-0.2 sf_1.0-16
[5] ggstance_0.3.7 Polychrome_1.5.1
[7] viridis_0.6.5 viridisLite_0.4.2
[9] escheR_1.4.0 spatialLIBD_1.16.2
[11] SpatialFeatureExperiment_1.6.1 SpatialExperiment_1.14.0
[13] SingleCellExperiment_1.26.0 SummarizedExperiment_1.34.0
[15] Biobase_2.64.0 GenomicRanges_1.56.1
[17] GenomeInfoDb_1.40.1 IRanges_2.38.1
[19] S4Vectors_0.42.1 BiocGenerics_0.50.0
[21] MatrixGenerics_1.16.0 matrixStats_1.3.0
[23] ggrastr_1.0.2 ggrepel_0.9.5
[25] ggtext_0.1.2 ggplot2_3.5.1
[27] data.table_1.15.4 rlang_1.1.4
loaded via a namespace (and not attached):
[1] bitops_1.0-7 EBImage_4.46.0 httr_1.4.7
[4] RColorBrewer_1.1-3 doParallel_1.0.17 tools_4.4.1
[7] utf8_1.2.4 R6_2.5.1 DT_0.33
[10] HDF5Array_1.32.0 lazyeval_0.2.2 rhdf5filters_1.16.0
[13] withr_3.0.0 sp_2.1-4 gridExtra_2.3
[16] cli_3.6.3 Cairo_1.6-2 labeling_0.4.3
[19] sass_0.4.9 proxy_0.4-27 Rsamtools_2.20.0
[22] commonmark_1.9.1 R.utils_2.12.3 scater_1.32.0
[25] sessioninfo_1.2.2 attempt_0.3.1 maps_3.4.2
[28] limma_3.60.3 rstudioapi_0.16.0 RSQLite_2.3.7
[31] generics_0.1.3 BiocIO_1.14.0 spdep_1.3-5
[34] dplyr_1.1.4 Matrix_1.7-0 ggbeeswarm_0.7.2
[37] fansi_1.0.6 abind_1.4-5 R.methodsS3_1.8.2
[40] terra_1.7-78 lifecycle_1.0.4 scatterplot3d_0.3-44
[43] yaml_2.3.9 edgeR_4.2.0 rhdf5_2.48.0
[46] SparseArray_1.4.8 BiocFileCache_2.12.0 paletteer_1.6.0
[49] grid_4.4.1 blob_1.2.4 promises_1.3.0
[52] dqrng_0.4.1 ExperimentHub_2.12.0 crayon_1.5.3
[55] lattice_0.22-6 beachmat_2.20.0 cowplot_1.1.3
[58] KEGGREST_1.44.1 magick_2.8.3 zeallot_0.1.0
[61] pillar_1.9.0 knitr_1.48 rjson_0.2.21
[64] boot_1.3-30 codetools_0.2-20 wk_0.9.2
[67] glue_1.7.0 vctrs_0.6.5 png_0.1-8
[70] spam_2.10-0 gtable_0.3.5 rematch2_2.1.2
[73] cachem_1.1.0 xfun_0.45 S4Arrays_1.4.1
[76] mime_0.12 DropletUtils_1.24.0 sfheaders_0.4.4
[79] iterators_1.0.14 units_0.8-5 fields_16.2
[82] statmod_1.5.0 bit64_4.0.5 filelock_1.0.3
[85] rprojroot_2.0.4 bslib_0.7.0 irlba_2.3.5.1
[88] vipor_0.4.7 KernSmooth_2.23-24 colorspace_2.1-0
[91] spData_2.3.1 DBI_1.2.3 tidyselect_1.2.1
[94] bit_4.0.5 compiler_4.4.1 curl_5.2.1
[97] BiocNeighbors_1.22.0 xml2_1.3.6 DelayedArray_0.30.1
[100] plotly_4.10.4 rtracklayer_1.64.0 scales_1.3.0
[103] classInt_0.4-10 rappdirs_0.3.3 tiff_0.1-12
[106] stringr_1.5.1 digest_0.6.36 fftwtools_0.9-11
[109] rmarkdown_2.27 benchmarkmeData_1.0.4 XVector_0.44.0
[112] htmltools_0.5.8.1 pkgconfig_2.0.3 jpeg_0.1-10
[115] sparseMatrixStats_1.16.0 dbplyr_2.5.0 fastmap_1.2.0
[118] htmlwidgets_1.6.4 UCSC.utils_1.0.0 shiny_1.8.1.1
[121] DelayedMatrixStats_1.26.0 farver_2.1.2 jquerylib_0.1.4
[124] jsonlite_1.8.8 config_0.3.2 R.oo_1.26.0
[127] BiocSingular_1.20.0 RCurl_1.98-1.14 magrittr_2.0.3
[130] scuttle_1.14.0 GenomeInfoDbData_1.2.12 s2_1.1.6
[133] dotCall64_1.1-1 Rhdf5lib_1.26.0 munsell_0.5.1
[136] Rcpp_1.0.13 stringi_1.8.4 zlibbioc_1.50.0
[139] AnnotationHub_3.12.0 parallel_4.4.1 deldir_2.0-4
[142] Biostrings_2.72.1 gridtext_0.1.5 locfit_1.5-9.10
[145] markdown_1.13 ScaledMatrix_1.12.0 BiocVersion_3.19.1
[148] XML_3.99-0.17 evaluate_0.24.0 golem_0.4.1
[151] BiocManager_1.30.23 foreach_1.5.2 httpuv_1.6.15
[154] tidyr_1.3.1 purrr_1.0.2 benchmarkme_1.0.8
[157] rsvd_1.0.5 xtable_1.8-4 restfulr_0.0.15
[160] e1071_1.7-14 later_1.3.2 class_7.3-22
[163] tibble_3.2.1 memoise_2.0.1 beeswarm_0.4.0
[166] AnnotationDbi_1.66.0 GenomicAlignments_1.40.0 shinyWidgets_0.8.6
[169] here_1.0.1
> sessioninfo::session_info()
─ Session info ──────────────────────────────────────────────────────────────────
setting value
version R version 4.4.1 RC (2024-06-06 r86719)
os macOS Sonoma 14.5
system aarch64, darwin20
ui RStudio
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz America/Chicago
date 2024-10-27
rstudio 2024.07.0-daily+219 Cranberry Hibiscus (desktop)
pandoc 3.1.11 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/aarch64/ (via rmarkdown)
─ Packages ──────────────────────────────────────────────────────────────────────
! package * version date (UTC) lib source
abind 1.4-5 2016-07-21 [1] CRAN (R 4.4.0)
AnnotationDbi 1.66.0 2024-05-01 [1] Bioconductor 3.19 (R 4.4.0)
AnnotationHub 3.12.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
attempt 0.3.1 2020-05-03 [1] CRAN (R 4.4.0)
beachmat 2.20.0 2024-05-06 [1] Bioconductor 3.19 (R 4.4.0)
beeswarm 0.4.0 2021-06-01 [1] CRAN (R 4.4.0)
benchmarkme 1.0.8 2022-06-12 [1] CRAN (R 4.4.0)
benchmarkmeData 1.0.4 2020-04-23 [1] CRAN (R 4.4.0)
Biobase * 2.64.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.1)
BiocFileCache 2.12.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
BiocGenerics * 0.50.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
BiocIO 1.14.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
BiocManager 1.30.23 2024-05-04 [1] CRAN (R 4.4.0)
BiocNeighbors 1.22.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
BiocParallel * 1.38.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
BiocSingular 1.20.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
BiocVersion 3.19.1 2024-04-22 [1] Bioconductor 3.19 (R 4.4.0)
Biostrings 2.72.1 2024-06-02 [1] Bioconductor 3.19 (R 4.4.0)
bit 4.0.5 2022-11-15 [1] CRAN (R 4.4.0)
bit64 4.0.5 2020-08-30 [1] CRAN (R 4.4.0)
bitops 1.0-7 2021-04-24 [1] CRAN (R 4.4.0)
blob 1.2.4 2023-03-17 [1] CRAN (R 4.4.0)
boot 1.3-30 2024-02-26 [1] CRAN (R 4.4.1)
bslib 0.7.0 2024-03-29 [1] CRAN (R 4.4.0)
cachem 1.1.0 2024-05-16 [1] CRAN (R 4.4.0)
Cairo 1.6-2 2023-11-28 [1] CRAN (R 4.4.0)
class 7.3-22 2023-05-03 [1] CRAN (R 4.4.1)
classInt 0.4-10 2023-09-05 [1] CRAN (R 4.4.0)
P cli 3.6.3 2024-06-21 [2] CRAN (R 4.4.0)
codetools 0.2-20 2024-03-31 [1] CRAN (R 4.4.1)
colorout * 1.3-0.2 2024-05-01 [1] Github (jalvesaq/colorout@c6113a2)
colorspace 2.1-0 2023-01-23 [1] CRAN (R 4.4.0)
commonmark 1.9.1 2024-01-30 [1] CRAN (R 4.4.0)
config 0.3.2 2023-08-30 [1] CRAN (R 4.4.0)
cowplot 1.1.3 2024-01-22 [1] CRAN (R 4.4.0)
crayon 1.5.3 2024-06-20 [1] CRAN (R 4.4.0)
curl 5.2.1 2024-03-01 [1] CRAN (R 4.4.0)
data.table * 1.15.4 2024-03-30 [2] CRAN (R 4.4.0)
DBI 1.2.3 2024-06-02 [1] CRAN (R 4.4.0)
dbplyr 2.5.0 2024-03-19 [1] CRAN (R 4.4.0)
DelayedArray 0.30.1 2024-05-07 [1] Bioconductor 3.19 (R 4.4.0)
DelayedMatrixStats 1.26.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
deldir 2.0-4 2024-02-28 [1] CRAN (R 4.4.0)
digest 0.6.36 2024-06-23 [1] CRAN (R 4.4.0)
doParallel 1.0.17 2022-02-07 [1] CRAN (R 4.4.1)
dotCall64 1.1-1 2023-11-28 [1] CRAN (R 4.4.0)
dplyr 1.1.4 2023-11-17 [1] CRAN (R 4.4.0)
dqrng 0.4.1 2024-05-28 [1] CRAN (R 4.4.0)
DropletUtils 1.24.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
DT 0.33 2024-04-04 [1] CRAN (R 4.4.0)
e1071 1.7-14 2023-12-06 [1] CRAN (R 4.4.0)
EBImage 4.46.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
edgeR 4.2.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
escheR * 1.4.0 2024-05-16 [1] Bioconductor 3.19 (R 4.4.0)
evaluate 0.24.0 2024-06-10 [1] CRAN (R 4.4.0)
ExperimentHub 2.12.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
fansi 1.0.6 2023-12-08 [1] CRAN (R 4.4.0)
farver 2.1.2 2024-05-13 [1] CRAN (R 4.4.0)
fastmap 1.2.0 2024-05-15 [1] CRAN (R 4.4.0)
fftwtools 0.9-11 2021-03-01 [1] CRAN (R 4.4.0)
fields 16.2 2024-06-27 [1] CRAN (R 4.4.0)
filelock 1.0.3 2023-12-11 [1] CRAN (R 4.4.0)
foreach 1.5.2 2022-02-02 [1] CRAN (R 4.4.0)
generics 0.1.3 2022-07-05 [1] CRAN (R 4.4.0)
GenomeInfoDb * 1.40.1 2024-05-24 [1] Bioconductor 3.19 (R 4.4.0)
GenomeInfoDbData 1.2.12 2024-05-01 [1] Bioconductor
GenomicAlignments 1.40.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
GenomicRanges * 1.56.1 2024-06-12 [1] Bioconductor 3.19 (R 4.4.1)
ggbeeswarm 0.7.2 2023-04-29 [1] CRAN (R 4.4.0)
ggplot2 * 3.5.1 2024-04-23 [1] CRAN (R 4.4.0)
ggrastr * 1.0.2 2023-06-01 [1] CRAN (R 4.4.0)
ggrepel * 0.9.5 2024-01-10 [1] CRAN (R 4.4.0)
ggstance * 0.3.7 2024-04-05 [1] CRAN (R 4.4.0)
ggtext * 0.1.2 2022-09-16 [1] CRAN (R 4.4.0)
glue 1.7.0 2024-01-09 [1] CRAN (R 4.4.0)
golem 0.4.1 2023-06-05 [1] CRAN (R 4.4.0)
gridExtra 2.3 2017-09-09 [1] CRAN (R 4.4.0)
gridtext 0.1.5 2022-09-16 [1] CRAN (R 4.4.0)
gtable 0.3.5 2024-04-22 [1] CRAN (R 4.4.0)
HDF5Array 1.32.0 2024-04-30 [1] Bioconductor 3.19 (R 4.4.0)
here 1.0.1 2020-12-13 [1] CRAN (R 4.4.0)
htmltools 0.5.8.1 2024-04-04 [1] CRAN (R 4.4.0)
htmlwidgets 1.6.4 2023-12-06 [1] CRAN (R 4.4.0)
httpuv 1.6.15 2024-03-26 [1] CRAN (R 4.4.0)
httr 1.4.7 2023-08-15 [1] CRAN (R 4.4.0)
IRanges * 2.38.1 2024-07-03 [1] Bioconductor 3.19 (R 4.4.1)
irlba 2.3.5.1 2022-10-03 [1] CRAN (R 4.4.0)
iterators 1.0.14 2022-02-05 [1] CRAN (R 4.4.0)
jpeg 0.1-10 2022-11-29 [1] CRAN (R 4.4.0)
jquerylib 0.1.4 2021-04-26 [1] CRAN (R 4.4.0)
jsonlite 1.8.8 2023-12-04 [1] CRAN (R 4.4.0)
KEGGREST 1.44.1 2024-06-19 [1] Bioconductor 3.19 (R 4.4.0)
KernSmooth 2.23-24 2024-05-17 [1] CRAN (R 4.4.1)
knitr 1.48 2024-07-07 [1] CRAN (R 4.4.1)
labeling 0.4.3 2023-08-29 [1] CRAN (R 4.4.0)
later 1.3.2 2023-12-06 [1] CRAN (R 4.4.0)
lattice 0.22-6 2024-03-20 [1] CRAN (R 4.4.1)
lazyeval 0.2.2 2019-03-15 [1] CRAN (R 4.4.0)
lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.4.0)
limma 3.60.3 2024-06-16 [1] Bioconductor 3.19 (R 4.4.0)
locfit 1.5-9.10 2024-06-24 [1] CRAN (R 4.4.0)