-
Notifications
You must be signed in to change notification settings - Fork 1
/
Figure5andS5.Rmd
144 lines (124 loc) · 5.58 KB
/
Figure5andS5.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
---
title: "Figure5"
author: "Mike"
---
#For plotting the heatmaps and running the analyses in Figure5 and FigureS5
First load up the required libraries and functions
```{r, echo=FALSE, results="hide"}
library(here)
library(dplyr)
library(NMF) # aheatmap()
library(nat)
library(elmr)
library(xlsx)
library(nat.templatebrains)
library(nat.flybrains)
download_jefferislab_registrations()
readin<-function(file) {
as.matrix(read.table(file, header=TRUE,row.names=1))
} #For reading in the text files containing LM overlap data
set3d <- function(pos = c("front", "left", "back", "right",
"ventral", "dorsal"), zoom = 0.7, ...) {
pos <- match.arg(pos)
m <- diag(c(1, -1, -1, 1)) # front
if (pos == "left") {
m <- diag(c(0, -1, 0, 1))
m[1, 3] <- 1
m[3, 1] <- 1
}
if (pos == "back") {
m <- diag(c(-1, -1, 1, 1))
}
if (pos == "right") {
m <- diag(c(0, -1, 0, 1))
m[1, 3] <- m[3, 1] <- -1
}
if (pos == "ventral") {
m <- diag(c(1, -1, -1, 1))
}
if (pos == "dorsal") {
m <- diag(c(1, 1, 1, 1))
}
4
view3d(userMatrix = m, zoom = zoom, ...)
}
here()
file.symlink("/Users/dolanm/Google Drive/SplitGAL4_Paper/Figures/Figure5", here())
file.symlink("/Users/dolanm/Google Drive/SplitGAL4_Paper/Figures/FigureS5", here())
```
Plot images of the PLP, GNG (part of SEZ) and the LAL (lateral accessory lobe/posterior antennal lobe), which are the main input dendritic zones for non-canonical LH input
```{r, echo=FALSE}
clear3d()
LHmask<-subset(FCWBNP.surf, "LH_L")
LHmask.jfrc2013<-xform_brain(x=LHmask, sample = FCWB, reference = JFRC2013)
npmask<-subset(FCWBNP.surf, "AVLP_L")
npmask.jfrc2013<-xform_brain(x=npmask, sample = FCWB, reference = JFRC2013)
plot3d(npmask.jfrc2013, alpha=0.2, col="green")
plot3d(LHmask.jfrc2013, alpha=0.2, col="red")
plot3d(JFRC2013, alpha=0.15)
set3d("front", 0.7, zoom = 0.8) #Function that sets the angle and zoom
snapshot3d("Figure5/AVLP.png")
```
Load up the LHON dendrite x PN axon overlap data and plot it for the supplementary figure S5.
```{r, echo=FALSE}
LHON_PN<-readin("FigureS5/Output_den_x_Mask_PN_PN.txt")
#To rename the LH cell-types
NAmaster<-read.xlsx(file="/Users/dolanm/Dropbox/JFRCvisitorProject/Neuroanatomy_Master.xlsx", sheetIndex = 1)
LHnewnames<-select(NAmaster,LHClusters., FinalNames)
oldnames<-lapply(X = dimnames(LHON_PN), FUN = gsub, pattern = "CellType_", replacement = "", fixed = TRUE)
oldname1<-data.frame(oldnames=oldnames[[1]]) #For the row names
oldname1<-merge(x=oldname1, by.x ="oldnames", y=LHnewnames, by.y = "LHClusters.", sort =FALSE)
newname1<-as.character(oldname1$FinalNames)
dimnames(LHON_PN)<-list(newname1, dimnames(LHON_PN)[[2]])
aheatmap(x = LHON_PN, filename=paste0("FigureS5/LHON_PN.pdf")
,fontsize = 9, cexRow = 1, cexCol = 2, Colv = FALSE, treeheight = 15, col="black")
```
LH gets other inputs in addition to the projection neurons. Load up the Input data, including taste and temperature PN data using lines identified in other studies.
```{r, echo=FALSE}
LHON_input<-t(readin("Figure5/Output_den_x_LHIN_axonmemb.txt"))
```
Next want to remove unwanted/unclear cell-types from the input designation and add modality tracts to the LHON_input heatmap.
```{r, echo=FALSE}
#celltype_remove<-c("145", "PN1", "PN2", )
#write.xlsx(x = dimnames(LHON_input)[[2]], file = "Figure5/LHON_Input_tracks.xlsx")
#subset(LHON_input, colnames(LHON_input)!="CellType_29A")
modality<-read.xlsx(file = "Figure5/LHON_Input_tracks.xlsx", sheetIndex = 1)
dimnames(LHON_input)<-list(newname1,modality$newname)
aheatmap(x = LHON_input, filename=paste0("Figure5/LHON_input.pdf")
, annCol = modality$Modality, col="black", annColors = "rainbow", annLegend = FALSE
,fontsize = 10, cexRow = 2, cexCol = 0.6, Colv = FALSE, treeheight = 8)
```
Combine all the LH input (PN, TPN, Visual, Taste etc) to identify LHONs that integrate olfactory and temperature data and two view the different clusters of inputs to the LH
```{r, echo=FALSE}
LHIN_all<-cbind(LHON_PN, LHON_LHIN)
aheatmap(x = LHIN_all, filename=paste0("Figure5/LHON_LHIN_PN.pdf")
,fontsize = 10, cexRow = 2, cexCol = 0.6, treeheight = 8)
```
For supplementary, plot heatmaps of the LHLN and PNs
```{r, echo=FALSE}
LHLNs_PNs<-readin(file = "FigureS5/Local_memb_x_Mask_PN_PN.txt")
#Calculate the LHLN new names
oldnames<-lapply(X = dimnames(LHLNs_PNs), FUN = gsub, pattern = "CellType_", replacement = "", fixed = TRUE)
oldname2<-data.frame(oldnames=oldnames[[1]]) #For the row names
oldname2<-merge(x=oldname2, by.x ="oldnames", y=LHnewnames, by.y = "LHClusters.", sort =FALSE)
newname2<-as.character(oldname2$FinalNames)
dimnames(LHLNs_PNs)[[1]]<-newname2
aheatmap(x = LHLNs_PNs, filename=paste0("FigureS5/LHLNs_PNs.pdf")
,fontsize = 9, cexRow =1.5, cexCol =5, col="black", treeheight = 8,
, cellwidth = 16,Colv = FALSE)
```
For the supplementary information, plot heatmaps of the MBON axons versus LHON dendrites
```{r, echo=FALSE}
LHONden_MBON<-readin(file = "FigureS5/Output_den_x_MBON_axon.txt")
dimnames(LHONden_MBON)<-list(newname1, gsub(dimnames(LHONden_MBON)[[2]], pattern = "CellType_", replacement = ""))
aheatmap(x = LHONden_MBON, filename=paste0("FigureS5/LHONden_MBON.pdf")
,fontsize = 10, cexRow = 3, cexCol = 0.65, col="black", treeheight = 12, Colv = FALSE)
```
For the supplementary information, plot heatmaps of the MBON axons versus LHLNs
```{r, echo=FALSE}
LHLN_MBON<-readin(file = "FigureS5/Local_memb_x_MBON_axon.txt")
aheatmap(x = LHLN_MBON, filename=paste0("Figure6/LHLN_MBON.pdf")
,fontsize = 10, cexRow = 0.8, cexCol = 0.65, treeheight = 12, Colv = FALSE)
```
```{r, echo=FALSE}
```