├── .gitignore ├── .travis.yml ├── DESCRIPTION ├── NAMESPACE ├── R └── functions.R ├── README.md ├── README_data.md ├── data ├── annot3D.rda ├── gannot3D.rda ├── mat.rda ├── structureID.rda └── vol3D.rda ├── man ├── annot3D.Rd ├── brainmapr.Rd ├── gannot3D.Rd ├── genePlot.Rd ├── genePlotWeightedComp.Rd ├── genePlotWeightedComp2.Rd ├── getChildren.Rd ├── getId.Rd ├── getIds.Rd ├── getName.Rd ├── getStructureIds.Rd ├── mat.Rd ├── plotEnergy.Rd ├── plotProjection.Rd ├── plotProjectionXray.Rd ├── plotSlice.Rd ├── plotSliceComp.Rd ├── plotSliceXray.Rd ├── structureID.Rd ├── structurePlot.Rd └── vol3D.Rd ├── sample ├── mouse_compiled.png ├── mouse_projection.png ├── mouse_slice_forebrain.png └── mouse_slice_gene_exp.png ├── tests └── tests.R └── vignettes ├── brainmapr-vignette.md ├── figures ├── brainmapr-gene1 plot-1.png ├── brainmapr-gene1 plot-2.png ├── brainmapr-gene1 structure plot-1.png ├── brainmapr-gene1 structure plot-2.png ├── brainmapr-gene2 plot-1.png ├── brainmapr-gene2 plot-2.png ├── brainmapr-gene2 structure plot-1.png ├── brainmapr-gene2 structure plot-2.png ├── brainmapr-group gene plot-1.png ├── brainmapr-group gene plot-2.png ├── brainmapr-group gene weighted plot-1.png ├── brainmapr-group gene weighted plot-2.png ├── brainmapr-structure plot-1.png ├── brainmapr-structure plot-2.png ├── brainmapr-whole mouse plot-1.png ├── brainmapr-whole mouse plot-2.png ├── pagoda-forebrain-1.png ├── pagoda-forebrain-2.png ├── pagoda-main split and comparison-1.png ├── pagoda-main split and comparison-2.png ├── pagoda-main split and comparison-3.png ├── pagoda-main split and comparison-4.png ├── pagoda-main split and comparison-5.png ├── pagoda-proximal distal placement-1.png ├── pagoda-proximal distal-1.png ├── pagoda-proximal distal-2.png ├── pagoda-proximal distal-3.png ├── pagoda-proximal distal-4.png ├── pagoda-whole mouse-1.png └── pagoda-whole mouse-2.png └── pagoda-vignette.md /.gitignore: -------------------------------------------------------------------------------- 1 | data-raw/ 2 | *~ 3 | R/*~ 4 | .DS_Store 5 | .Rbuildignore 6 | .Rhistory 7 | .Rproj.user 8 | .git 9 | .Rproj.user 10 | src/*.o 11 | src/*.so 12 | *.Rproj 13 | vignettes/*.Rmd 14 | *_bak 15 | .*_bak 16 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # Sample .travis.yml for R projects 2 | 3 | # Enable installation 4 | sudo: true 5 | 6 | # Use R 7 | language: r 8 | warnings_are_errors: true 9 | 10 | notifications: 11 | email: 12 | on_success: change 13 | on_failure: change 14 | 15 | before_install: 16 | - curl -OL http://raw.github.com/craigcitro/r-travis/master/scripts/travis-tool.sh 17 | - chmod 755 ./travis-tool.sh 18 | - ./travis-tool.sh bootstrap 19 | 20 | install: 21 | ## For installing all CRAN dependencies using DESCRIPTION 22 | - ./travis-tool.sh install_deps 23 | 24 | ## For installing all Bioconductor dependencies using DESCRIPTION 25 | - ./travis-tool.sh install_bioc_deps 26 | 27 | ## Install Github packages 28 | - ./travis-tool.sh install_github jimhester/covr 29 | 30 | env: 31 | global: 32 | - BIOC_USE_DEVEL="FALSE" ## Use the current release version 33 | - R_CHECK_ARGS="--no-build-vignettes --no-manual --timings" ## do not build vignettes or manual 34 | - _R_CHECK_TIMINGS_="0" ## get the timing information for the examples for all of your functions 35 | 36 | script: 37 | - travis_wait ./travis-tool.sh run_tests 38 | 39 | after_failure: 40 | - ./travis-tool.sh dump_logs 41 | 42 | ## Check how much time was spent in each of the example pages 43 | after_script: 44 | - ./travis-tool.sh dump_logs_by_extension "timings" 45 | - ./travis-tool.sh dump_sysinfo 46 | 47 | ## CodeCov 48 | after_success: 49 | - Rscript -e 'library(covr);codecov()' 50 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: brainmapr 2 | Type: Package 3 | Title: Visualizes ISH gene expression data from the Allen Brain Atlas 4 | Description: Spatial localization of neural progenitor cells within the developing mammalian brain plays an important role in neuronal fate determination and maturation. brainmapr infers spatial location of neural progenitor subpopulations within the developing mouse brain by integrating single-cell RNA-seq data with in situ RNA patterns from the Allen Developing Mouse Brain Atlas. 5 | Version: 0.9.1 6 | Date: 2015-03-16 7 | Author: Jean Fan [aut, cre] 8 | Authors@R: c( 9 | person("Jean", "Fan", role = c("aut", "cre"), 10 | email = "jeanfan@fas.harvard.edu") 11 | ) 12 | Maintainer: Jean Fan 13 | License: MIT 14 | LazyData: TRUE 15 | VignetteBuilder: knitr 16 | Suggests: 17 | knitr, 18 | rgl 19 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2 (4.1.0): do not edit by hand 2 | 3 | export(genePlot) 4 | export(genePlotWeightedComp) 5 | export(genePlotWeightedComp2) 6 | export(getChildren) 7 | export(getId) 8 | export(getIds) 9 | export(getName) 10 | export(getStructureIds) 11 | export(plotEnergy) 12 | export(plotProjection) 13 | export(plotProjectionXray) 14 | export(plotSlice) 15 | export(plotSliceComp) 16 | export(plotSliceXray) 17 | export(structurePlot) 18 | -------------------------------------------------------------------------------- /R/functions.R: -------------------------------------------------------------------------------- 1 | ##' brainmapr 2 | ##' 3 | ##' R package to infer spatial location of neuronal subpopulations within the developing mouse brain by integrating single-cell RNA-seq data with in situ RNA patterns from the Allen Developing Mouse Brain Atlas 4 | ##' More extensive tutorials are available at \url{https://github.com/JEFworks/brainmapr}. 5 | ##' 6 | ##' @name brainmapr 7 | ##' @docType package 8 | ##' @author Jean Fan \email{jeanfan@@fas.harvard.edu} 9 | NULL 10 | 11 | 12 | ##### 13 | # Sample datasets 14 | ##### 15 | 16 | ##' Pixel level 3D Structure annotations of the embryonic 11.5 day old mouse brain 17 | ##' @format 3D array 18 | ##' @docType data 19 | ##' @references \url{http://developingmouse.brain-map.org/} 20 | "annot3D" 21 | 22 | ##' Voxel level 3D Structure annotations of the embryonic 11.5 day old mouse brain 23 | ##' @format 3D array 24 | ##' @docType data 25 | ##' @references \url{http://developingmouse.brain-map.org/} 26 | "gannot3D" 27 | 28 | ##' Matrix of gene expression where each row corresponds to a gene and columns correspond to 3D locations in space 29 | ##' @format 2D array (matrix) 30 | ##' @docType data 31 | ##' @references \url{http://developingmouse.brain-map.org/} 32 | "mat" 33 | 34 | ##' Parsed StructureGraph for the developing mouse brain. Contains structure IDs and names in a hierarchical format. 35 | ##' @format 3D array 36 | ##' @docType data 37 | ##' @references \url{http://developingmouse.brain-map.org/} 38 | "structureID" 39 | 40 | ##' Pixel level 3D volume of the embryonic 11.5 day old mouse brain 41 | ##' @format 3D array 42 | ##' @docType data 43 | ##' @references \url{http://developingmouse.brain-map.org/} 44 | "vol3D" 45 | 46 | 47 | ##### 48 | ## ID and name parsing related functions 49 | ##### 50 | 51 | 52 | #' A recursive way to get IDs and names of structure given a name substring 53 | #' 54 | #' In the Allen Brain Atlas, a Structure represents a neuroanatomical region of interest. Structures are grouped into Ontologies and organized in a hierarchy or StructureGraph. The StructureGraph for the Developing Mouse Brain Atlas is provided here under data/structureID.rda. This function allows you to browse Structures by name and ID given a name substring. 55 | #' 56 | #' @param nestedList A JSON derived nested list of Structure relationships from Allen Brain Atlas's StructureGraph 57 | #' @param name Brain structure name substring 58 | #' 59 | #' @return ids A dictionary of Structures that contain the name with their IDs 60 | #' 61 | #' @examples 62 | #' data(structureID) 63 | #' getIds(structureID, 'pallium') 64 | #' 65 | #' @keywords browse, search 66 | #' 67 | #' @export 68 | getIds <- function(nestedList, name) { 69 | ids <- {} 70 | ## recursive component 71 | getIdsHelper <- function(nestedList, name) { 72 | for(x in nestedList) { 73 | ## check if structure name contains substring 74 | ## recur to go down nested children list 75 | if(length(x$children)>0) { 76 | if(grepl(name, x$name)) { ids[x$name] <<- x$id } 77 | else { getIdsHelper(x$children, name) } 78 | } 79 | else{ 80 | # last node 81 | if(grepl(name, x$name)) { ids[x$name] <<- x$id } 82 | else { } 83 | } 84 | } 85 | } 86 | getIdsHelper(nestedList, name) 87 | return(ids) 88 | } 89 | 90 | 91 | #' A recursive way to get the name of a Structure given its ID 92 | #' 93 | #' In the Allen Brain Atlas, a Structure represents a neuroanatomical region of interest. Structures are grouped into Ontologies and organized in a hierarchy or StructureGraph. The StructureGraph for the Developing Mouse Brain Atlas is provided here under data/structureID.rda. This function allows you to retrieve the name of a Structures given its ID. 94 | #' 95 | #' @param nestedList A JSON derived nested list of Structure relationships from Allen Brain Atlas's StructureGraph 96 | #' @param sid id The structure ID 97 | #' @return n Brain structure name 98 | #' 99 | #' @examples 100 | #' data(structureID) 101 | #' getName(structureID, 15903) 102 | #' 103 | #' @keywords browse, search 104 | #' 105 | #' @export 106 | getName <- function(nestedList, sid) { 107 | n <- "not found" 108 | getNameHelper <- function(nestedList, sid, n) { 109 | for(x in nestedList) { 110 | if(length(x$children)>0) { 111 | if(x$id==sid) { n <<- x$name } 112 | else { getNameHelper(x$children, sid, n) } 113 | } 114 | else{ 115 | ## last node 116 | if(x$id==sid) { n <<- x$name } 117 | } 118 | } 119 | } 120 | getNameHelper(nestedList, sid, n) 121 | return(n) 122 | } 123 | 124 | 125 | #' A recursive way to get structure IDs and names of structure given an exact name string. Used by \code{\link{getStructureIds}} 126 | #' 127 | #' @param nestedList A JSON derived nested list of Structure relationships from Allen Brain Atlas's structure graph 128 | #' @param name Structure's name 129 | #' 130 | #' @return cids Structure ID 131 | #' 132 | #' @examples 133 | #' data(structureID) 134 | #' getId(structureID, 'pallium') 135 | #' 136 | #' @keywords browse, search, helper 137 | #' 138 | #' @export 139 | getId <- function(nestedList, name) { 140 | cids <- "not found" 141 | getIdHelper <- function(nestedList, name, cids) { 142 | for(x in nestedList) { 143 | if(length(x$children)>0) { 144 | if(x$name==name) { cids <<- x$id } 145 | else { getIdHelper(x$children, name, cids) } 146 | } 147 | else{ 148 | ## last node 149 | if(x$name==name) { cids <<- x$id } 150 | } 151 | } 152 | } 153 | getIdHelper(nestedList, name, cids) 154 | return(cids) 155 | } 156 | 157 | #' A recursive way to get all the children of a Structure given its ID. Used by \code{\link{getStructureIds}} 158 | #' 159 | #' @param nestedList A JSON derived nested list of structure relationships from Allen Brain Atlas's structure graph 160 | #' @param sid The Structure's ID 161 | #' 162 | #' @return cids The Structure children's IDs 163 | #' 164 | #' @examples 165 | #' data(structureID) 166 | #' getChildren(structureID, 15903) 167 | #' 168 | #' @keywords browse, search, helper 169 | #' 170 | #' @export 171 | getChildren <- function(nestedList, sid) { 172 | cids <- c() 173 | getChildrenHelper <- function(nestedList, sid) { 174 | for(x in nestedList) { 175 | if(x$id==sid) { 176 | ## found, just get children's ids 177 | getChildrenIds(x$children) 178 | } 179 | else { getChildrenHelper(x$children, sid) } ## keep going 180 | } 181 | } 182 | getChildrenIds <- function(nestedList) { 183 | for(x in nestedList) { 184 | ## append children's ids to list 185 | cids <<- c(cids, x$id) 186 | getChildrenIds(x$children) 187 | } 188 | } 189 | getChildrenHelper(nestedList, sid) 190 | return(cids) 191 | } 192 | 193 | #' Get IDs associated with a Structure given the exact Structure name 194 | #' 195 | #' In the Allen Brain Atlas, a Structure represents a neuroanatomical region of interest. Structures are grouped into Ontologies and organized in a hierarchy or StructureGraph. With the exception of the "root" structure, each Structure has one parent and denotes a "part-of" relationship. Due to this relationship, a Structure's total volume is denoted by both its own IDs and also that of its children's IDs. The StructureGraph for the Developing Mouse Brain Atlas is provided here under data/structureID.rda. This function allows you to obtain all IDs associated with a Structure given its exact name. 196 | #' 197 | #' @param nestedList A JSON derived nested list of structure relationships from Allen Brain Atlas's StructureGraph 198 | #' @param name Structure's name 199 | #' 200 | #' @return cids The Structure's ID and all its children's IDs 201 | #' 202 | #' @examples 203 | #' data(structureID) 204 | #' getStructureIds(structureID, 'pallium') 205 | #' 206 | #' @keywords browse, search 207 | #' 208 | #' @export 209 | getStructureIds <- function(nestedList, name) { 210 | sid <- getId(nestedList, name) 211 | cids <- c(sid, getChildren(nestedList, sid)) 212 | return(cids) 213 | } 214 | 215 | 216 | ##### 217 | ## Plotting functions 218 | ##### 219 | 220 | 221 | #' Plot slice of 3D volume 222 | #' 223 | #' @param mat3D 3D volume 224 | #' @param slice Index of slice; limited to dimensions of mat3D 225 | #' @param col Color 226 | #' @param t Threshold used to remove noise 227 | #' @param add Boolean whether to overlay onto existing plot 228 | #' 229 | #' @examples 230 | #' data(vol3D) 231 | #' plotSlice(vol3D, 75, t=8) 232 | #' 233 | #' @keywords plot 234 | #' 235 | #' @export 236 | plotSlice <- function(mat3D, slice, col=colorRampPalette(c("white","black","red","yellow"),space="Lab")(100), t=0, add=F) { 237 | matT <- mat3D[,,slice] 238 | image(matT, col=col, zlim=c(t, max(matT, na.rm=T)), asp=1, add=add) # fix aspect ratio 239 | } 240 | 241 | #' \code{\link{plotSlice}} with colors set to look more like an x-ray 242 | #' 243 | #' @param mat3D 3D volume 244 | #' @param slice Index of slice; limited to dimensions of mat3D 245 | #' @param t Threshold used to remove noise 246 | #' @param add Boolean whether to overlay onto existing plot 247 | #' 248 | #' @examples 249 | #' data(vol3D) 250 | #' plotSliceXray(vol3D, 75, t=8) 251 | #' 252 | #' @keywords plot, modification 253 | #' 254 | #' @export 255 | plotSliceXray <- function(mat3D, slice, t=0, add=F) { 256 | plotSlice(mat3D, slice, col=colorRampPalette(c("white", "black"),space="Lab")(100), t=t, add=add) 257 | } 258 | 259 | #' Plot slice of 3D volume without thresholding and allowing for negative expression values. Used for comparing spatial expression of upregulated vs. downregulated gene sets. 260 | #' 261 | #' @param mat3D 3D volume 262 | #' @param slice Index of slice; limited to dimensions of mat3D 263 | #' @param col Color 264 | #' @param add Boolean whether to overlay onto existing plot 265 | #' 266 | #' @examples 267 | #' data(vol3D) 268 | #' plotSliceComp(vol3D, 75) 269 | #' 270 | #' @keywords plot 271 | #' 272 | #' @export 273 | plotSliceComp <- function(mat3D, slice, col=colorRampPalette(c("green","blue", "black","red","yellow"),space="Lab")(100), add=F) { 274 | matT <- mat3D[,,slice] 275 | image(matT, col=col, zlim=c(min(matT, na.rm=T), max(matT, na.rm=T)), asp=1, add=add) # fix aspect ratio 276 | } 277 | 278 | 279 | #' Plot flat projection of a 3D volume 280 | #' 281 | #' @param mat3D 3D volume 282 | #' @param col Color 283 | #' @param t Threshold used to remove noise 284 | #' @param add Boolean whether to overlay onto existing plot 285 | #' 286 | #' @examples 287 | #' data(vol3D) 288 | #' plotProjection(vol3D, t=8) 289 | #' 290 | #' @keywords plot 291 | #' 292 | #' @export 293 | plotProjection <- function(mat3D, col=colorRampPalette(c("white","black","red","yellow"),space="Lab")(100), t=0, add=F) { 294 | # threshold to get rid of noise 295 | mat3D[mat3D <= t] <- 0 296 | projmat <- apply(mat3D, 2, rowSums, na.rm=T) 297 | image(projmat, col=col, zlim=c(t, max(projmat, na.rm=T)), asp=1, add=add) 298 | } 299 | 300 | #' \code{\link{plotProjection}} with colors set to look more like an x-ray 301 | #' 302 | #' @param mat3D 3D volume 303 | #' @param t Threshold used to remove noise 304 | #' @param add Boolean whether to overlay onto existing plot 305 | #' 306 | #' @keywords plot, modification 307 | #' 308 | #' @export 309 | plotProjectionXray <- function(mat3D, t=0, add=F) { 310 | plotProjection(mat3D, col=colorRampPalette(c("white", "black"),space="Lab")(100), t=t, add=add) 311 | } 312 | 313 | 314 | #' Helper function for 3D plotting. Used by \code{\link{structurePlot}} and \code{\link{genePlot}} 315 | #' 316 | #' @param exp vector representation of volume 317 | #' @param x x-dimension of volume 318 | #' @param y y-dimension of volume 319 | #' @param z z-dimension of volume 320 | #' 321 | #' @keywords plot, helper 322 | #' 323 | #' @export 324 | plotEnergy <- function(exp, x, y, z) { 325 | eyv <- as.data.frame(as.table(exp)) 326 | col <- colorRampPalette(c("white","black","red","yellow"),space="Lab")(100) 327 | # normalize 328 | vi <- eyv[,4]>0; 329 | pc <- col[pmax(1,round(eyv[,4]/max(eyv[,4])*length(col)))] 330 | # 3D plot 331 | rgl::plot3d( 332 | as.integer(eyv[vi,1]), 333 | as.integer(eyv[vi,2]), 334 | as.integer(eyv[vi,3]), 335 | col=pc[vi], 336 | alpha=eyv[vi,4]/max(eyv[vi,4]), 337 | xlim=c(0,x), 338 | ylim=c(0,y), 339 | zlim=c(0,z) 340 | ) 341 | } 342 | 343 | #' Plot the volume or expression within a Structure 344 | #' 345 | #' @param cids Structure ids 346 | #' @param vol 3D volume of expression values 347 | #' @param annot 3D annotation of volume with structure IDs 348 | #' @param plot Boolean of whether to make 3D plot 349 | #' 350 | #' @return tvol 3D volume restricted to just structure of interest 351 | #' 352 | #' @examples 353 | #' data(structureID) 354 | #' data(vol3D) 355 | #' data(annot3D) 356 | #' cids <- getStructureIds(structureID, 'pallium') 357 | #' sect3D <- structurePlot(cids, vol3D, annot3D) # For whole structure 358 | #' gpsect3D <- structurePlot(cids, array(mat['Dcx',], dim=dim(gannot3D)), gannot3D) # For a particular gene 359 | #' 360 | #' @keywords plot 361 | #' 362 | #' @export 363 | structurePlot <- function(cids, vol, annot, plot=F) { 364 | ## remove structures not in cids 365 | vol[!(annot %in% cids)] <- NA 366 | if(plot) { 367 | plotEnergy(vol, dim(annot)[1], dim(annot)[2], dim(annot)[3]) 368 | } 369 | return(vol) 370 | } 371 | 372 | #' Plot total expression of a set of genes 373 | #' 374 | #' @param gl Gene list 375 | #' @param expmat 3D volume of expression 376 | #' @param gannot 3D annotation of volume with structure IDs 377 | #' @param t Threshold for removing noise; gene energy levels below this threshold will be removed 378 | #' @param weights List of relative weights corresponding to gene list; default: weighted equally 379 | #' @param plot Boolean of whether to make 3D plot 380 | #' 381 | #' @return exp3D 3D volume restricted to weighted gene expression set of interest 382 | #' 383 | #' @examples 384 | #' data(mat) 385 | #' data(gannot3D) 386 | #' gp3D <- genePlot('Dcx', mat, gannot3D) 387 | #' 388 | #' @keywords plot 389 | #' 390 | #' @export 391 | genePlot <- function(gl, expmat, gannot, t=0, weights=rep(1, length(gl)), plot=F) { 392 | 393 | # see what genes we have ISH data available 394 | glHave <- gl[gl %in% rownames(expmat)] 395 | glNothave <- gl[!(gl %in% rownames(expmat))] 396 | weightsHave <- weights[gl %in% rownames(expmat)] 397 | if(length(glHave)==0) { 398 | print('No genes available') 399 | return(NA) 400 | } else { 401 | print('Genes available:') 402 | print(glHave) 403 | print('Genes not available:') 404 | print(glNothave) 405 | } 406 | 407 | # restrict to what we have 408 | exp <- expmat[glHave,] 409 | # threshold to get rid of noise 410 | exp[exp < t] <- 0 411 | exp <- exp * weightsHave 412 | if(length(glHave) > 1) { 413 | expInt <- colSums(exp, na.rm=T) 414 | #expInt <- colMeans(exp, na.rm=T) 415 | } else { 416 | expInt <- exp 417 | } 418 | 419 | exp3D <- array(expInt, dim=dim(gannot)) 420 | if(plot) { 421 | plotEnergy(exp3D, dim(gannot)[1], dim(gannot)[2], dim(gannot)[3]) 422 | } 423 | return(exp3D) 424 | } 425 | 426 | 427 | ##### 428 | ## Comparison functions 429 | ##### 430 | 431 | #' Relative expression of two groups using absolute differences 432 | #' 433 | #' @param gl1 List of differentially expressed genes upregulated in cell group 1 434 | #' @param weights1 List of weights corresponding to genes in \code{gl1} 435 | #' @param gl2 List of differentially expressed genes upregulated in cell group 2 436 | #' @param weights2 List of weights corresponding to genes in \code{gl2} 437 | #' @param expmat 3D volume of expression 438 | #' @param gannot 3D annotation of volume with structure IDs 439 | #' @param plot Boolean of whether to make 3D plot 440 | #' 441 | #' @return exp3D 3D volume of weighted expression for gene lists of interest 442 | #' 443 | #' @keywords comparison, placement 444 | #' 445 | #' @export 446 | genePlotWeightedComp <- function(gl1, weights1, gl2, weights2, expmat, gannot, plot=F) { 447 | gl <- c(gl1, gl2) 448 | weights <- c(weights1, -weights2) 449 | 450 | glHave <- gl[gl %in% rownames(expmat)] 451 | weightsHave <- weights[gl %in% rownames(expmat)] 452 | print(glHave) 453 | print(weightsHave) 454 | if(length(glHave)==0) { 455 | print('No genes available') 456 | return(NA) 457 | } 458 | 459 | exp <- expmat[glHave,] 460 | # row normalize in case one gene just has higher detection due to better probes 461 | #exp <- t(t(exp) / rowMeans(exp)) 462 | exp <- exp * weightsHave 463 | if(length(glHave) > 1) { 464 | #expInt <- colSums(exp, na.rm=T) 465 | expInt <- colMeans(exp, na.rm=T) 466 | } else { 467 | expInt <- exp 468 | } 469 | 470 | exp3D <- array(expInt, dim=dim(gannot)) 471 | if(plot) { 472 | plotEnergy(exp3D, dim(gannot)[1], dim(gannot)[2], dim(gannot)[3]) 473 | } 474 | return(exp3D) 475 | } 476 | 477 | #' Relative expression of two groups using ratios 478 | #' 479 | #' @param gl1 List of differentially expressed genes upregulated in cell group 1 480 | #' @param weights1 List of weights corresponding to genes in \code{gl1} 481 | #' @param gl2 List of differentially expressed genes upregulated in cell group 2 482 | #' @param weights2 List of weights corresponding to genes in \code{gl2} 483 | #' @param expmat 3D volume of expression 484 | #' @param gannot 3D annotation of volume with structure IDs 485 | #' @param plot Boolean of whether to make 3D plot 486 | #' 487 | #' @return exp3D 3D volume of weighted expression for gene lists of interest 488 | #' 489 | #' @keywords comparison, placement 490 | #' 491 | #' @export 492 | genePlotWeightedComp2 <- function(gl1, weights1, gl2, weights2, expmat, gannot, plot=F) { 493 | 494 | gl1Have <- gl1[gl1 %in% rownames(expmat)] 495 | weights1Have <- weights1[gl1 %in% rownames(expmat)] 496 | exp1 <- expmat[gl1Have,] 497 | exp1 <- exp1 * weights1Have 498 | exp1[exp1 < 0] = 0 499 | 500 | if(length(gl1Have) > 1) { 501 | exp1Int <- colMeans(exp1, na.rm=T) 502 | } else { 503 | exp1Int <- exp1 504 | } 505 | #exp1Int <- exp1Int/(max(exp1Int, na.rm=T)+1e-10) # normalize to be comparable 506 | 507 | gl2Have <- gl2[gl2 %in% rownames(expmat)] 508 | weights2Have <- weights2[gl2 %in% rownames(expmat)] 509 | exp2 <- expmat[gl2Have,] 510 | exp2 <- exp2 * weights2Have 511 | exp2[exp2 < 0] = 0 512 | 513 | if(length(gl2Have) > 1) { 514 | exp2Int <- colMeans(exp2, na.rm=T) 515 | } else { 516 | exp2Int <- exp2 517 | } 518 | #exp2Int <- exp2Int/(max(exp2Int, na.rm=T)+1e-10) # normalize to be comparable 519 | 520 | # fold change 521 | exp1Fold <- log(exp1Int/exp2Int) 522 | exp2Fold <- log(exp2Int/exp1Int) 523 | 524 | #range01 <- function(x) { 525 | # (x - quantile(x, 025, na.rm=T))/(quantile(x, 075, na.rm=T) - quantile(x, 025, na.rm=T)) 526 | #} 527 | #exp1Fold <- range01(exp1Fold) 528 | #exp2Fold <- range01(exp2Fold) 529 | 530 | # cube root to emphasize values more near 0 531 | expInt <- exp1Fold - exp2Fold 532 | 533 | exp3D <- array(expInt, dim=dim(gannot)) 534 | if(plot) { 535 | plotEnergy(exp3D, dim(gannot)[1], dim(gannot)[2], dim(gannot)[3]) 536 | } 537 | return(exp3D) 538 | } 539 | 540 | 541 | 542 | ##### 543 | ## DEVELOPMENT ZONE 544 | ##### 545 | 546 | # Helper function to estimate the contrast of an image as a the standard error 547 | getContrast <- function(mat3D, t=1) { 548 | mat3DT <- mat3D 549 | ## threshold to get rid of noise 550 | mat3DT[mat3D <= t] <- 0 551 | projmat <- apply(mat3DT, 2, rowSums) 552 | projmat[projmat <= 0] <- NA 553 | #mean(projmat, na.rm=T) 554 | sd(projmat, na.rm=T)/sqrt(sum(!is.na(projmat))) 555 | } 556 | 557 | # Helper function to simulate non-parametric background distribution by permutation 558 | getContrastBackground <- function(mat, gannot, cids, t=1, n=100, size=5, plot=T) { 559 | set.seed(0) 560 | d <- sapply(seq(along=1:n), function(i) { 561 | print(i) 562 | gl <- sample(rownames(mat), size) 563 | gp <- genePlot(gl, mat, gannot, plot=F) 564 | if (sum(is.na(cids)) == 0) { 565 | gpsect <- structurePlot(cids, gp, gannot, plot=F) 566 | } 567 | else { 568 | gpsect <- gp 569 | } 570 | getContrast(gpsect, t=t) 571 | }) 572 | if (plot == T) { 573 | hist(d) 574 | } 575 | d 576 | } 577 | 578 | # Get permutation p-value 579 | getContrastSig <- function(gl, mat, gannot, cids=NA, t=1, n=100, plot=F) { 580 | # Get score for gene list 581 | size <- sum(gl %in% rownames(mat)) 582 | gp <- genePlot(gl, mat, gannot, plot=F) 583 | if (sum(is.na(cids)) == 0) { 584 | gpsect <- structurePlot(cids, gp, gannot, plot=F) 585 | } else { 586 | gpsect <- gp 587 | } 588 | glContrast <- getContrast(gpsect, t=t) 589 | print(glContrast) 590 | 591 | # Simulate background 592 | d <- getContrastBackground(mat, gannot, cids, t, n, size, plot) 593 | # Count number of observations at least as extreme 594 | b <- sum(d >= glContrast) 595 | # Add 1 to both numerator and denominator to protect against p-value = 0 596 | # Based off of recommendations from: 597 | # Statistical Applications in Genetics and Molecular Biology 9 (2010), No. 1, Article 39 598 | (b+1)/(n+1) 599 | } 600 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #brainmapr 2 | 3 | [![Build Status](https://travis-ci.org/hms-dbmi/brainmapr.svg?branch=master)](https://travis-ci.org/hms-dbmi/brainmapr) [![codecov.io](http://codecov.io/github/hms-dbmi/brainmapr/coverage.svg?branch=master)](http://codecov.io/github/hms-dbmi/brainmapr?branch=master) 4 | 5 | Spatial localization of neural progenitor cells within the developing mammalian brain plays an important role in neuronal fate determination and maturation. We developed `brainmapr` to the infer spatial location of neural progenitor subpopulations within the developing mouse brain by integrating single-cell RNA-seq data with in situ RNA patterns from the [Allen Developing Mouse Brain Atlas](http://mouse.brain-map.org/). Putative neural progenitor subpopulations are first identified using single-cell RNA-seq data. [Single cell differential expression](http://pklab.med.harvard.edu/scde/index.html) analysis identifies gene expression signatures associated with each subpopulation. In situ expression patterns for these genes then spatially localize each subpopulation to demonstrate spatial segregation of subpopulations. 6 | 7 | The `brainmapr` package comes pre-loaded with a small sample of ISH data for 38 genes in the embryonic 11.5 day old mouse. Additional ISH data for ~2000 genes in convenient RData formats are available for the embryonic 11.5, 13.5, 15.5, 16.5, and 18.5, and post-natal 4, 14, 28, and 56 day old mice and can be downloaded from the [Kharchenko lab website](http://pklab.med.harvard.edu/jean/brainmapr/data-raw/) due to file size limitations on GitHub. By providing these data formats, we hope to enable investigators to explore trends in spatial correlation of gene expression or perform other statistical analyses from within the R statistical framework. 8 | 9 | ISH data are quantified as gene expression energies, defined expression intensity times expression density, at a grid voxel level. Each voxel corresponds to 100 µm gridding of the original ISH stain images and corresponds to voxel level structure annotations according to the accompanying developmental reference atlas ontology. The 3-D reference model for the developing 13.5 day embryonic mouse derived from Feulgen-HP yellow DNA staining is also used as a higher resolution reference image. Please refer to the [Allen Developing Mouse Brain Atlas Documentation](http://help.brain-map.org/display/mousebrain/Documentation) for more information on processes and procedures used to perform ISH, informatics data processing, structure annotation, and more. 10 | 11 | --- 12 | 13 | ## Sample Images 14 | 15 | ![](sample/mouse_compiled.png) 16 | Sample images generated using `brainmapr`. a) Projection of an embryonic 13.5 day old mouse; b) Forebrain highlighted structure in a slice of an embryonic 13.5 day old mouse; c) Gene expression signature for a proximal distal group of neurons within the forebrain of an embryonic 13.5 day old mouse 17 | 18 | --- 19 | 20 | ## Usage 21 | 22 | Please see the following vignettes for usage examples: 23 | - [Getting Started with brainmapr](vignettes/brainmapr-vignette.md) 24 | - [Practical applications of brainmapr](vignettes/pagoda-vignette.md) 25 | 26 | --- 27 | 28 | ## Install 29 | ``` 30 | require(devtools) 31 | devtools::install_github("hms-dbmi/brainmapr") 32 | ``` 33 | 34 | --- 35 | 36 | ## Citation 37 | 38 | ### Allen Developing Mouse Brain Atlas 39 | 40 | Website: ©2013 Allen Institute for Brain Science. Allen Developing Mouse Brain Atlas [Internet]. Available from: http://developingmouse.brain-map.org. 41 | 42 | ### brainmapr 43 | 44 | "Characterizing transcriptional heterogeneity through pathway and gene set overdispersion analysis" (Fan J, Salathia N, Liu R, Kaeser G, Yung Y, Herman J, Kaper F, Fan JB, Zhang K, Chun J, and Kharchenko PV) COMING SOON! 45 | 46 | --- 47 | 48 | ## Other similar methods: 49 | - [Achim K, Pettit JB, Saraiva LR, et al. High-throughput spatial mapping of single-cell RNA-seq data to tissue of origin. Nat Biotechnol. 2015;33(5):503-9.](http://www.ncbi.nlm.nih.gov/pubmed/25867922) 50 | - [Satija R, Farrell JA, Gennert D, Schier AF, Regev A. Spatial reconstruction of single-cell gene expression data. Nat Biotechnol. 2015;33(5):495-502.](http://www.ncbi.nlm.nih.gov/pubmed/25867923) 51 | 52 | --- 53 | 54 | ## Contributing 55 | 56 | We welcome any bug reports, enhancement requests, and other contributions. To submit a bug report or enhancement request, please use the [`brainmapr` GitHub issues tracker](https://github.com/hms-dbmi/brainmapr/issues). For more substantial contributions, please fork this repo, push your changes to your fork, and submit a pull request with a good commit message. 57 | 58 | 59 | -------------------------------------------------------------------------------- /README_data.md: -------------------------------------------------------------------------------- 1 | # Available Package Data 2 | 3 | Full datasets are too big to include in the package. A small expressed set from embryonic 11.5 day mice (E11.5) has been provided as an example. Full datasets can be downloaded from the [Kharchenko lab website](http://pklab.med.harvard.edu/jean/brainmapr/data-raw/) due to file size limitations on GitHub. 4 | 5 | ## Generating sample data 6 | 7 | ``` 8 | load("data-raw/Rdata/E11.5.annot.RData") 9 | load("data-raw/Rdata/E11.5.energy.RData") 10 | load("data-raw/Rdata/sids.RData") 11 | 12 | gl <- c("Dcx", "Sox11", "Cited2", "Plxna2", "Neurod6", "Tubb3", "Slc17a6", "Sstr2", "Cxcl12", "Hes6", "Eomes", "Neurog2", "Insm1", "Lrp8", "Mgat5b", "Lrrn3", "Nrn1", "Myt1", "Neurod1", "Sox9", "Fstl1", "Ednrb", "Arx", "Sfrp2", "Mfge8", "Ttyh1", "Dab1", "Fstl1", "Notch2", "Slc1a3", "Sox3", "Sox21", "Ttyh1", "Gli3", "Fgfr3", "Ttyh1", "Notch3", "Igfbp5") 13 | mat <- mat[gl,] 14 | 15 | devtools::use_data(structureID, mat, annot3D, gannot3D, vol3D) 16 | ``` 17 | 18 | --- 19 | 20 | # Processed Data 21 | 22 | Processed data are available for all developing mouse stages under `data-raw/RData/`: 23 | - `E11.5.*.RData` - data for embryonic 11.5 day old mouse 24 | - `E13.5.*.RData` - data for embryonic 13.5 day old mouse 25 | - `E15.5.*.RData` - data for embryonic 15.5 day old mouse 26 | - `E18.5.*.RData` - data for embryonic 18.5 day old mouse 27 | - `P4.*.RData` - data for post-natal 4 day old mouse 28 | - `P14.*.RData` - data for post-natal 14 day old mouse 29 | - `P28.*.RData` - data for post-natal 28 day old mouse 30 | - `P56.*.RData` - data for post-natal 56 day old mouse 31 | 32 | Each `RData` file contains: 33 | - `annot3D` - 3D array containing structure annotations for each pixel 34 | - `vol3D` - 3D array containing stain per pixel for whole mouse 35 | - `gannot3D` - 3D array containg structure annotations for each voxel 36 | - `mat` - matrix where each row corresponds to the average energy per voxel for a gene 37 | 38 | `sids.RData` contains: 39 | - `structure.id` - nested list of structure names to IDs; same for every developing mouse stage 40 | 41 | See `data-raw/scripts/to_RData.R` for more information. 42 | 43 | --- 44 | 45 | # Raw Data 46 | 47 | Raw data are too big to included in the package. The following steps were used to download and process data stored in `data-raw/`. Raw data folders have been zipped to save space. All raw data are publicly available for download through [the Allen Brain Atlas website](http://www.brain-map.org/). 48 | 49 | ## Source 50 | 51 | This directory is comprised of developing mouse brain ISH data from [the Allen Brain Atlas](http://developingmouse.brain-map.org/). For more information, please consult the [Allen Developing Mouse Brain Atlas technical white apper](http://help.brain-map.org/download/attachments/4325389/DevMouse_Overview.pdf). 52 | 53 | ## Date 54 | 55 | This data was downloaded in March 2014. 56 | 57 | ## Additional resources 58 | 59 | [Interactive Atlas Viewer](http://atlas.brain-map.org/atlas#atlas=1) - Useful for figuring out what are the comparable regions at different development time points 60 | 61 | [Gene Search](http://developingmouse.brain-map.org/search/index) - Useful for searching for gene names to see if they have expression data for that gene 62 | 63 | ## Downloading Gene Expression Data 64 | 65 | [Official Tutorial](http://help.brain-map.org/display/api/Downloading+3-D+Expression+Grid+Data) 66 | 67 | ### Step 1 68 | Get all gene IDs for all genes by age group. Remove num_row limit by using some really large number. 69 | 70 | ex. Embryonic 11.5 days mouse data. Must be non-failed in-situ hybridization experiment. Show gene name and other info just for sanity check: 71 | ``` 72 | http://api.brain-map.org/api/v2/data/query.xml?criteria=model::SectionDataSet,rma::criteria,[failed$eq%27false%27],products[abbreviation$eq%27DevMouse%27],treatments[name$eq'ISH'],specimen(donor(age[name$eq'E11.5'])),rma::include,genes,specimen(donor(age))&num_rows=5000000000 73 | ``` 74 | Results are saved as XML files under `data-raw/xmlQuery/*.xml` 75 | 76 | ### Step 2 77 | Parse for gene IDs from XML. See get_data.sh for more info. Results are saved under `data-raw/xmlQuery/ids/*` 78 | 79 | ### Step 3 80 | Getting the gene expression for each gene requires using the Allen Brain Atlas api. For example, for gene ID 100072942: 81 | ``` 82 | http://api.brain-map.org/grid_data/download/100072942?include=energy,intensity,density 83 | ``` 84 | 85 | Accessing the URL returns a zipped file. Unzip to get: 86 | - `energy.raw` - A raw uncompressed float (32-bit) little-endian volume representing average expression energy per voxel. A value of "-1" represents no data. This file is returned by default if the volumes parameter is null. 87 | - `density.raw` - A raw uncompressed float (32-bit) little-endian volume representing average expression density per voxel. A value of "-1" represents no data. 88 | - `injection.raw` - A raw uncompressed float (32-bit) little-endian volume representing the proportion of pixels within each voxel that were within the manually annotated injection site. 89 | - and corresponding mhd files with grid size information 90 | 91 | Use `wget` to get gene expression file for each gene ID. Results are stored under `data-raw/geneExpression/` 92 | 93 | ### Downloading Annotations 94 | 95 | [Official Tutorial](http://help.brain-map.org/display/devmouse/API#API-Expression3DGrids) 96 | 97 | - `atlasVolume`: uchar (8bit) grayscale Nissl or Feulgen-HP yellow volume of the reconstructed brain. 98 | - `annotation`: uint (32bit) structural annotation volume matching the atlasVolume. The value represents the ID of the finest level structure annotated for the voxel. Note: the 3-D mask for any structure is composed of all voxels annotated for that structure and all of its descendents in the structure hierarchy. 99 | - `gridAnnotation`: uint (32bit) structural annotation volume at grid resolution. 100 | 101 | Download directly from site or use `wget`. See `data-raw/csvQuery/*.csv` for more details. 102 | 103 | Results are stored under `data-raw/atlasVolume/`, `data-raw/atlasAnnotation/`, and `data-raw/gridAnnotation/` respectively. 104 | 105 | ### Structure IDs 106 | 107 | Grid annotation values refer to structure IDs. Get structure IDs from [the Atlas Ontologies](http://help.brain-map.org/display/api/Atlas+Drawings+and+Ontologies) 108 | ``` 109 | wget http://api.brain-map.org/api/v2/structure_graph_download/17.json 110 | ``` 111 | 112 | Results are stored under `data-raw/structureGraph/` 113 | 114 | -------------------------------------------------------------------------------- /data/annot3D.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/data/annot3D.rda -------------------------------------------------------------------------------- /data/gannot3D.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/data/gannot3D.rda -------------------------------------------------------------------------------- /data/mat.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/data/mat.rda -------------------------------------------------------------------------------- /data/structureID.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/data/structureID.rda -------------------------------------------------------------------------------- /data/vol3D.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/data/vol3D.rda -------------------------------------------------------------------------------- /man/annot3D.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2 (4.1.0): do not edit by hand 2 | % Please edit documentation in R/functions.R 3 | \docType{data} 4 | \name{annot3D} 5 | \alias{annot3D} 6 | \title{Pixel level 3D Structure annotations of the embryonic 11.5 day old mouse brain} 7 | \format{3D array} 8 | \usage{ 9 | annot3D 10 | } 11 | \description{ 12 | Pixel level 3D Structure annotations of the embryonic 11.5 day old mouse brain 13 | } 14 | \references{ 15 | \url{http://developingmouse.brain-map.org/} 16 | } 17 | \keyword{datasets} 18 | 19 | -------------------------------------------------------------------------------- /man/brainmapr.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2 (4.1.0): do not edit by hand 2 | % Please edit documentation in R/functions.R 3 | \docType{package} 4 | \name{brainmapr} 5 | \alias{brainmapr} 6 | \alias{brainmapr-package} 7 | \title{brainmapr} 8 | \description{ 9 | R package to infer spatial location of neuronal subpopulations within the developing mouse brain by integrating single-cell RNA-seq data with in situ RNA patterns from the Allen Developing Mouse Brain Atlas 10 | More extensive tutorials are available at \url{https://github.com/JEFworks/brainmapr}. 11 | } 12 | \author{ 13 | Jean Fan \email{jeanfan@fas.harvard.edu} 14 | } 15 | 16 | -------------------------------------------------------------------------------- /man/gannot3D.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2 (4.1.0): do not edit by hand 2 | % Please edit documentation in R/functions.R 3 | \docType{data} 4 | \name{gannot3D} 5 | \alias{gannot3D} 6 | \title{Voxel level 3D Structure annotations of the embryonic 11.5 day old mouse brain} 7 | \format{3D array} 8 | \usage{ 9 | gannot3D 10 | } 11 | \description{ 12 | Voxel level 3D Structure annotations of the embryonic 11.5 day old mouse brain 13 | } 14 | \references{ 15 | \url{http://developingmouse.brain-map.org/} 16 | } 17 | \keyword{datasets} 18 | 19 | -------------------------------------------------------------------------------- /man/genePlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2 (4.1.0): do not edit by hand 2 | % Please edit documentation in R/functions.R 3 | \name{genePlot} 4 | \alias{genePlot} 5 | \title{Plot total expression of a set of genes} 6 | \usage{ 7 | genePlot(gl, expmat, gannot, t = 0, weights = rep(1, length(gl)), 8 | plot = F) 9 | } 10 | \arguments{ 11 | \item{gl}{Gene list} 12 | 13 | \item{expmat}{3D volume of expression} 14 | 15 | \item{gannot}{3D annotation of volume with structure IDs} 16 | 17 | \item{t}{Threshold for removing noise; gene energy levels below this threshold will be removed} 18 | 19 | \item{weights}{List of relative weights corresponding to gene list; default: weighted equally} 20 | 21 | \item{plot}{Boolean of whether to make 3D plot} 22 | } 23 | \value{ 24 | exp3D 3D volume restricted to weighted gene expression set of interest 25 | } 26 | \description{ 27 | Plot total expression of a set of genes 28 | } 29 | \examples{ 30 | data(mat) 31 | data(gannot3D) 32 | gp3D <- genePlot('Dcx', mat, gannot3D) 33 | } 34 | \keyword{plot} 35 | 36 | -------------------------------------------------------------------------------- /man/genePlotWeightedComp.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2 (4.1.0): do not edit by hand 2 | % Please edit documentation in R/functions.R 3 | \name{genePlotWeightedComp} 4 | \alias{genePlotWeightedComp} 5 | \title{Relative expression of two groups using absolute differences} 6 | \usage{ 7 | genePlotWeightedComp(gl1, weights1, gl2, weights2, expmat, gannot, plot = F) 8 | } 9 | \arguments{ 10 | \item{gl1}{List of differentially expressed genes upregulated in cell group 1} 11 | 12 | \item{weights1}{List of weights corresponding to genes in \code{gl1}} 13 | 14 | \item{gl2}{List of differentially expressed genes upregulated in cell group 2} 15 | 16 | \item{weights2}{List of weights corresponding to genes in \code{gl2}} 17 | 18 | \item{expmat}{3D volume of expression} 19 | 20 | \item{gannot}{3D annotation of volume with structure IDs} 21 | 22 | \item{plot}{Boolean of whether to make 3D plot} 23 | } 24 | \value{ 25 | exp3D 3D volume of weighted expression for gene lists of interest 26 | } 27 | \description{ 28 | Relative expression of two groups using absolute differences 29 | } 30 | \keyword{comparison,} 31 | \keyword{placement} 32 | 33 | -------------------------------------------------------------------------------- /man/genePlotWeightedComp2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2 (4.1.0): do not edit by hand 2 | % Please edit documentation in R/functions.R 3 | \name{genePlotWeightedComp2} 4 | \alias{genePlotWeightedComp2} 5 | \title{Relative expression of two groups using ratios} 6 | \usage{ 7 | genePlotWeightedComp2(gl1, weights1, gl2, weights2, expmat, gannot, plot = F) 8 | } 9 | \arguments{ 10 | \item{gl1}{List of differentially expressed genes upregulated in cell group 1} 11 | 12 | \item{weights1}{List of weights corresponding to genes in \code{gl1}} 13 | 14 | \item{gl2}{List of differentially expressed genes upregulated in cell group 2} 15 | 16 | \item{weights2}{List of weights corresponding to genes in \code{gl2}} 17 | 18 | \item{expmat}{3D volume of expression} 19 | 20 | \item{gannot}{3D annotation of volume with structure IDs} 21 | 22 | \item{plot}{Boolean of whether to make 3D plot} 23 | } 24 | \value{ 25 | exp3D 3D volume of weighted expression for gene lists of interest 26 | } 27 | \description{ 28 | Relative expression of two groups using ratios 29 | } 30 | \keyword{comparison,} 31 | \keyword{placement} 32 | 33 | -------------------------------------------------------------------------------- /man/getChildren.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2 (4.1.0): do not edit by hand 2 | % Please edit documentation in R/functions.R 3 | \name{getChildren} 4 | \alias{getChildren} 5 | \title{A recursive way to get all the children of a Structure given its ID. Used by \code{\link{getStructureIds}}} 6 | \usage{ 7 | getChildren(nestedList, sid) 8 | } 9 | \arguments{ 10 | \item{nestedList}{A JSON derived nested list of structure relationships from Allen Brain Atlas's structure graph} 11 | 12 | \item{sid}{The Structure's ID} 13 | } 14 | \value{ 15 | cids The Structure children's IDs 16 | } 17 | \description{ 18 | A recursive way to get all the children of a Structure given its ID. Used by \code{\link{getStructureIds}} 19 | } 20 | \examples{ 21 | data(structureID) 22 | getChildren(structureID, 15903) 23 | } 24 | \keyword{browse,} 25 | \keyword{helper} 26 | \keyword{search,} 27 | 28 | -------------------------------------------------------------------------------- /man/getId.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2 (4.1.0): do not edit by hand 2 | % Please edit documentation in R/functions.R 3 | \name{getId} 4 | \alias{getId} 5 | \title{A recursive way to get structure IDs and names of structure given an exact name string. Used by \code{\link{getStructureIds}}} 6 | \usage{ 7 | getId(nestedList, name) 8 | } 9 | \arguments{ 10 | \item{nestedList}{A JSON derived nested list of Structure relationships from Allen Brain Atlas's structure graph} 11 | 12 | \item{name}{Structure's name} 13 | } 14 | \value{ 15 | cids Structure ID 16 | } 17 | \description{ 18 | A recursive way to get structure IDs and names of structure given an exact name string. Used by \code{\link{getStructureIds}} 19 | } 20 | \examples{ 21 | data(structureID) 22 | getId(structureID, 'pallium') 23 | } 24 | \keyword{browse,} 25 | \keyword{helper} 26 | \keyword{search,} 27 | 28 | -------------------------------------------------------------------------------- /man/getIds.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2 (4.1.0): do not edit by hand 2 | % Please edit documentation in R/functions.R 3 | \name{getIds} 4 | \alias{getIds} 5 | \title{A recursive way to get IDs and names of structure given a name substring} 6 | \usage{ 7 | getIds(nestedList, name) 8 | } 9 | \arguments{ 10 | \item{nestedList}{A JSON derived nested list of Structure relationships from Allen Brain Atlas's StructureGraph} 11 | 12 | \item{name}{Brain structure name substring} 13 | } 14 | \value{ 15 | ids A dictionary of Structures that contain the name with their IDs 16 | } 17 | \description{ 18 | In the Allen Brain Atlas, a Structure represents a neuroanatomical region of interest. Structures are grouped into Ontologies and organized in a hierarchy or StructureGraph. The StructureGraph for the Developing Mouse Brain Atlas is provided here under data/structureID.rda. This function allows you to browse Structures by name and ID given a name substring. 19 | } 20 | \examples{ 21 | data(structureID) 22 | getIds(structureID, 'pallium') 23 | } 24 | \keyword{browse,} 25 | \keyword{search} 26 | 27 | -------------------------------------------------------------------------------- /man/getName.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2 (4.1.0): do not edit by hand 2 | % Please edit documentation in R/functions.R 3 | \name{getName} 4 | \alias{getName} 5 | \title{A recursive way to get the name of a Structure given its ID} 6 | \usage{ 7 | getName(nestedList, sid) 8 | } 9 | \arguments{ 10 | \item{nestedList}{A JSON derived nested list of Structure relationships from Allen Brain Atlas's StructureGraph} 11 | 12 | \item{sid}{id The structure ID} 13 | } 14 | \value{ 15 | n Brain structure name 16 | } 17 | \description{ 18 | In the Allen Brain Atlas, a Structure represents a neuroanatomical region of interest. Structures are grouped into Ontologies and organized in a hierarchy or StructureGraph. The StructureGraph for the Developing Mouse Brain Atlas is provided here under data/structureID.rda. This function allows you to retrieve the name of a Structures given its ID. 19 | } 20 | \examples{ 21 | data(structureID) 22 | getName(structureID, 15903) 23 | } 24 | \keyword{browse,} 25 | \keyword{search} 26 | 27 | -------------------------------------------------------------------------------- /man/getStructureIds.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2 (4.1.0): do not edit by hand 2 | % Please edit documentation in R/functions.R 3 | \name{getStructureIds} 4 | \alias{getStructureIds} 5 | \title{Get IDs associated with a Structure given the exact Structure name} 6 | \usage{ 7 | getStructureIds(nestedList, name) 8 | } 9 | \arguments{ 10 | \item{nestedList}{A JSON derived nested list of structure relationships from Allen Brain Atlas's StructureGraph} 11 | 12 | \item{name}{Structure's name} 13 | } 14 | \value{ 15 | cids The Structure's ID and all its children's IDs 16 | } 17 | \description{ 18 | In the Allen Brain Atlas, a Structure represents a neuroanatomical region of interest. Structures are grouped into Ontologies and organized in a hierarchy or StructureGraph. With the exception of the "root" structure, each Structure has one parent and denotes a "part-of" relationship. Due to this relationship, a Structure's total volume is denoted by both its own IDs and also that of its children's IDs. The StructureGraph for the Developing Mouse Brain Atlas is provided here under data/structureID.rda. This function allows you to obtain all IDs associated with a Structure given its exact name. 19 | } 20 | \examples{ 21 | data(structureID) 22 | getStructureIds(structureID, 'pallium') 23 | } 24 | \keyword{browse,} 25 | \keyword{search} 26 | 27 | -------------------------------------------------------------------------------- /man/mat.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2 (4.1.0): do not edit by hand 2 | % Please edit documentation in R/functions.R 3 | \docType{data} 4 | \name{mat} 5 | \alias{mat} 6 | \title{Matrix of gene expression where each row corresponds to a gene and columns correspond to 3D locations in space} 7 | \format{2D array (matrix)} 8 | \usage{ 9 | mat 10 | } 11 | \description{ 12 | Matrix of gene expression where each row corresponds to a gene and columns correspond to 3D locations in space 13 | } 14 | \references{ 15 | \url{http://developingmouse.brain-map.org/} 16 | } 17 | \keyword{datasets} 18 | 19 | -------------------------------------------------------------------------------- /man/plotEnergy.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2 (4.1.0): do not edit by hand 2 | % Please edit documentation in R/functions.R 3 | \name{plotEnergy} 4 | \alias{plotEnergy} 5 | \title{Helper function for 3D plotting. Used by \code{\link{structurePlot}} and \code{\link{genePlot}}} 6 | \usage{ 7 | plotEnergy(exp, x, y, z) 8 | } 9 | \arguments{ 10 | \item{exp}{vector representation of volume} 11 | 12 | \item{x}{x-dimension of volume} 13 | 14 | \item{y}{y-dimension of volume} 15 | 16 | \item{z}{z-dimension of volume} 17 | } 18 | \description{ 19 | Helper function for 3D plotting. Used by \code{\link{structurePlot}} and \code{\link{genePlot}} 20 | } 21 | \keyword{helper} 22 | \keyword{plot,} 23 | 24 | -------------------------------------------------------------------------------- /man/plotProjection.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2 (4.1.0): do not edit by hand 2 | % Please edit documentation in R/functions.R 3 | \name{plotProjection} 4 | \alias{plotProjection} 5 | \title{Plot flat projection of a 3D volume} 6 | \usage{ 7 | plotProjection(mat3D, col = colorRampPalette(c("white", "black", "red", 8 | "yellow"), space = "Lab")(100), t = 0, add = F) 9 | } 10 | \arguments{ 11 | \item{mat3D}{3D volume} 12 | 13 | \item{col}{Color} 14 | 15 | \item{t}{Threshold used to remove noise} 16 | 17 | \item{add}{Boolean whether to overlay onto existing plot} 18 | } 19 | \description{ 20 | Plot flat projection of a 3D volume 21 | } 22 | \examples{ 23 | data(vol3D) 24 | plotProjection(vol3D, t=8) 25 | } 26 | \keyword{plot} 27 | 28 | -------------------------------------------------------------------------------- /man/plotProjectionXray.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2 (4.1.0): do not edit by hand 2 | % Please edit documentation in R/functions.R 3 | \name{plotProjectionXray} 4 | \alias{plotProjectionXray} 5 | \title{\code{\link{plotProjection}} with colors set to look more like an x-ray} 6 | \usage{ 7 | plotProjectionXray(mat3D, t = 0, add = F) 8 | } 9 | \arguments{ 10 | \item{mat3D}{3D volume} 11 | 12 | \item{t}{Threshold used to remove noise} 13 | 14 | \item{add}{Boolean whether to overlay onto existing plot} 15 | } 16 | \description{ 17 | \code{\link{plotProjection}} with colors set to look more like an x-ray 18 | } 19 | \keyword{modification} 20 | \keyword{plot,} 21 | 22 | -------------------------------------------------------------------------------- /man/plotSlice.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2 (4.1.0): do not edit by hand 2 | % Please edit documentation in R/functions.R 3 | \name{plotSlice} 4 | \alias{plotSlice} 5 | \title{Plot slice of 3D volume} 6 | \usage{ 7 | plotSlice(mat3D, slice, col = colorRampPalette(c("white", "black", "red", 8 | "yellow"), space = "Lab")(100), t = 0, add = F) 9 | } 10 | \arguments{ 11 | \item{mat3D}{3D volume} 12 | 13 | \item{slice}{Index of slice; limited to dimensions of mat3D} 14 | 15 | \item{col}{Color} 16 | 17 | \item{t}{Threshold used to remove noise} 18 | 19 | \item{add}{Boolean whether to overlay onto existing plot} 20 | } 21 | \description{ 22 | Plot slice of 3D volume 23 | } 24 | \examples{ 25 | data(vol3D) 26 | plotSlice(vol3D, 75, t=8) 27 | } 28 | \keyword{plot} 29 | 30 | -------------------------------------------------------------------------------- /man/plotSliceComp.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2 (4.1.0): do not edit by hand 2 | % Please edit documentation in R/functions.R 3 | \name{plotSliceComp} 4 | \alias{plotSliceComp} 5 | \title{Plot slice of 3D volume without thresholding and allowing for negative expression values. Used for comparing spatial expression of upregulated vs. downregulated gene sets.} 6 | \usage{ 7 | plotSliceComp(mat3D, slice, col = colorRampPalette(c("green", "blue", "black", 8 | "red", "yellow"), space = "Lab")(100), add = F) 9 | } 10 | \arguments{ 11 | \item{mat3D}{3D volume} 12 | 13 | \item{slice}{Index of slice; limited to dimensions of mat3D} 14 | 15 | \item{col}{Color} 16 | 17 | \item{add}{Boolean whether to overlay onto existing plot} 18 | } 19 | \description{ 20 | Plot slice of 3D volume without thresholding and allowing for negative expression values. Used for comparing spatial expression of upregulated vs. downregulated gene sets. 21 | } 22 | \examples{ 23 | data(vol3D) 24 | plotSliceComp(vol3D, 75) 25 | } 26 | \keyword{plot} 27 | 28 | -------------------------------------------------------------------------------- /man/plotSliceXray.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2 (4.1.0): do not edit by hand 2 | % Please edit documentation in R/functions.R 3 | \name{plotSliceXray} 4 | \alias{plotSliceXray} 5 | \title{\code{\link{plotSlice}} with colors set to look more like an x-ray} 6 | \usage{ 7 | plotSliceXray(mat3D, slice, t = 0, add = F) 8 | } 9 | \arguments{ 10 | \item{mat3D}{3D volume} 11 | 12 | \item{slice}{Index of slice; limited to dimensions of mat3D} 13 | 14 | \item{t}{Threshold used to remove noise} 15 | 16 | \item{add}{Boolean whether to overlay onto existing plot} 17 | } 18 | \description{ 19 | \code{\link{plotSlice}} with colors set to look more like an x-ray 20 | } 21 | \examples{ 22 | data(vol3D) 23 | plotSliceXray(vol3D, 75, t=8) 24 | } 25 | \keyword{modification} 26 | \keyword{plot,} 27 | 28 | -------------------------------------------------------------------------------- /man/structureID.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2 (4.1.0): do not edit by hand 2 | % Please edit documentation in R/functions.R 3 | \docType{data} 4 | \name{structureID} 5 | \alias{structureID} 6 | \title{Parsed StructureGraph for the developing mouse brain. Contains structure IDs and names in a hierarchical format.} 7 | \format{3D array} 8 | \usage{ 9 | structureID 10 | } 11 | \description{ 12 | Parsed StructureGraph for the developing mouse brain. Contains structure IDs and names in a hierarchical format. 13 | } 14 | \references{ 15 | \url{http://developingmouse.brain-map.org/} 16 | } 17 | \keyword{datasets} 18 | 19 | -------------------------------------------------------------------------------- /man/structurePlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2 (4.1.0): do not edit by hand 2 | % Please edit documentation in R/functions.R 3 | \name{structurePlot} 4 | \alias{structurePlot} 5 | \title{Plot the volume or expression within a Structure} 6 | \usage{ 7 | structurePlot(cids, vol, annot, plot = F) 8 | } 9 | \arguments{ 10 | \item{cids}{Structure ids} 11 | 12 | \item{vol}{3D volume of expression values} 13 | 14 | \item{annot}{3D annotation of volume with structure IDs} 15 | 16 | \item{plot}{Boolean of whether to make 3D plot} 17 | } 18 | \value{ 19 | tvol 3D volume restricted to just structure of interest 20 | } 21 | \description{ 22 | Plot the volume or expression within a Structure 23 | } 24 | \examples{ 25 | data(structureID) 26 | data(vol3D) 27 | data(annot3D) 28 | cids <- getStructureIds(structureID, 'pallium') 29 | sect3D <- structurePlot(cids, vol3D, annot3D) # For whole structure 30 | gpsect3D <- structurePlot(cids, array(mat['Dcx',], dim=dim(gannot3D)), gannot3D) # For a particular gene 31 | } 32 | \keyword{plot} 33 | 34 | -------------------------------------------------------------------------------- /man/vol3D.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2 (4.1.0): do not edit by hand 2 | % Please edit documentation in R/functions.R 3 | \docType{data} 4 | \name{vol3D} 5 | \alias{vol3D} 6 | \title{Pixel level 3D volume of the embryonic 11.5 day old mouse brain} 7 | \format{3D array} 8 | \usage{ 9 | vol3D 10 | } 11 | \description{ 12 | Pixel level 3D volume of the embryonic 11.5 day old mouse brain 13 | } 14 | \references{ 15 | \url{http://developingmouse.brain-map.org/} 16 | } 17 | \keyword{datasets} 18 | 19 | -------------------------------------------------------------------------------- /sample/mouse_compiled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/sample/mouse_compiled.png -------------------------------------------------------------------------------- /sample/mouse_projection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/sample/mouse_projection.png -------------------------------------------------------------------------------- /sample/mouse_slice_forebrain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/sample/mouse_slice_forebrain.png -------------------------------------------------------------------------------- /sample/mouse_slice_gene_exp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/sample/mouse_slice_gene_exp.png -------------------------------------------------------------------------------- /tests/tests.R: -------------------------------------------------------------------------------- 1 | # Tests for travis 2 | library(brainmapr) 3 | 4 | data(vol3D) 5 | data(structureID) 6 | data(gannot3D) 7 | data(annot3D) 8 | data(mat) 9 | 10 | ##### 11 | ## Basic tests 12 | ##### 13 | 14 | # get IDs for a structure 15 | ids <- getIds(structureID, 'brain') 16 | id <- getId(structureID, 'midbrain') 17 | name <- getName(structureID, id) 18 | children <- getChildren(structureID, id) 19 | cids <- getStructureIds(structureID, 'midbrain') 20 | # plot a projection 21 | plotProjectionXray(vol3D, t=8) 22 | plotProjection(vol3D, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 23 | # plot a slice 24 | s <- 15 # slice 25 | s2 <- round(s/dim(gannot3D)[3]*dim(vol3D)[3]) # convert 26 | plotSliceXray(vol3D, s2, t=8) 27 | plotSlice(vol3D, s2, t=8) 28 | # plot a section 29 | sect3D <- structurePlot(cids, vol3D, annot3D) 30 | plotProjection(sect3D, t=8) 31 | plotSlice(sect3D, s2, t=8) 32 | # plot a gene 33 | gp3D <- genePlot('Dcx', mat, gannot3D) 34 | plotProjection(gp3D, t=1) 35 | plotSlice(gp3D, s, t=1) 36 | # plot a gene in a section 37 | gpsect3D <- structurePlot(cids, gp3D, gannot3D) 38 | plotProjection(gpsect3D, t=1) 39 | plotSlice(gpsect3D, s, t=1) 40 | # compare 41 | gp3D <- genePlotWeightedComp('Dcx', 1, 'Sox11', 2, mat, gannot3D) 42 | gp3D <- genePlotWeightedComp2('Dcx', 1, 'Sox11', 2, mat, gannot3D) 43 | 44 | # Incorrect usage tests 45 | -------------------------------------------------------------------------------- /vignettes/brainmapr-vignette.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Getting Started with brainmapr" 3 | author: "Jean Fan" 4 | date: '2015-05-28' 5 | output: html_document 6 | vignette: | 7 | %\VignetteIndexEntry{Vignette Title} \usepackage[utf8]{inputenc} 8 | --- 9 | 10 | `brainmapr` visualizes 3D ISH gene expression data from the Allen Brain Atlas. 11 | 12 | The `brainmapr` package comes pre-loaded with a small sample of ISH data for 38 genes in the embryonic 11.5 day old mouse. Additional ISH data for ~2000 genes in convenient RData formats are available for the embryonic 11.5, 13.5, 15.5, 16.5, and 18.5, and post-natal 4, 14, 28, and 56 day old mice and can be downloaded from the [Kharchenko lab website](http://pklab.med.harvard.edu/jean/brainmapr/data-raw/) due to file size limitations on GitHub. By providing these data formats, we hope to enable investigators to explore trends in spatial correlation of gene expression or perform other statistical analyses from within the R statistical framework. 13 | 14 | In this vignette, we will work with the pre-loaded subset of ISH data to introduce a few common and useful methods in the `brainmapr` package. 15 | 16 | ## Getting Started 17 | 18 | To get started, load the `brainmapr` package. A number of datasets are already included and will be used in this vignette. Consult the R Documentation to learn more about each dataset. 19 | 20 | ```r 21 | library(brainmapr) 22 | ## included datasets 23 | invisible(structureID) 24 | ?structureID 25 | invisible(vol3D) 26 | ?vol3D 27 | invisible(annot3D) 28 | ?annot3D 29 | invisible(gannot3D) 30 | ?gannot3D 31 | invisible(mat) 32 | ?mat 33 | ``` 34 | 35 | ## Plotting 36 | 37 | We will first visualize a sagittal projection of the whole embryonic 11.5 day old mouse. Note that the mouse is upside-down on the slide. We will also visualize a sagittal slice of the whole embryonic 11.5 day old mouse. Note that the indices of the slice is limited to the dimensions of the 3D volume. Because 3D ISH data for individual genes are provided on a voxel level, while whole mouse volume data is provided on a pixel level, we will need to convert from a voxel to pixel level slice index in order to make consistent and comparable slices. 38 | 39 | 40 | ```r 41 | plotProjectionXray(vol3D, t=8) 42 | s <- 15 # voxel-level slice index 43 | s2 <- round(s/dim(gannot3D)[3]*dim(vol3D)[3]) # convert to pixel-level slice index 44 | plotSliceXray(vol3D, s2, t=8) 45 | ``` 46 | 47 | ![plot of chunk whole mouse plot](figures/brainmapr-whole mouse plot-1.png) ![plot of chunk whole mouse plot](figures/brainmapr-whole mouse plot-2.png) 48 | 49 | We can browse for structures that contain the substring 'brain'. All structures of interest are available in the `structureID` object. 50 | 51 | 52 | ```r 53 | getIds(structureID, 'brain') 54 | ``` 55 | 56 | ``` 57 | ## forebrain 58 | ## 15566 59 | ## midbrain 60 | ## 16649 61 | ## hindbrain 62 | ## 16808 63 | ## mesencephalic trigeminal tract (across m1, m2 and prepontine hindbrain) 64 | ## 17740 65 | ## ventricles, forebrain 66 | ## 126651562 67 | ## ventricles, midbrain 68 | ## 126651722 69 | ## ventricles, hindbrain 70 | ## 126651782 71 | ``` 72 | 73 | ISH data for a subset of 38 genes are included in this example dataset. We can browse these genes. 74 | 75 | ```r 76 | head(rownames(mat)) 77 | ``` 78 | 79 | ``` 80 | ## [1] "Dcx" "Sox11" "Cited2" "Plxna2" "Neurod6" "Tubb3" 81 | ``` 82 | 83 | We can restrict analyses to simply the brain component of interest as opposed to the entire mouse embryo. In this example, let's consider only the midbrain and hindbrain and associated ventricles. Let's plot a projection and slice of just the brain components of interest. 84 | 85 | 86 | ```r 87 | cids <- c(getStructureIds(structureID, 'midbrain'), 88 | getStructureIds(structureID, 'ventricles, midbrain'), 89 | getStructureIds(structureID, 'hindbrain'), 90 | getStructureIds(structureID, 'ventricles, hindbrain') 91 | ) 92 | sect3D <- structurePlot(cids, vol3D, annot3D, plot=F) 93 | plotProjection(vol3D, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 94 | plotProjection(sect3D, t=8, add=T) 95 | plotSlice(vol3D, s2, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 96 | plotSlice(sect3D, s2, t=8, add=T) 97 | ``` 98 | 99 | ![plot of chunk structure plot](figures/brainmapr-structure plot-1.png) ![plot of chunk structure plot](figures/brainmapr-structure plot-2.png) 100 | 101 | We can also view expression of a particular gene within the mouse embryo. Let's plot expression of `Dcx` gene. 102 | 103 | 104 | ```r 105 | gp3D <- genePlot('Dcx', mat, gannot3D, plot=F) 106 | ``` 107 | 108 | ``` 109 | ## [1] "Genes available:" 110 | ## [1] "Dcx" 111 | ## [1] "Genes not available:" 112 | ## character(0) 113 | ``` 114 | 115 | ```r 116 | plotProjection(vol3D, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 117 | plotProjection(gp3D, t=1, add=T) 118 | plotSlice(vol3D, s2, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 119 | plotSlice(gp3D, s, t=1, add=T) 120 | ``` 121 | 122 | ![plot of chunk gene1 plot](figures/brainmapr-gene1 plot-1.png) ![plot of chunk gene1 plot](figures/brainmapr-gene1 plot-2.png) 123 | 124 | We may want to restrict viewing expression of a particular gene to just the brain structures of interest. Let's plot expression of `Dcx` gene within the midbrain and hindbrain and associated ventricles. 125 | 126 | 127 | ```r 128 | gpsect3D <- structurePlot(cids, gp3D, gannot3D, plot=F) 129 | plotProjection(vol3D, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 130 | plotProjection(gpsect3D, t=1, add=T) 131 | plotSlice(vol3D, s2, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 132 | plotSlice(gpsect3D, s, t=1, add=T) 133 | ``` 134 | 135 | ![plot of chunk gene1 structure plot](figures/brainmapr-gene1 structure plot-1.png) ![plot of chunk gene1 structure plot](figures/brainmapr-gene1 structure plot-2.png) 136 | 137 | As a comparison, we can repeat this process for the `Sox11` gene. 138 | 139 | 140 | ```r 141 | gp3D <- genePlot('Sox11', mat, gannot3D, plot=F) 142 | ``` 143 | 144 | ``` 145 | ## [1] "Genes available:" 146 | ## [1] "Sox11" 147 | ## [1] "Genes not available:" 148 | ## character(0) 149 | ``` 150 | 151 | ```r 152 | plotProjection(vol3D, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 153 | plotProjection(gp3D, t=1, add=T) 154 | plotSlice(vol3D, s2, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 155 | plotSlice(gp3D, s, t=1, add=T) 156 | ``` 157 | 158 | ![plot of chunk gene2 plot](figures/brainmapr-gene2 plot-1.png) ![plot of chunk gene2 plot](figures/brainmapr-gene2 plot-2.png) 159 | 160 | ```r 161 | gpsect3D <- structurePlot(cids, gp3D, gannot3D, plot=F) 162 | plotProjection(vol3D, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 163 | plotProjection(gpsect3D, t=1, add=T) 164 | plotSlice(vol3D, s2, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 165 | plotSlice(gpsect3D, s, t=1, add=T) 166 | ``` 167 | 168 | ![plot of chunk gene2 structure plot](figures/brainmapr-gene2 structure plot-1.png) ![plot of chunk gene2 structure plot](figures/brainmapr-gene2 structure plot-2.png) 169 | 170 | We often want to plot the expression of a group of genes within the brain structure of interest. These groups of genes may be associated with a neuronal cell subpopulation of interest. By looking at where genes associated with the subpopulation is expressed, we may be able to spatially localize these subpopulations. In this example, we will first weigh the gene expressions equally by default. 171 | 172 | 173 | ```r 174 | gl <- c("Dcx", "Sox11", "FAKEGENE") 175 | gp3D <- genePlot(gl, mat, gannot3D, t=1, plot=F) 176 | ``` 177 | 178 | ``` 179 | ## [1] "Genes available:" 180 | ## [1] "Dcx" "Sox11" 181 | ## [1] "Genes not available:" 182 | ## [1] "FAKEGENE" 183 | ``` 184 | 185 | ```r 186 | gpsect3D <- structurePlot(cids, gp3D, gannot3D, plot=F) 187 | plotProjection(vol3D, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 188 | plotProjection(gpsect3D, t=1, add=T) 189 | plotSlice(vol3D, s2, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 190 | plotSlice(gpsect3D, s, t=1, add=T) 191 | ``` 192 | 193 | ![plot of chunk group gene plot](figures/brainmapr-group gene plot-1.png) ![plot of chunk group gene plot](figures/brainmapr-group gene plot-2.png) 194 | 195 | Some times, certain genes contribute more to a neuronal cell subpopulation's gene expression signature. In such a scenario, we would want to weigh gene expressions unequally. Weights to consider using include -log10(p-values or q-values) or log2(fold change). Note weights are relatively. 196 | 197 | 198 | ```r 199 | gl <- c("Dcx", "Sox11", "FAKEGENE") 200 | weights <- c(1, 0.01, 1) 201 | gp3D <- genePlot(gl, mat, gannot3D, t=1, plot=F, weights=weights) 202 | ``` 203 | 204 | ``` 205 | ## [1] "Genes available:" 206 | ## [1] "Dcx" "Sox11" 207 | ## [1] "Genes not available:" 208 | ## [1] "FAKEGENE" 209 | ``` 210 | 211 | ```r 212 | gpsect3D <- structurePlot(cids, gp3D, gannot3D, plot=F) 213 | plotProjection(vol3D, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 214 | plotProjection(gpsect3D, t=1, add=T) 215 | plotSlice(vol3D, s2, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 216 | plotSlice(gpsect3D, s, t=1, add=T) 217 | ``` 218 | 219 | ![plot of chunk group gene weighted plot](figures/brainmapr-group gene weighted plot-1.png) ![plot of chunk group gene weighted plot](figures/brainmapr-group gene weighted plot-2.png) 220 | 221 | In summary, this vignette has shown you how to plot projections and slices for whole embryonic mice, particular brain structures, genes, or groups of genes. For more information, please consult the R Documentation. 222 | -------------------------------------------------------------------------------- /vignettes/figures/brainmapr-gene1 plot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/brainmapr-gene1 plot-1.png -------------------------------------------------------------------------------- /vignettes/figures/brainmapr-gene1 plot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/brainmapr-gene1 plot-2.png -------------------------------------------------------------------------------- /vignettes/figures/brainmapr-gene1 structure plot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/brainmapr-gene1 structure plot-1.png -------------------------------------------------------------------------------- /vignettes/figures/brainmapr-gene1 structure plot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/brainmapr-gene1 structure plot-2.png -------------------------------------------------------------------------------- /vignettes/figures/brainmapr-gene2 plot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/brainmapr-gene2 plot-1.png -------------------------------------------------------------------------------- /vignettes/figures/brainmapr-gene2 plot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/brainmapr-gene2 plot-2.png -------------------------------------------------------------------------------- /vignettes/figures/brainmapr-gene2 structure plot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/brainmapr-gene2 structure plot-1.png -------------------------------------------------------------------------------- /vignettes/figures/brainmapr-gene2 structure plot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/brainmapr-gene2 structure plot-2.png -------------------------------------------------------------------------------- /vignettes/figures/brainmapr-group gene plot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/brainmapr-group gene plot-1.png -------------------------------------------------------------------------------- /vignettes/figures/brainmapr-group gene plot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/brainmapr-group gene plot-2.png -------------------------------------------------------------------------------- /vignettes/figures/brainmapr-group gene weighted plot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/brainmapr-group gene weighted plot-1.png -------------------------------------------------------------------------------- /vignettes/figures/brainmapr-group gene weighted plot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/brainmapr-group gene weighted plot-2.png -------------------------------------------------------------------------------- /vignettes/figures/brainmapr-structure plot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/brainmapr-structure plot-1.png -------------------------------------------------------------------------------- /vignettes/figures/brainmapr-structure plot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/brainmapr-structure plot-2.png -------------------------------------------------------------------------------- /vignettes/figures/brainmapr-whole mouse plot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/brainmapr-whole mouse plot-1.png -------------------------------------------------------------------------------- /vignettes/figures/brainmapr-whole mouse plot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/brainmapr-whole mouse plot-2.png -------------------------------------------------------------------------------- /vignettes/figures/pagoda-forebrain-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/pagoda-forebrain-1.png -------------------------------------------------------------------------------- /vignettes/figures/pagoda-forebrain-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/pagoda-forebrain-2.png -------------------------------------------------------------------------------- /vignettes/figures/pagoda-main split and comparison-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/pagoda-main split and comparison-1.png -------------------------------------------------------------------------------- /vignettes/figures/pagoda-main split and comparison-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/pagoda-main split and comparison-2.png -------------------------------------------------------------------------------- /vignettes/figures/pagoda-main split and comparison-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/pagoda-main split and comparison-3.png -------------------------------------------------------------------------------- /vignettes/figures/pagoda-main split and comparison-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/pagoda-main split and comparison-4.png -------------------------------------------------------------------------------- /vignettes/figures/pagoda-main split and comparison-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/pagoda-main split and comparison-5.png -------------------------------------------------------------------------------- /vignettes/figures/pagoda-proximal distal placement-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/pagoda-proximal distal placement-1.png -------------------------------------------------------------------------------- /vignettes/figures/pagoda-proximal distal-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/pagoda-proximal distal-1.png -------------------------------------------------------------------------------- /vignettes/figures/pagoda-proximal distal-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/pagoda-proximal distal-2.png -------------------------------------------------------------------------------- /vignettes/figures/pagoda-proximal distal-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/pagoda-proximal distal-3.png -------------------------------------------------------------------------------- /vignettes/figures/pagoda-proximal distal-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/pagoda-proximal distal-4.png -------------------------------------------------------------------------------- /vignettes/figures/pagoda-whole mouse-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/pagoda-whole mouse-1.png -------------------------------------------------------------------------------- /vignettes/figures/pagoda-whole mouse-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/brainmapr/882592a1b1d3306ab44e32ec34977d08b3532551/vignettes/figures/pagoda-whole mouse-2.png -------------------------------------------------------------------------------- /vignettes/pagoda-vignette.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Practical applications of brainmapr" 3 | author: "Jean Fan" 4 | date: '2015-05-20' 5 | output: pdf_document 6 | vignette: | 7 | %\VignetteIndexEntry{Vignette Title} \usepackage[utf8]{inputenc} 8 | --- 9 | 10 | `brainmapr` visualizes 3D ISH gene expression data from the Allen Brain Atlas. Our goal is to spatially place a group of neuronal cells within a region of the brain based on their gene expression signature. This vignette recreates figures in [paper] 11 | 12 | Load embryonic 13.5 day old mouse data. 13 | 14 | 15 | ```r 16 | library(brainmapr) 17 | # Load data 18 | load('../data-raw/RData/structureID.RData') 19 | load('../data-raw/RData/E13.5.energy.RData') 20 | load('../data-raw/RData/E13.5.annot.RData') 21 | ``` 22 | 23 | Plot slice of whole mouse. 24 | 25 | 26 | ```r 27 | plotProjectionXray(vol3D, t=15) 28 | s <- 26 # slice 29 | s2 <- round(s/dim(gannot3D)[3]*dim(vol3D)[3]) # convert 30 | plotSliceXray(vol3D, s2, t=15) 31 | ``` 32 | 33 | ![plot of chunk whole mouse](figures/pagoda-whole mouse-1.png) ![plot of chunk whole mouse](figures/pagoda-whole mouse-2.png) 34 | 35 | Get forebrain. 36 | 37 | 38 | ```r 39 | # Plot x-ray of just brain component 40 | # Forebrain 41 | cids1 <- getStructureIds(structureID, 'forebrain') 42 | cids2 <- getStructureIds(structureID, 'ventricles, forebrain') 43 | cids <- c(cids1, cids2) 44 | # Plot brain component; note section annotation data is for the left hemisphere only 45 | sect3D <- structurePlot(cids, vol3D, annot3D, plot=F) 46 | plotProjection(vol3D, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 47 | plotProjection(sect3D, t=8, add=T) 48 | plotSlice(vol3D, s2, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 49 | plotSlice(sect3D, s2, t=8, add=T) 50 | ``` 51 | 52 | ![plot of chunk forebrain](figures/pagoda-forebrain-1.png) ![plot of chunk forebrain](figures/pagoda-forebrain-2.png) 53 | 54 | Gene expression signatures for proximal distal cell group identified by `pagoda`. 55 | 56 | 57 | ```r 58 | # Plot gene expression 59 | # Upregulated genes 60 | gl1 <- c("Dlx2", "Dlx6as1", "Sp9", "Pbx3", "Dlx5", "Dlx1", "Necap1", "Zfhx3", "Pou3f4", "Sec63", "Gdi1", "Rbp1", "Rbmx", "Nrxn3", "Map3k13", "Meis1", "Slc6a1", "Sp8", "Pbx1", "Dcx", "Gad2", "Sirt7", "Hmgcll1") 61 | # Weights 62 | weights1 <- c(46.26915, 38.06011, 33.33369, 36.56755, 43.52929, 39.49066, 14.35763, 4.262908, 8.896505, 3.521533, 1.94611, 5.004284, 1.760767, 9.089976, 6.999584, 8.525134, 4.538585, 3.559675, 1.706482, 2.031702, 3.470824, 6.661706, 5.606481) 63 | gp3D <- genePlot(gl1, mat, gannot3D, plot=F, weights=weights1) 64 | ``` 65 | 66 | ``` 67 | ## [1] "Genes available:" 68 | ## [1] "Dlx2" "Sp9" "Pbx3" "Dlx5" "Dlx1" "Zfhx3" "Pou3f4" 69 | ## [8] "Meis1" "Slc6a1" "Sp8" "Pbx1" "Dcx" "Gad2" 70 | ## [1] "Genes not available:" 71 | ## [1] "Dlx6as1" "Necap1" "Sec63" "Gdi1" "Rbp1" "Rbmx" "Nrxn3" 72 | ## [8] "Map3k13" "Sirt7" "Hmgcll1" 73 | ``` 74 | 75 | ```r 76 | gpsect3D <- structurePlot(cids, gp3D, gannot3D, plot=F) 77 | plotProjection(vol3D, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 78 | plotProjection(gpsect3D, t=1, add=T) 79 | plotSlice(vol3D, s2, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 80 | plotSlice(gpsect3D, s, t=1, add=T) 81 | # Downregulated genes 82 | gl2 <- c("Celsr1", "Sp1", "Adck2", "Dkk3", "Bms1", "Eif2c3", "Bhlhe22", "Rcan2", "Tmem115", "Zfp654", "Smap1", "Map2k6", "Cadm4", "B4galt4", "Etl4", "Qsox2", "Hist1h1c", "1810041L15Rik", "Thap7", "Fuca1", "Stard4", "Rap1gds1", "Fam84b", "Pigh", "Ogfrl1", "Mdm1", "Syde2", "Gm166", "Ccdc171", "BC023829", "9230110C19Rik", "Lin9", "Clpp", "Xrcc4", "Vrk3", "Cdk5rap1", "Lrr1", "Spty2d1", "Ext2", "Tex261", "1810044D09Rik", "Gpr156", "2410127L17Rik", "Pdp2", "E2f8", "Tenm4", "D3Ertd751e", "Prtg", "Mrps26", "Rabac1", "Chaf1b", "Gm17762", "Trim3", "Cpeb2", "Rmi1", "Klf16", "Echdc1", "Hdac7", "Gadd45a", "Myo7a", "Safb2", "Scml2", "Pbk", "Slc16a1", "Atp2b1", "Polr3h", "Mlst8", "Cradd", "Avl9", "Ndc80", "Ift74", "Eomes", "Slit2", "Phf13", "Oscp1", "Cd9", "Nufip1", "Sft2d2", "Col18a1", "Mipep", "Lamb1", "Rrp15", "Rfxap", "Neurod2", "Melk", "Wdr35", "Fam53b", "Faim", "Ankib1", "Pim3", "Tcn2", "Sptlc1", "Lmf1", "2700050L05Rik", "P4ha1", "Ugdh", "2510003E04Rik", "Unc50", "Trappc6a", "Urm1", "Ccdc117", "Zdhhc24", "Osbpl5", "Spg20", "Prrc1", "Sh3pxd2a", "Tef", "Cbln2", "AI414108", "Znrf3", "Phlpp2", "Mpp6", "Dhx33", "Spg21", "Ankrd40", "Smyd5", "Fbln1", "Sapcd2", "Rnft1", "Nfix", "Wee1", "Vkorc1l1", "Zfp574", "Nap1l2", "Dusp14", "Ccdc112", "Epb4.1l2", "1810055G02Rik", "Kctd3", "Hap1", "Ccdc40", "Wdr3", "Synpr", "Arhgap31", "Zc3h7a", "Cenph", "Gpank1", "Kdm2a", "Smad3", "1190002N15Rik", "Ptar1", "Klf6", "Lpar4", "Uaca", "Stk24", "Tmem248", "Lipt1", "Hmga2", "Rnf26", "Asb1", "Add3", "Ankzf1", "Fbxo25", "Zfp955b", "Fbxl6", "Bcl2l12", "Cystm1", "Thop1", "Trmt13", "Tmem179b", "Slu7", "Nucb1", "Scd1", "Nptx1", "Ppap2c", "Pcdh18", "Nrxn1", "Lap3", "Asb3", "Ano1", "Arhgef25", "Acad8", "Pgap2", "Fam179b", "Tceb3", "Tnik", "Dap3", "Slc25a24", "E2f6", "Sox3", "Cyth3", "Tspan12", "1700102H20Rik", "Dgkd", "Maml1", "Fgfr2", "Klhdc4", "Incenp", "Vcam1", "Atl3", "Rai2", "Tm7sf2", "Napepld", "Fert2", "Cldn12", "Itpr1", "Katnb1", "Hyal2", "Gys1", "Mcu", "Pacrgl", "Aldoc", "Lhpp", "Pi4k2b", "Rem2", "Polr3a", "Ptpn13", "2310039H08Rik", "Col11a1", "Dph2", "Ddrgk1", "Tmem101", "Gas2", "Cdc45", "Tmem126b", "Pofut2", "Cep68", "Npc1", "Lpar1", "Adamts20", "Bcl10", "Mir135a-2", "Snap23", "Sesn1", "Pde3b", "Slk", "Dennd1b", "Plk1s1", "Trak1", "Galnt7", "E2f7", "Rpia", "2010204K13Rik", "Mbd1", "Tmem178", "Gmds", "2010107G23Rik", "Rab30", "Zbed3", "Coasy", "Fntb", "Wnt8b", "Ndn", "Rspo3", "Dnajb12", "Map4k3", "Caml", "Tceal1", "Cdpf1", "C1galt1c1", "Smap2", "Ece2", "Pvrl2", "Noc4l", "Trps1", "Nubpl", "Fgfbp3", "Pold1", "Sil1", "Zmym1", "2310035C23Rik", "Cluh", "Rexo2", "Frrs1l", "Sstr2", "Herc3", "Slc25a36", "Fahd1", "Fam196a", "Alcam", "Atrip", "Smpd2", "Hdgfrp2", "Tanc1", "Pspc1", "Gusb", "Dgcr6", "Slc30a10", "Flrt2", "Gdap2", "Zfp770", "Tmem110", "Prr15", "Hsd17b7", "Per3", "Tiparp", "Gcat", "AW554918", "Ogfr", "Gne", "Ap4m1", "Mlf1", "Ppp4r2", "Pms1", "Tmed5", "Mtg1", "Fars2", "Dbndd1", "Tmem251", "Cdk2ap2", "Dennd1a", "Prdm5", "Ercc3", "Fam169a", "Vps52", "Nynrin", "1700020I14Rik", "Athl1", "Asrgl1", "2700099C18Rik", "Obfc1", "Necab3", "Adnp2", "Nckap5", "Ptgr1", "Ptpmt1", "Zscan22", "Msto1", "Sdc4", "Rgcc", "Vkorc1", "Hist1h4i", "Tmem14a", "Wfdc2", "Baiap2l1", "Gemin6", "D330022K07Rik", "C430049B03Rik", "Slc35b2", "Ext1", "Brca1", "Rnf11", "Zbtb17", "Dtd2", "Sap30l", "Akip1", "Zfp449", "Mpp5", "Kbtbd11", "Zmym3", "Tmed3", "2700097O09Rik", "Slc9a1", "2810408I11Rik", "Nup43", "Zfp276", "Gm15545", "Zfyve16", "Rcn3", "Ccrn4l", "Ift172", "Pgs1", "Rwdd3", "Mettl23", "Chrna3", "Ttc8", "Ndufaf1", "Zfp719", "Bre", "Dpm1", "Gm11627", "Exoc6b", "Eme1", "Ccdc138", "Hunk", "Wdr60", "Fam173b", "Cntn5", "Grtp1", "Nedd9", "Gtf2h4", "Tfap2c", "Fut9", "Osbpl11", "0610007N19Rik", "Fndc3c1", "Slc17a7", "Prosc", "Ngly1", "Nme3", "Neurod1", "Pcp4", "Cdk19", "Coq4", "Smim8", "Elmod3", "Cad", "2810002D19Rik", "Sc5d", "BC030867", "Gpc3", "Pafah2", "Hadhb", "Usp25", "Itm2a", "Plekhf2", "Pef1", "Pcsk6", "Dach2", "Sat1", "Prokr1", "Zkscan17", "Pold3", "Nkrf", "Mmd2", "Alad", "Enpp5", "Man1b1", "Traf3ip1", "Fut10", "Ptplb", "Dnajb2", "BC022687", "Ift122", "Jph1", "1110012L19Rik", "Cdk5rap2", "Dym", "Abhd6", "A330048O09Rik", "Nop14", "Gm9958", "Zufsp", "Emx1", "Qtrt1", "Lman1", "Ppp1r14a", "Stx8", "Adck5", "Tmem216", "Plxna4", "Pdha1", "Appl2", "Coil", "Slc17a6", "Hs3st1", "Slc35a2", "Zfp36l2", "Atxn1l", "Blvra", "Cables2", "Ttpal", "2210016L21Rik", "Lrrc57", "Aspscr1", "Spice1", "Lmcd1", "Bora", "Ddx28", "Gemin2", "Gba", "Ralb", "Cdt1", "Prelid2", "Hey1", "5330426P16Rik", "A730017C20Rik", "Cntrob", "Bivm", "Rtn2", "Neurod6", "Sh3gl1", "Phldb2", "Galnt14", "Pgm1", "Esco2", "Msl3", "Cbln4", "Zfp763", "Mecr", "Gpr89", "Lsm10", "Coq9", "Akap10", "Shmt2", "Nhlh1", "Ubox5", "Lrrn1", "Cep57l1", "Adamts10", "Mterfd3", "Prim2", "Tnfaip8", "Gpr19", "Masp1", "Jag1", "Enoph1", "Mgme1", "Suclg2", "Pinx1", "Ube2t", "Arl6", "Cers2", "2810055G20Rik", "Tmem132c", "Atic", "Actr1b", "Asah1", "Nfia", "Rprd1a", "Neurog2", "0610031J06Rik", "Otx1", "Litaf", "Nr2e1", "Plp2", "Ankrd13c", "Uchl5", "Taf12", "Serpini1", "Gja1", "Nfib") 83 | weights2 <- c(13.61864, 14.61415, 12.08321, 10.71039, 14.41029, 9.096843, 11.57122, 11.90863, 11.66958, 12.82011, 12.98447, 15.12115, 9.209305, 12.82725, 14.80067, 13.23838, 10.12313, 14.07884, 14.08529, 11.53182, 13.09685, 14.08529, 13.67344, 11.37786, 11.37786, 13.36228, 10.41103, 10.10093, 9.606883, 14.74488, 12.03396, 14.68973, 17.09652, 12.03396, 13.61946, 10.7984, 9.151281, 10.74603, 11.32915, 10.91604, 12.0034, 11.02835, 14.56363, 12.7291, 10.22225, 13.8366, 11.24725, 11.08771, 10.24773, 12.09757, 15.28999, 10.66939, 14.44988, 12.52891, 12.5483, 10.69896, 10.69896, 13.22628, 12.72598, 11.37924, 13.32341, 10.625, 16.38446, 13.25959, 15.63164, 14.19521, 9.473503, 11.76694, 14.00611, 14.95135, 17.24502, 13.84699, 14.8664, 10.87371, 10.61886, 13.59214, 12.99748, 14.78145, 10.87371, 14.44556, 10.53676, 14.53523, 10.9089, 14.74563, 14.8464, 12.45732, 12.71329, 14.8464, 14.5051, 12.0307, 10.06825, 11.00681, 11.34999, 12.69911, 13.39316, 14.34291, 10.73571, 13.82759, 10.05256, 14.38757, 15.73909, 12.62815, 11.59022, 12.63262, 11.59432, 11.8539, 10.72908, 13.93049, 11.42467, 13.07825, 14.91031, 13.26324, 12.16026, 14.10128, 10.88062, 11.75469, 15.06536, 14.71703, 11.49496, 13.49787, 14.8912, 10.79829, 14.10745, 11.32921, 15.51246, 11.24218, 12.98575, 15.34549, 13.34012, 10.12108, 12.9131, 11.95335, 12.3896, 11.95335, 14.57087, 10.81909, 16.05413, 14.13461, 12.5641, 13.61111, 11.27084, 12.58141, 12.66878, 11.62033, 10.59083, 16.45585, 11.46658, 18.81919, 15.06599, 15.50395, 15.59154, 11.33856, 15.55755, 10.54749, 15.20597, 13.71174, 11.35899, 14.2745, 13.12901, 15.60724, 15.95995, 15.25453, 14.55213, 11.90629, 11.37712, 14.99311, 13.67019, 16.31603, 16.66881, 12.52365, 14.58196, 12.37257, 12.04586, 15.4319, 16.05273, 14.74214, 16.69591, 11.63385, 15.54141, 13.76525, 15.18618, 16.25187, 10.21293, 14.3869, 11.36743, 15.63022, 16.16498, 15.89852, 16.34262, 10.6738, 10.8517, 11.38539, 12.45277, 15.56597, 10.76802, 12.99281, 16.28551, 16.10753, 11.65793, 13.00968, 14.61361, 13.3661, 15.41557, 10.79827, 10.97676, 14.45719, 12.85084, 15.9743, 16.15279, 15.90458, 16.08463, 14.26838, 15.88367, 15.43498, 13.28126, 11.4865, 15.52472, 12.56336, 15.16577, 13.99917, 15.88367, 11.66597, 13.01205, 15.16577, 14.09358, 14.9015, 15.44011, 12.49463, 13.75309, 15.64076, 15.47179, 11.78375, 11.78375, 12.95313, 15.6517, 15.74165, 14.84213, 14.67065, 14.77473, 12.79275, 16.39635, 13.60356, 14.51291, 16.76647, 10.36636, 14.96362, 16.58618, 12.64003, 16.25147, 10.9246, 11.5566, 15.89032, 15.80004, 15.07775, 13.81375, 14.89718, 12.91089, 14.17489, 11.46631, 15.25832, 15.16804, 11.5566, 15.25832, 16.16118, 15.43889, 11.01488, 12.1886, 11.91774, 16.07089, 13.63317, 15.80004, 13.90403, 13.99432, 12.36917, 15.43889, 12.8206, 16.61261, 15.25832, 15.98061, 15.07775, 15.07775, 11.82746, 9.841166, 13.00117, 14.26518, 16.25147, 16.25147, 14.44575, 14.71661, 15.98061, 12.73032, 16.43204, 16.07556, 15.98636, 12.92251, 15.96586, 16.05658, 9.986869, 16.09098, 16.54553, 13.5527, 11.73354, 15.64746, 15.37637, 15.31162, 16.45403, 16.09669, 15.46323, 15.82922, 11.71179, 16.80268, 16.34359, 16.43541, 15.60905, 12.76269, 13.40542, 10.65088, 16.52723, 14.23178, 16.34359, 16.73998, 16.38034, 16.22932, 16.69038, 11.06544, 16.79128, 10.42703, 12.75515, 14.32643, 14.97343, 15.80529, 15.89772, 15.71286, 14.60372, 10.64724, 13.98703, 15.56888, 15.75423, 13.99346, 12.78873, 17.05163, 16.95896, 16.31026, 14.08613, 17.05163, 11.12063, 11.02796, 16.58827, 16.86629, 16.21759, 11.86201, 15.93957, 17.42232, 17.42232, 15.10552, 17.05163, 13.80812, 11.86201, 16.77362, 17.60767, 12.60338, 15.8469, 14.54949, 11.58399, 14.73484, 16.77362, 13.06674, 12.04735, 12.04735, 16.40293, 16.58827, 17.05163, 16.86629, 14.92018, 15.47621, 16.86629, 10.65727, 14.08613, 12.78873, 16.77362, 18.07102, 15.47621, 12.14002, 16.31026, 16.31026, 11.58399, 13.90079, 16.4956, 15.93957, 15.29087, 15.66155, 12.51071, 16.86629, 12.60338, 17.32965, 15.01285, 15.10552, 12.14002, 13.06674, 15.93957, 15.01285, 16.40293, 16.58827, 12.69605, 17.14431, 16.77362, 12.32537, 15.10552, 14.36415, 12.51071, 14.73484, 14.27148, 16.95896, 12.60338, 15.75423, 17.23698, 13.5301, 15.75423, 14.64216, 16.40293, 15.8469, 11.67666, 16.68095, 16.68095, 16.21759, 15.93957, 13.25208, 17.14431, 12.97407, 16.95896, 16.12491, 17.23698, 12.78873, 13.80812, 17.23698, 17.42232, 14.36415, 16.4956, 15.56888, 13.06674, 16.21759, 16.31026, 13.43743, 16.86629, 12.69605, 15.66155, 15.47621, 16.21759, 16.40293, 17.05163, 14.82751, 13.43743, 13.06674, 15.47621, 15.01285, 16.12491, 16.31026, 13.06674, 16.12491, 16.4956, 17.51499, 17.14431, 16.12491, 14.64216, 15.66155, 15.66155, 15.8469, 13.43743, 16.03224, 16.77362, 16.31026, 17.70034, 16.58827, 15.01285, 16.77362, 16.77362, 16.4956, 17.14431, 16.4956, 16.12491, 17.14431, 15.47621, 13.99346, 16.12491, 14.36415, 15.01285, 13.80812, 16.68095, 15.56888, 16.86629, 16.77362, 17.60767, 17.42232, 17.51499, 17.42232, 17.60767, 16.77362, 17.51499, 11.2133, 16.68095, 17.14431, 16.86629, 14.64216, 16.95896, 15.56888, 17.60767, 16.77362, 17.23698, 17.70034, 19.3685, 18.97918, 61.6922) 84 | gp3D <- genePlot(gl2, mat, gannot3D, plot=F, weights=weights2) 85 | ``` 86 | 87 | ``` 88 | ## [1] "Genes available:" 89 | ## [1] "Celsr1" "Dkk3" "Bhlhe22" "E2f8" "Eomes" "Slit2" 90 | ## [7] "Phf13" "Cd9" "Col18a1" "Lamb1" "Neurod2" "Tef" 91 | ## [13] "Cbln2" "Nfix" "Dusp14" "Hap1" "Synpr" "Smad3" 92 | ## [19] "Klf6" "Hmga2" "Pcdh18" "Nrxn1" "Arhgef25" "E2f6" 93 | ## [25] "Sox3" "Maml1" "Fgfr2" "Itpr1" "Col11a1" "E2f7" 94 | ## [31] "Wnt8b" "Rspo3" "Ece2" "Pvrl2" "Trps1" "Sstr2" 95 | ## [37] "Alcam" "Gusb" "Pms1" "Prdm5" "Adnp2" "Brca1" 96 | ## [43] "Tmed3" "Chrna3" "Tfap2c" "Slc17a7" "Neurod1" "Pcp4" 97 | ## [49] "Gpc3" "Dach2" "Emx1" "Plxna4" "Slc17a6" "Lmcd1" 98 | ## [55] "Hey1" "Neurod6" "Cbln4" "Nhlh1" "Mterfd3" "Jag1" 99 | ## [61] "Nfia" "Neurog2" "Otx1" "Nr2e1" "Gja1" "Nfib" 100 | ## [1] "Genes not available:" 101 | ## [1] "Sp1" "Adck2" "Bms1" "Eif2c3" 102 | ## [5] "Rcan2" "Tmem115" "Zfp654" "Smap1" 103 | ## [9] "Map2k6" "Cadm4" "B4galt4" "Etl4" 104 | ## [13] "Qsox2" "Hist1h1c" "1810041L15Rik" "Thap7" 105 | ## [17] "Fuca1" "Stard4" "Rap1gds1" "Fam84b" 106 | ## [21] "Pigh" "Ogfrl1" "Mdm1" "Syde2" 107 | ## [25] "Gm166" "Ccdc171" "BC023829" "9230110C19Rik" 108 | ## [29] "Lin9" "Clpp" "Xrcc4" "Vrk3" 109 | ## [33] "Cdk5rap1" "Lrr1" "Spty2d1" "Ext2" 110 | ## [37] "Tex261" "1810044D09Rik" "Gpr156" "2410127L17Rik" 111 | ## [41] "Pdp2" "Tenm4" "D3Ertd751e" "Prtg" 112 | ## [45] "Mrps26" "Rabac1" "Chaf1b" "Gm17762" 113 | ## [49] "Trim3" "Cpeb2" "Rmi1" "Klf16" 114 | ## [53] "Echdc1" "Hdac7" "Gadd45a" "Myo7a" 115 | ## [57] "Safb2" "Scml2" "Pbk" "Slc16a1" 116 | ## [61] "Atp2b1" "Polr3h" "Mlst8" "Cradd" 117 | ## [65] "Avl9" "Ndc80" "Ift74" "Oscp1" 118 | ## [69] "Nufip1" "Sft2d2" "Mipep" "Rrp15" 119 | ## [73] "Rfxap" "Melk" "Wdr35" "Fam53b" 120 | ## [77] "Faim" "Ankib1" "Pim3" "Tcn2" 121 | ## [81] "Sptlc1" "Lmf1" "2700050L05Rik" "P4ha1" 122 | ## [85] "Ugdh" "2510003E04Rik" "Unc50" "Trappc6a" 123 | ## [89] "Urm1" "Ccdc117" "Zdhhc24" "Osbpl5" 124 | ## [93] "Spg20" "Prrc1" "Sh3pxd2a" "AI414108" 125 | ## [97] "Znrf3" "Phlpp2" "Mpp6" "Dhx33" 126 | ## [101] "Spg21" "Ankrd40" "Smyd5" "Fbln1" 127 | ## [105] "Sapcd2" "Rnft1" "Wee1" "Vkorc1l1" 128 | ## [109] "Zfp574" "Nap1l2" "Ccdc112" "Epb4.1l2" 129 | ## [113] "1810055G02Rik" "Kctd3" "Ccdc40" "Wdr3" 130 | ## [117] "Arhgap31" "Zc3h7a" "Cenph" "Gpank1" 131 | ## [121] "Kdm2a" "1190002N15Rik" "Ptar1" "Lpar4" 132 | ## [125] "Uaca" "Stk24" "Tmem248" "Lipt1" 133 | ## [129] "Rnf26" "Asb1" "Add3" "Ankzf1" 134 | ## [133] "Fbxo25" "Zfp955b" "Fbxl6" "Bcl2l12" 135 | ## [137] "Cystm1" "Thop1" "Trmt13" "Tmem179b" 136 | ## [141] "Slu7" "Nucb1" "Scd1" "Nptx1" 137 | ## [145] "Ppap2c" "Lap3" "Asb3" "Ano1" 138 | ## [149] "Acad8" "Pgap2" "Fam179b" "Tceb3" 139 | ## [153] "Tnik" "Dap3" "Slc25a24" "Cyth3" 140 | ## [157] "Tspan12" "1700102H20Rik" "Dgkd" "Klhdc4" 141 | ## [161] "Incenp" "Vcam1" "Atl3" "Rai2" 142 | ## [165] "Tm7sf2" "Napepld" "Fert2" "Cldn12" 143 | ## [169] "Katnb1" "Hyal2" "Gys1" "Mcu" 144 | ## [173] "Pacrgl" "Aldoc" "Lhpp" "Pi4k2b" 145 | ## [177] "Rem2" "Polr3a" "Ptpn13" "2310039H08Rik" 146 | ## [181] "Dph2" "Ddrgk1" "Tmem101" "Gas2" 147 | ## [185] "Cdc45" "Tmem126b" "Pofut2" "Cep68" 148 | ## [189] "Npc1" "Lpar1" "Adamts20" "Bcl10" 149 | ## [193] "Mir135a-2" "Snap23" "Sesn1" "Pde3b" 150 | ## [197] "Slk" "Dennd1b" "Plk1s1" "Trak1" 151 | ## [201] "Galnt7" "Rpia" "2010204K13Rik" "Mbd1" 152 | ## [205] "Tmem178" "Gmds" "2010107G23Rik" "Rab30" 153 | ## [209] "Zbed3" "Coasy" "Fntb" "Ndn" 154 | ## [213] "Dnajb12" "Map4k3" "Caml" "Tceal1" 155 | ## [217] "Cdpf1" "C1galt1c1" "Smap2" "Noc4l" 156 | ## [221] "Nubpl" "Fgfbp3" "Pold1" "Sil1" 157 | ## [225] "Zmym1" "2310035C23Rik" "Cluh" "Rexo2" 158 | ## [229] "Frrs1l" "Herc3" "Slc25a36" "Fahd1" 159 | ## [233] "Fam196a" "Atrip" "Smpd2" "Hdgfrp2" 160 | ## [237] "Tanc1" "Pspc1" "Dgcr6" "Slc30a10" 161 | ## [241] "Flrt2" "Gdap2" "Zfp770" "Tmem110" 162 | ## [245] "Prr15" "Hsd17b7" "Per3" "Tiparp" 163 | ## [249] "Gcat" "AW554918" "Ogfr" "Gne" 164 | ## [253] "Ap4m1" "Mlf1" "Ppp4r2" "Tmed5" 165 | ## [257] "Mtg1" "Fars2" "Dbndd1" "Tmem251" 166 | ## [261] "Cdk2ap2" "Dennd1a" "Ercc3" "Fam169a" 167 | ## [265] "Vps52" "Nynrin" "1700020I14Rik" "Athl1" 168 | ## [269] "Asrgl1" "2700099C18Rik" "Obfc1" "Necab3" 169 | ## [273] "Nckap5" "Ptgr1" "Ptpmt1" "Zscan22" 170 | ## [277] "Msto1" "Sdc4" "Rgcc" "Vkorc1" 171 | ## [281] "Hist1h4i" "Tmem14a" "Wfdc2" "Baiap2l1" 172 | ## [285] "Gemin6" "D330022K07Rik" "C430049B03Rik" "Slc35b2" 173 | ## [289] "Ext1" "Rnf11" "Zbtb17" "Dtd2" 174 | ## [293] "Sap30l" "Akip1" "Zfp449" "Mpp5" 175 | ## [297] "Kbtbd11" "Zmym3" "2700097O09Rik" "Slc9a1" 176 | ## [301] "2810408I11Rik" "Nup43" "Zfp276" "Gm15545" 177 | ## [305] "Zfyve16" "Rcn3" "Ccrn4l" "Ift172" 178 | ## [309] "Pgs1" "Rwdd3" "Mettl23" "Ttc8" 179 | ## [313] "Ndufaf1" "Zfp719" "Bre" "Dpm1" 180 | ## [317] "Gm11627" "Exoc6b" "Eme1" "Ccdc138" 181 | ## [321] "Hunk" "Wdr60" "Fam173b" "Cntn5" 182 | ## [325] "Grtp1" "Nedd9" "Gtf2h4" "Fut9" 183 | ## [329] "Osbpl11" "0610007N19Rik" "Fndc3c1" "Prosc" 184 | ## [333] "Ngly1" "Nme3" "Cdk19" "Coq4" 185 | ## [337] "Smim8" "Elmod3" "Cad" "2810002D19Rik" 186 | ## [341] "Sc5d" "BC030867" "Pafah2" "Hadhb" 187 | ## [345] "Usp25" "Itm2a" "Plekhf2" "Pef1" 188 | ## [349] "Pcsk6" "Sat1" "Prokr1" "Zkscan17" 189 | ## [353] "Pold3" "Nkrf" "Mmd2" "Alad" 190 | ## [357] "Enpp5" "Man1b1" "Traf3ip1" "Fut10" 191 | ## [361] "Ptplb" "Dnajb2" "BC022687" "Ift122" 192 | ## [365] "Jph1" "1110012L19Rik" "Cdk5rap2" "Dym" 193 | ## [369] "Abhd6" "A330048O09Rik" "Nop14" "Gm9958" 194 | ## [373] "Zufsp" "Qtrt1" "Lman1" "Ppp1r14a" 195 | ## [377] "Stx8" "Adck5" "Tmem216" "Pdha1" 196 | ## [381] "Appl2" "Coil" "Hs3st1" "Slc35a2" 197 | ## [385] "Zfp36l2" "Atxn1l" "Blvra" "Cables2" 198 | ## [389] "Ttpal" "2210016L21Rik" "Lrrc57" "Aspscr1" 199 | ## [393] "Spice1" "Bora" "Ddx28" "Gemin2" 200 | ## [397] "Gba" "Ralb" "Cdt1" "Prelid2" 201 | ## [401] "5330426P16Rik" "A730017C20Rik" "Cntrob" "Bivm" 202 | ## [405] "Rtn2" "Sh3gl1" "Phldb2" "Galnt14" 203 | ## [409] "Pgm1" "Esco2" "Msl3" "Zfp763" 204 | ## [413] "Mecr" "Gpr89" "Lsm10" "Coq9" 205 | ## [417] "Akap10" "Shmt2" "Ubox5" "Lrrn1" 206 | ## [421] "Cep57l1" "Adamts10" "Prim2" "Tnfaip8" 207 | ## [425] "Gpr19" "Masp1" "Enoph1" "Mgme1" 208 | ## [429] "Suclg2" "Pinx1" "Ube2t" "Arl6" 209 | ## [433] "Cers2" "2810055G20Rik" "Tmem132c" "Atic" 210 | ## [437] "Actr1b" "Asah1" "Rprd1a" "0610031J06Rik" 211 | ## [441] "Litaf" "Plp2" "Ankrd13c" "Uchl5" 212 | ## [445] "Taf12" "Serpini1" 213 | ``` 214 | 215 | ```r 216 | gpsect3D <- structurePlot(cids, gp3D, gannot3D, plot=F) 217 | plotProjection(vol3D, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 218 | plotProjection(gpsect3D, t=1, add=T) 219 | plotSlice(vol3D, s2, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 220 | plotSlice(gpsect3D, s, t=1, add=T) 221 | ``` 222 | 223 | ![plot of chunk proximal distal](figures/pagoda-proximal distal-1.png) ![plot of chunk proximal distal](figures/pagoda-proximal distal-2.png) ![plot of chunk proximal distal](figures/pagoda-proximal distal-3.png) ![plot of chunk proximal distal](figures/pagoda-proximal distal-4.png) 224 | 225 | Compare relative placement. 226 | 227 | 228 | ```r 229 | gp3D <- genePlotWeightedComp(gl1, weights1, gl2, weights2, mat, gannot3D, plot=F) 230 | ``` 231 | 232 | ``` 233 | ## [1] "Dlx2" "Sp9" "Pbx3" "Dlx5" "Dlx1" "Zfhx3" 234 | ## [7] "Pou3f4" "Meis1" "Slc6a1" "Sp8" "Pbx1" "Dcx" 235 | ## [13] "Gad2" "Celsr1" "Dkk3" "Bhlhe22" "E2f8" "Eomes" 236 | ## [19] "Slit2" "Phf13" "Cd9" "Col18a1" "Lamb1" "Neurod2" 237 | ## [25] "Tef" "Cbln2" "Nfix" "Dusp14" "Hap1" "Synpr" 238 | ## [31] "Smad3" "Klf6" "Hmga2" "Pcdh18" "Nrxn1" "Arhgef25" 239 | ## [37] "E2f6" "Sox3" "Maml1" "Fgfr2" "Itpr1" "Col11a1" 240 | ## [43] "E2f7" "Wnt8b" "Rspo3" "Ece2" "Pvrl2" "Trps1" 241 | ## [49] "Sstr2" "Alcam" "Gusb" "Pms1" "Prdm5" "Adnp2" 242 | ## [55] "Brca1" "Tmed3" "Chrna3" "Tfap2c" "Slc17a7" "Neurod1" 243 | ## [61] "Pcp4" "Gpc3" "Dach2" "Emx1" "Plxna4" "Slc17a6" 244 | ## [67] "Lmcd1" "Hey1" "Neurod6" "Cbln4" "Nhlh1" "Mterfd3" 245 | ## [73] "Jag1" "Nfia" "Neurog2" "Otx1" "Nr2e1" "Gja1" 246 | ## [79] "Nfib" 247 | ## [1] 46.269150 33.333690 36.567550 43.529290 39.490660 4.262908 248 | ## [7] 8.896505 8.525134 4.538585 3.559675 1.706482 2.031702 249 | ## [13] 3.470824 -13.618640 -10.710390 -11.571220 -10.222250 -13.846990 250 | ## [19] -14.866400 -10.873710 -13.592140 -10.873710 -10.536760 -14.745630 251 | ## [25] -10.729080 -13.930490 -13.497870 -15.512460 -10.121080 -12.389600 252 | ## [31] -12.564100 -12.581410 -18.819190 -14.993110 -13.670190 -14.581960 253 | ## [37] -15.541410 -13.765250 -11.367430 -15.630220 -12.992810 -16.152790 254 | ## [43] -15.471790 -13.603560 -16.766470 -15.890320 -15.800040 -13.813750 255 | ## [49] -15.438890 -13.633170 -12.820600 -15.986360 -11.733540 -16.435410 256 | ## [55] -15.805290 -17.051630 -15.105520 -17.051630 -10.657270 -18.071020 257 | ## [61] -15.476210 -15.661550 -13.066740 -16.680950 -16.124910 -17.236980 258 | ## [67] -15.476210 -15.012850 -17.514990 -13.437430 -16.773620 -17.144310 259 | ## [73] -15.012850 -11.213300 -17.144310 -14.642160 -15.568880 -18.979180 260 | ## [79] -61.692200 261 | ``` 262 | 263 | ```r 264 | gpsect3D <- structurePlot(cids, gp3D, gannot3D, plot=F) 265 | plotSlice(vol3D, s2, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 266 | plotSliceComp(gpsect3D, s, add=T) 267 | ``` 268 | 269 | ![plot of chunk proximal distal placement](figures/pagoda-proximal distal placement-1.png) 270 | 271 | Gene expression signatures for top subpopulation split in neuroprogenitor cells identified by `pagoda`. 272 | 273 | 274 | ```r 275 | gl1 <- c("Kif23", "Rad51", "Pole", "Mcm10", "Pabpc4l", "Pola1", "Ifi30", "Tmem97", "Cdc6", "Cdca5", "Gins2", "Prdx1", "Ticrr", "Car14", "Mis18bp1", "Kntc1", "Cdc45", "Wee1", "Poc1a", "Mgme1", "Ncaph", "Exo1", "Isyna1", "Rad54b", "Shmt1", "Sgol1", "Shcbp1", "Vcam1", "Bora", "Hmgb2", "Cenpn", "Esco2", "Espl1", "Pole2", "BC030867", "Zfp367", "Sox3", "Pus3", "Ndc80", "Pold1", "2810408I11Rik", "Lpar1", "Lhfpl2", "Ccnf", "Gpx7", "BC055324", "Megf10", "Fgfbp3", "Cdt1", "2700099C18Rik", "Arhgef39", "Suv39h2", "Trps1", "Clspn", "Siva1", "Gulp1", "Setdb2", "Rpa2", "Wwtr1", "Ak4", "Ing5", "Crip1", "Orc1", "Acrbp", "Arhgap31", "Rad50", "Rragb", "Med26", "Samhd1", "Lpcat1", "Dhx32", "Mms22l", "B330016D10Rik", "Clu", "Gm11627", "Dctd", "Dleu2", "Atad5", "Fgfr2", "Pxdn", "H2afz", "Ran", "Tyms", "Kbtbd11", "Hist1h1b", "Ercc6l", "Syde2", "D3Ertd751e", "2810417H13Rik", "Scml2", "Kif2c", "Kif22", "Depdc1a", "Tmem98", "Tyro3", "Ccdc77", "Adat1", "Tk1", "Sfxn5", "BC052040", "Mybl2", "Sox2", "Gm3893", "Ptpru", "Fn1", "Npm1", "Mad2l1", "Fbxo30", "Etl4", "Rpsa", "Aif1l", "Hmgn2", "Lrrc1", "Cad", "Hes1", "Hmgb1", "Msrb2", "Ogfod3", "Cluh", "Hells", "Diap3", "Gapdh", "Cenph", "Kif14", "Thoc3", "Dusp16", "Rev1", "9430015G10Rik", "Traf3", "Exosc8", "Rad51ap1", "Cdk2", "Ppic", "Neil3", "Tom1l1", "Prr14", "Xpo4", "Tgfb2", "Arhgap17", "Igflr1", "Gpx8", "Paics", "Hirip3", "Gen1", "Polq", "Fbxo5", "Uck1", "Tcf7l2", "Mipep", "Dnaaf2", "0610007N19Rik", "Actn1", "Atp5sl", "Pla2g12a", "Cdca7", "Scd1", "Tuba1b", "2610015P09Rik", "Mir3112", "Gtse1", "Nedd9", "Cry1", "Nasp", "Exosc7", "Iqcc", "Tmem110", "Acot1", "Grb10", "S1pr1", "Ckap2", "Coq10a", "Idi1", "Cdca7l", "Incenp", "Mettl16", "Mdk", "Haus5", "Cks1b", "Tmed5", "Pdpn", "Gpc3", "Gar1", "Igsf11", "Msh6", "Mif", "Zfp36l1", "Igfbp5", "Mns1", "Dgkd", "Sdc1", "Zfp748", "Kazn", "Prr15", "Top2a", "Etaa1", "Sapcd2", "Notch2", "Agpat3", "Gatad2a", "Nde1", "Dnajc3", "Gmds", "Psat1", "Fras1", "Cenpm", "Casc5", "Adamts6", "Zadh2", "Mt1", "Zfp579", "Mki67", "Set", "Sfrp2", "4930422G04Rik", "Zfyve21", "Ddx51", "Gas1", "Haus3", "Ect2", "Fam84b", "Cenpp", "Rlbp1", "Nmral1", "Hist1h4i", "Bmpr1b", "Chtf18", "Metrn", "Nrde2", "Lrr1", "Mir17hg", "Hspd1", "Sav1", "Fzd10", "Fndc3c1", "Slbp", "4931417G12Rik", "Hn1l", "Six5", "Enoph1", "Ccnd2", "Kif4", "Gorab", "1190002F15Rik", "Gins1", "Wnt5b", "Snap23", "Cln3", "Gm8096", "Cpped1", "Jmy", "Fam229b", "Ajuba", "Stard4") 276 | weights1 <- c(25.70137, 29.59888, 29.76567, 24.68016, 20.78329, 30.52546, 12.57898, 23.69041, 24.49737, 21.06707, 32.37425, 5.917703, 19.79369, 21.01805, 25.45902, 22.69036, 23.80137, 21.25906, 16.99061, 18.17822, 17.96696, 17.36431, 17.05992, 14.48438, 21.92231, 19.96471, 17.36249, 19.89858, 15.78619, 6.346554, 17.87554, 20.61649, 5.917697, 19.22824, 16.48714, 22.7253, 13.72571, 13.32367, 19.62173, 16.07113, 15.13676, 21.24849, 14.2775, 16.07539, 14.12963, 11.73834, 15.93613, 10.93345, 11.10596, 9.628688, 9.79836, 16.14695, 14.06795, 23.8073, 7.214335, 10.8215, 11.636, 20.89295, 8.902458, 7.897001, 17.6958, 6.402814, 9.927401, 9.585663, 8.215373, 15.92776, 8.194774, 6.135632, 10.93828, 7.952126, 16.78108, 16.1418, 2.070826, 6.528858, 9.800817, 11.02213, 9.256968, 16.95434, 12.59132, 8.249959, 2.740084, 2.878239, 4.189773, 14.78767, 18.76207, 1.33938, 5.344057, 6.081742, 6.228143, 3.545454, 9.881127, 20.20164, 3.719686, 12.51794, 11.40345, 12.55717, 7.988526, 16.67645, 8.497081, 5.096289, 2.680227, 16.3119, 3.742364, 5.846637, 17.05004, 1.718221, 10.56812, 9.421022, 14.12226, 1.699372, 17.3678, 2.077661, 0.6450837, 12.12757, 12.55257, 1.53705, 10.15608, 2.53861, 8.247943, 12.41625, 1.642412, 1.629888, 5.639646, 3.234741, 12.14668, 4.45925, 9.412865, 5.930603, 7.660363, 3.666648, 2.547089, 11.78479, 12.261, 2.025131, 4.379496, 11.31754, 1.280813, 2.444286, 5.080282, 1.151702, 4.837149, 1.957394, 10.35392, 1.138974, 1.366205, 12.28883, 1.020337, 13.09234, 6.433306, 6.510424, 9.765636, 10.70904, 1.219111, 7.532179, 5.637852, 5.4065, 1.321662, 8.798219, 1.094809, 1.092081, 0.9728729, 0.9702798, 2.048368, 2.667087, 5.972456, 3.175221, 0.2115612, 2.327173, 0.2101568, 5.848486, 0.8351951, 2.916965, 3.436796, 9.419663, 8.348403, 1.2368, 8.347702, 1.748644, 8.086359, 8.802871, 8.393264, 6.835873, 3.0586, 10.96285, 1.116587, 4.741809, 7.759272, 7.842224, 7.012087, 6.010361, 4.607943, 5.191336, 3.076776, 3.572298, 1.765293, 0.7824073, 7.956223, 7.234441, 2.122103, 5.009876, 6.250351, 0.7641022, 2.843459, 0.7556067, 6.598702, 8.607848, 4.863156, 0.09266894, 6.300077, 0.8268156, 3.471054, 0.8220918, 4.737982, 8.173211, 4.712872, 0.09035995, 5.151065, 4.966644, 5.934447, 3.802551, 7.073224, 0.4405537, 1.760735, 6.330614, 6.589453, 7.280396, 0.8713346, 5.207967, 0.4322329, 4.748665, 1.033637, 0.8578934, 0.08547415, 7.000531, 1.535777, 0.0850716, 4.053823, 0.4203083, 6.716998, 0.9235872, 6.528929, 5.439931, 3.548127, 5.280641, 0.3300401, 2.31028, 4.680702, 0.08206534, 3.604325, 6.05617, 4.008056, 3.190085, 0.6513329) 277 | gp3D <- genePlot(gl1, mat, gannot3D, plot=F, weights=weights1) 278 | ``` 279 | 280 | ``` 281 | ## [1] "Genes available:" 282 | ## [1] "Sox3" "Trps1" "Wwtr1" "Clu" "Fgfr2" "Tyro3" "Mybl2" 283 | ## [8] "Sox2" "Ptpru" "Fn1" "Hmgn2" "Hes1" "Hmgb1" "Tgfb2" 284 | ## [15] "Tcf7l2" "S1pr1" "Cdca7l" "Pdpn" "Gpc3" "Zfp36l1" "Igfbp5" 285 | ## [22] "Notch2" "Gatad2a" "Nde1" "Sfrp2" "Gas1" "Nmral1" "Bmpr1b" 286 | ## [29] "Hspd1" "Fzd10" "Six5" "Wnt5b" 287 | ## [1] "Genes not available:" 288 | ## [1] "Kif23" "Rad51" "Pole" "Mcm10" 289 | ## [5] "Pabpc4l" "Pola1" "Ifi30" "Tmem97" 290 | ## [9] "Cdc6" "Cdca5" "Gins2" "Prdx1" 291 | ## [13] "Ticrr" "Car14" "Mis18bp1" "Kntc1" 292 | ## [17] "Cdc45" "Wee1" "Poc1a" "Mgme1" 293 | ## [21] "Ncaph" "Exo1" "Isyna1" "Rad54b" 294 | ## [25] "Shmt1" "Sgol1" "Shcbp1" "Vcam1" 295 | ## [29] "Bora" "Hmgb2" "Cenpn" "Esco2" 296 | ## [33] "Espl1" "Pole2" "BC030867" "Zfp367" 297 | ## [37] "Pus3" "Ndc80" "Pold1" "2810408I11Rik" 298 | ## [41] "Lpar1" "Lhfpl2" "Ccnf" "Gpx7" 299 | ## [45] "BC055324" "Megf10" "Fgfbp3" "Cdt1" 300 | ## [49] "2700099C18Rik" "Arhgef39" "Suv39h2" "Clspn" 301 | ## [53] "Siva1" "Gulp1" "Setdb2" "Rpa2" 302 | ## [57] "Ak4" "Ing5" "Crip1" "Orc1" 303 | ## [61] "Acrbp" "Arhgap31" "Rad50" "Rragb" 304 | ## [65] "Med26" "Samhd1" "Lpcat1" "Dhx32" 305 | ## [69] "Mms22l" "B330016D10Rik" "Gm11627" "Dctd" 306 | ## [73] "Dleu2" "Atad5" "Pxdn" "H2afz" 307 | ## [77] "Ran" "Tyms" "Kbtbd11" "Hist1h1b" 308 | ## [81] "Ercc6l" "Syde2" "D3Ertd751e" "2810417H13Rik" 309 | ## [85] "Scml2" "Kif2c" "Kif22" "Depdc1a" 310 | ## [89] "Tmem98" "Ccdc77" "Adat1" "Tk1" 311 | ## [93] "Sfxn5" "BC052040" "Gm3893" "Npm1" 312 | ## [97] "Mad2l1" "Fbxo30" "Etl4" "Rpsa" 313 | ## [101] "Aif1l" "Lrrc1" "Cad" "Msrb2" 314 | ## [105] "Ogfod3" "Cluh" "Hells" "Diap3" 315 | ## [109] "Gapdh" "Cenph" "Kif14" "Thoc3" 316 | ## [113] "Dusp16" "Rev1" "9430015G10Rik" "Traf3" 317 | ## [117] "Exosc8" "Rad51ap1" "Cdk2" "Ppic" 318 | ## [121] "Neil3" "Tom1l1" "Prr14" "Xpo4" 319 | ## [125] "Arhgap17" "Igflr1" "Gpx8" "Paics" 320 | ## [129] "Hirip3" "Gen1" "Polq" "Fbxo5" 321 | ## [133] "Uck1" "Mipep" "Dnaaf2" "0610007N19Rik" 322 | ## [137] "Actn1" "Atp5sl" "Pla2g12a" "Cdca7" 323 | ## [141] "Scd1" "Tuba1b" "2610015P09Rik" "Mir3112" 324 | ## [145] "Gtse1" "Nedd9" "Cry1" "Nasp" 325 | ## [149] "Exosc7" "Iqcc" "Tmem110" "Acot1" 326 | ## [153] "Grb10" "Ckap2" "Coq10a" "Idi1" 327 | ## [157] "Incenp" "Mettl16" "Mdk" "Haus5" 328 | ## [161] "Cks1b" "Tmed5" "Gar1" "Igsf11" 329 | ## [165] "Msh6" "Mif" "Mns1" "Dgkd" 330 | ## [169] "Sdc1" "Zfp748" "Kazn" "Prr15" 331 | ## [173] "Top2a" "Etaa1" "Sapcd2" "Agpat3" 332 | ## [177] "Dnajc3" "Gmds" "Psat1" "Fras1" 333 | ## [181] "Cenpm" "Casc5" "Adamts6" "Zadh2" 334 | ## [185] "Mt1" "Zfp579" "Mki67" "Set" 335 | ## [189] "4930422G04Rik" "Zfyve21" "Ddx51" "Haus3" 336 | ## [193] "Ect2" "Fam84b" "Cenpp" "Rlbp1" 337 | ## [197] "Hist1h4i" "Chtf18" "Metrn" "Nrde2" 338 | ## [201] "Lrr1" "Mir17hg" "Sav1" "Fndc3c1" 339 | ## [205] "Slbp" "4931417G12Rik" "Hn1l" "Enoph1" 340 | ## [209] "Ccnd2" "Kif4" "Gorab" "1190002F15Rik" 341 | ## [213] "Gins1" "Snap23" "Cln3" "Gm8096" 342 | ## [217] "Cpped1" "Jmy" "Fam229b" "Ajuba" 343 | ## [221] "Stard4" 344 | ``` 345 | 346 | ```r 347 | gpsect3D <- structurePlot(cids, gp3D, gannot3D, plot=F) 348 | plotProjection(vol3D, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 349 | plotProjection(gpsect3D, t=1, add=T) 350 | plotSlice(vol3D, s2, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 351 | plotSlice(gpsect3D, s, t=1, add=T) 352 | # Top split group 2 353 | gl2 <- c("Ftl1", "Stmn3", "Rnf185", "Serinc5", "Plk3", "Nfasc", "Apc", "Khdrbs2", "1810041L15Rik", "Celsr3", "Klhdc5", "Plch2", "Tram1l1", "Plcl1", "Calcoco1", "Gm2694", "2510009E07Rik", "Srgap1", "Klf7", "Nhlh2", "Nsg2", "Tmtc4", "Nkain3", "Actr2", "Wdr83", "Ina", "Celf3", "Pak7", "Slc4a8", "Gpr19", "Fam5b", "Gpr137", "Atp6v1g1", "Shisa7", "Neurod1", "Slc35a1", "Nme3", "Fkbpl", "Apc2", "Frmd4b", "Clvs1", "Evl", "Dcc", "Kif3c", "Ank", "Mbnl2", "Tubb4a", "Brwd3", "Cacna2d1", "Sgip1", "Itm2b", "Ccser1", "Ndfip2", "Klhl29", "Yod1", "Vcan", "Ppm1a", "Hn1", "Atl1", "Fam84a", "Atp6v1f", "Atg16l1", "Rbfox1", "Pcnxl4", "Jakmip2", "Rab3d", "Stxbp1", "Tspyl4", "St8sia3", "Mon2", "Shank1", "Cabp1", "Slc27a4", "Ptprs", "Jup", "Pcdh7", "Rfx3", "Ankzf1", "Kdm6b", "Hist3h2a", "Gramd1a", "Cdk14", "Lcor", "Elavl4", "Slco5a1", "Tmem44", "Cntfr", "Ikbkb", "Ptpro", "Mfap4", "Ankrd12", "Trim46", "Atp6v1e1", "Pcp4", "Gcdh", "Necab3", "Cpeb4", "Rab3a", "Nuak1", "9330133O14Rik", "Frmd5", "Frrs1l", "Rcan2", "Prdm8", "Selk", "Cdyl2", "Dhtkd1", "Kcnq2", "Vps37c", "Actg1", "Gas8", "Rwdd3", "Sema6d", "Ypel5", "Cttnbp2", "Islr2", "Neurod6", "Cbln2", "Ncan", "Fam57b", "Atg9a", "Ppp1r14a", "Cdk5r1", "Kalrn", "Snap91", "Tanc2", "Crmp1", "Edil3", "Kif5a", "Ralgps1", "Disp2", "Ass1", "Tmsb4x", "Dbc1", "Mapre3", "Zzef1", "Gna12", "Gstm7", "Sv2b", "Tiam2", "Zfp46", "Ank3", "Calm2", "Nrn1", "Jph4", "Snap25", "Ttc3", "Oscp1", "Cntn2", "Fam49a", "Serpini1", "Rab3c", "Chst15", "Sv2a", "Dpysl3", "Sema4g", "Elavl3", "Vps13c", "Scn3a", "Nav3", "Cnr1", "Atp2b2", "Nnat", "Rufy3", "Tmsb10", "Nefm", "Tnfrsf21", "Kif21b", "Mcf2l", "Stmn1", "Gmnc", "Hecw1", "Enpp5", "L1cam", "Sorbs2", "Cdc42ep2", "Nmnat2", "Tuba1a", "Unc79", "Scn3b", "3632451O06Rik", "Pde1c", "Lrfn5", "Rtn2", "Gabrb2", "Slc17a6", "1700088E04Rik", "Trappc6a", "Psd", "Hmgcll1", "Nav1", "Tub", "Actl6b", "March8", "Pxk", "Tbr1", "Lrrc7", "Akap6", "Dscaml1", "Dnajc6", "Dopey2", "Galnt14", "Osbpl5", "Mllt11", "Sez6l2", "Nxph4", "Gabrg2", "Tubb3", "Chga", "Gdi1", "Dusp8", "Cd200", "Nrxn1", "Ralyl", "Mapk10", "Sox11", "Wnt7b", "Ndrg4", "Magel2", "Cbln4", "Dner", "Myt1l", "Dusp4", "Map2", "Syt4", "Atp1a3", "Smim18", "Ppfia2", "Plxna4", "Rtn1", "Map1b", "Snrpn", "Nrep", "Dcx", "Stmn2", "Tagln3") 354 | weights2 <- c(2.136911, 9.205157, 15.04057, 14.38306, 15.63322, 15.21329, 7.556623, 15.73863, 15.24225, 14.90353, 16.34308, 4.423723, 16.73704, 12.81987, 15.2705, 16.21419, 14.84824, 15.80225, 15.23299, 14.40521, 9.90502, 16.11969, 12.89575, 3.311071, 17.46972, 18.18689, 15.31839, 16.47549, 15.68371, 16.4865, 12.65875, 15.94118, 3.6415, 15.56466, 18.86522, 17.09324, 17.45138, 17.43719, 14.81852, 16.76695, 16.04711, 16.71587, 8.95732, 15.21574, 16.57723, 17.9463, 18.28922, 17.0956, 18.51236, 14.47279, 8.607997, 16.33777, 17.69629, 18.0779, 18.39833, 8.384968, 17.93645, 3.883598, 18.37481, 19.62326, 7.079478, 18.46066, 18.57387, 19.86684, 17.57067, 17.17134, 19.19559, 17.28012, 19.51456, 18.63038, 16.346, 11.30094, 11.65711, 3.8573, 18.27631, 19.3324, 10.47136, 19.1688, 7.534274, 12.81903, 16.9127, 17.81924, 17.61544, 10.82315, 20.32141, 19.71257, 18.33481, 19.41048, 18.02951, 20.99936, 20.16026, 18.26461, 9.186602, 21.50746, 16.10645, 22.00737, 8.978131, 21.77559, 21.36687, 20.04521, 19.50468, 21.11922, 18.66986, 17.83665, 5.94918, 16.38831, 13.5438, 18.87614, 20.60921, 4.189785, 22.75836, 23.09122, 17.50587, 11.29154, 22.14349, 22.18913, 27.94501, 22.19199, 9.658578, 21.14181, 21.52989, 21.78602, 23.19786, 24.72262, 24.1665, 20.88067, 16.71132, 24.0294, 23.02293, 20.88419, 15.83706, 16.24816, 6.450837, 23.94848, 23.94848, 25.70524, 19.99748, 26.62003, 22.178, 24.94079, 24.08407, 26.47341, 6.700568, 28.2764, 22.20154, 25.95458, 6.91906, 25.88305, 22.42306, 27.05859, 30.87535, 21.7612, 22.35798, 25.03427, 17.46535, 27.2852, 16.16853, 27.74718, 31.36692, 28.40496, 35.20579, 30.09073, 8.811513, 18.08419, 7.209913, 25.47581, 25.36688, 31.83581, 28.58641, 6.66765, 30.0685, 31.42778, 30.04373, 29.97091, 27.10214, 30.83477, 25.14173, 8.179623, 29.54644, 30.6819, 31.9696, 31.49879, 31.99548, 33.65421, 32.11973, 37.97322, 24.91364, 31.93946, 30.68069, 33.96646, 30.45905, 34.63189, 34.76243, 35.00472, 35.09193, 39.13838, 33.9888, 37.8095, 35.00221, 32.88669, 35.75556, 38.66944, 36.92484, 21.31074, 38.37572, 35.98967, 31.81786, 30.92585, 30.85406, 22.2424, 39.26337, 40.44131, 41.71698, 39.48613, 38.26427, 14.63608, 40.31382, 40.53405, 42.45989, 43.87076, 43.02692, 45.8313, 41.15421, 27.19848, 48.42665, 45.21538, 48.54704, 48.93636, 47.4931, 33.36695, 19.00539, 46.4681, 31.47316, 56.75082, 60.46812, 28.49932) 355 | gp3D <- genePlot(gl2, mat, gannot3D, plot=F, weights=weights2) 356 | ``` 357 | 358 | ``` 359 | ## [1] "Genes available:" 360 | ## [1] "Nfasc" "Apc" "Celsr3" "Klf7" "Nhlh2" "Neurod1" 361 | ## [7] "Apc2" "Evl" "Dcc" "Cacna2d1" "Klhl29" "Lcor" 362 | ## [13] "Mfap4" "Pcp4" "Rab3a" "Sema6d" "Cttnbp2" "Neurod6" 363 | ## [19] "Cbln2" "Cdk5r1" "Tiam2" "Zfp46" "Ank3" "Nrn1" 364 | ## [25] "Cntn2" "Sema4g" "Cnr1" "Nnat" "L1cam" "Pde1c" 365 | ## [31] "Gabrb2" "Slc17a6" "Psd" "Tbr1" "Dscaml1" "Nxph4" 366 | ## [37] "Gabrg2" "Tubb3" "Nrxn1" "Mapk10" "Sox11" "Wnt7b" 367 | ## [43] "Cbln4" "Dner" "Myt1l" "Plxna4" "Dcx" 368 | ## [1] "Genes not available:" 369 | ## [1] "Ftl1" "Stmn3" "Rnf185" "Serinc5" 370 | ## [5] "Plk3" "Khdrbs2" "1810041L15Rik" "Klhdc5" 371 | ## [9] "Plch2" "Tram1l1" "Plcl1" "Calcoco1" 372 | ## [13] "Gm2694" "2510009E07Rik" "Srgap1" "Nsg2" 373 | ## [17] "Tmtc4" "Nkain3" "Actr2" "Wdr83" 374 | ## [21] "Ina" "Celf3" "Pak7" "Slc4a8" 375 | ## [25] "Gpr19" "Fam5b" "Gpr137" "Atp6v1g1" 376 | ## [29] "Shisa7" "Slc35a1" "Nme3" "Fkbpl" 377 | ## [33] "Frmd4b" "Clvs1" "Kif3c" "Ank" 378 | ## [37] "Mbnl2" "Tubb4a" "Brwd3" "Sgip1" 379 | ## [41] "Itm2b" "Ccser1" "Ndfip2" "Yod1" 380 | ## [45] "Vcan" "Ppm1a" "Hn1" "Atl1" 381 | ## [49] "Fam84a" "Atp6v1f" "Atg16l1" "Rbfox1" 382 | ## [53] "Pcnxl4" "Jakmip2" "Rab3d" "Stxbp1" 383 | ## [57] "Tspyl4" "St8sia3" "Mon2" "Shank1" 384 | ## [61] "Cabp1" "Slc27a4" "Ptprs" "Jup" 385 | ## [65] "Pcdh7" "Rfx3" "Ankzf1" "Kdm6b" 386 | ## [69] "Hist3h2a" "Gramd1a" "Cdk14" "Elavl4" 387 | ## [73] "Slco5a1" "Tmem44" "Cntfr" "Ikbkb" 388 | ## [77] "Ptpro" "Ankrd12" "Trim46" "Atp6v1e1" 389 | ## [81] "Gcdh" "Necab3" "Cpeb4" "Nuak1" 390 | ## [85] "9330133O14Rik" "Frmd5" "Frrs1l" "Rcan2" 391 | ## [89] "Prdm8" "Selk" "Cdyl2" "Dhtkd1" 392 | ## [93] "Kcnq2" "Vps37c" "Actg1" "Gas8" 393 | ## [97] "Rwdd3" "Ypel5" "Islr2" "Ncan" 394 | ## [101] "Fam57b" "Atg9a" "Ppp1r14a" "Kalrn" 395 | ## [105] "Snap91" "Tanc2" "Crmp1" "Edil3" 396 | ## [109] "Kif5a" "Ralgps1" "Disp2" "Ass1" 397 | ## [113] "Tmsb4x" "Dbc1" "Mapre3" "Zzef1" 398 | ## [117] "Gna12" "Gstm7" "Sv2b" "Calm2" 399 | ## [121] "Jph4" "Snap25" "Ttc3" "Oscp1" 400 | ## [125] "Fam49a" "Serpini1" "Rab3c" "Chst15" 401 | ## [129] "Sv2a" "Dpysl3" "Elavl3" "Vps13c" 402 | ## [133] "Scn3a" "Nav3" "Atp2b2" "Rufy3" 403 | ## [137] "Tmsb10" "Nefm" "Tnfrsf21" "Kif21b" 404 | ## [141] "Mcf2l" "Stmn1" "Gmnc" "Hecw1" 405 | ## [145] "Enpp5" "Sorbs2" "Cdc42ep2" "Nmnat2" 406 | ## [149] "Tuba1a" "Unc79" "Scn3b" "3632451O06Rik" 407 | ## [153] "Lrfn5" "Rtn2" "1700088E04Rik" "Trappc6a" 408 | ## [157] "Hmgcll1" "Nav1" "Tub" "Actl6b" 409 | ## [161] "March8" "Pxk" "Lrrc7" "Akap6" 410 | ## [165] "Dnajc6" "Dopey2" "Galnt14" "Osbpl5" 411 | ## [169] "Mllt11" "Sez6l2" "Chga" "Gdi1" 412 | ## [173] "Dusp8" "Cd200" "Ralyl" "Ndrg4" 413 | ## [177] "Magel2" "Dusp4" "Map2" "Syt4" 414 | ## [181] "Atp1a3" "Smim18" "Ppfia2" "Rtn1" 415 | ## [185] "Map1b" "Snrpn" "Nrep" "Stmn2" 416 | ## [189] "Tagln3" 417 | ``` 418 | 419 | ```r 420 | gpsect3D <- structurePlot(cids, gp3D, gannot3D, plot=F) 421 | plotProjection(vol3D, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 422 | plotProjection(gpsect3D, t=1, add=T) 423 | plotSlice(vol3D, s2, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 424 | plotSlice(gpsect3D, s, t=1, add=T) 425 | # Comparison 426 | gp3D <- genePlotWeightedComp(gl1, weights1, gl2, weights2, mat, gannot3D, plot=F) 427 | ``` 428 | 429 | ``` 430 | ## [1] "Sox3" "Trps1" "Wwtr1" "Clu" "Fgfr2" "Tyro3" 431 | ## [7] "Mybl2" "Sox2" "Ptpru" "Fn1" "Hmgn2" "Hes1" 432 | ## [13] "Hmgb1" "Tgfb2" "Tcf7l2" "S1pr1" "Cdca7l" "Pdpn" 433 | ## [19] "Gpc3" "Zfp36l1" "Igfbp5" "Notch2" "Gatad2a" "Nde1" 434 | ## [25] "Sfrp2" "Gas1" "Nmral1" "Bmpr1b" "Hspd1" "Fzd10" 435 | ## [31] "Six5" "Wnt5b" "Nfasc" "Apc" "Celsr3" "Klf7" 436 | ## [37] "Nhlh2" "Neurod1" "Apc2" "Evl" "Dcc" "Cacna2d1" 437 | ## [43] "Klhl29" "Lcor" "Mfap4" "Pcp4" "Rab3a" "Sema6d" 438 | ## [49] "Cttnbp2" "Neurod6" "Cbln2" "Cdk5r1" "Tiam2" "Zfp46" 439 | ## [55] "Ank3" "Nrn1" "Cntn2" "Sema4g" "Cnr1" "Nnat" 440 | ## [61] "L1cam" "Pde1c" "Gabrb2" "Slc17a6" "Psd" "Tbr1" 441 | ## [67] "Dscaml1" "Nxph4" "Gabrg2" "Tubb3" "Nrxn1" "Mapk10" 442 | ## [73] "Sox11" "Wnt7b" "Cbln4" "Dner" "Myt1l" "Plxna4" 443 | ## [79] "Dcx" 444 | ## [1] 13.72571000 14.06795000 8.90245800 6.52885800 12.59132000 445 | ## [6] 11.40345000 2.68022700 16.31190000 5.84663700 17.05004000 446 | ## [11] 2.07766100 12.55257000 1.53705000 2.44428600 13.09234000 447 | ## [16] 0.21015680 3.43679600 8.80287100 8.39326400 4.74180900 448 | ## [21] 7.75927200 7.95622300 2.12210300 5.00987600 4.73798200 449 | ## [26] 5.15106500 1.76073500 6.58945300 1.03363700 0.08547415 450 | ## [31] 0.42030830 0.33004010 -15.21329000 -7.55662300 -14.90353000 451 | ## [36] -15.23299000 -14.40521000 -18.86522000 -14.81852000 -16.71587000 452 | ## [41] -8.95732000 -18.51236000 -18.07790000 -17.61544000 -20.99936000 453 | ## [46] -21.50746000 -21.77559000 -17.50587000 -22.14349000 -27.94501000 454 | ## [51] -22.19199000 -23.19786000 -24.94079000 -24.08407000 -26.47341000 455 | ## [56] -28.27640000 -22.42306000 -27.28520000 -35.20579000 -8.81151300 456 | ## [61] -29.97091000 -31.49879000 -32.11973000 -37.97322000 -30.68069000 457 | ## [66] -39.13838000 -35.00221000 -35.98967000 -31.81786000 -30.92585000 458 | ## [71] -41.71698000 -38.26427000 -14.63608000 -40.31382000 -43.87076000 459 | ## [76] -43.02692000 -45.83130000 -47.49310000 -56.75082000 460 | ``` 461 | 462 | ```r 463 | gpsect3D <- structurePlot(cids, gp3D, gannot3D, plot=F) 464 | plotSlice(vol3D, s2, col=colorRampPalette(c("white", "grey"),space="Lab")(100), t=8) 465 | plotSliceComp(gpsect3D, s, add=T) 466 | ``` 467 | 468 | ![plot of chunk main split and comparison](figures/pagoda-main split and comparison-1.png) ![plot of chunk main split and comparison](figures/pagoda-main split and comparison-2.png) ![plot of chunk main split and comparison](figures/pagoda-main split and comparison-3.png) ![plot of chunk main split and comparison](figures/pagoda-main split and comparison-4.png) ![plot of chunk main split and comparison](figures/pagoda-main split and comparison-5.png) 469 | --------------------------------------------------------------------------------