The BrainCell R package provides functions to test query gene sets in the context of brain and neurodevelopment

BrainH represents gene sets expression pattern across brain regions during development and post-natal life using the GSE25219 dataset. The acronyms for brain regions and the numeration of lifetime periods were previously designated by Kang et al. and are used to label the heatmaps.

CellTax represents gene sets expression pattern across cortical cell types using the GSE71585 dataset. The cell type nomenclature were designated by Tasic et al. and are used to label the heatmaps.

CellFET tests gene sets for enrichment in brain cell type marker genes for Ependymal cells, Oligodendrocytes, Microglial cells, Pyramidal neurons from CA1 area, Interneuron, Endothelial cells, Pyramidal neurons from S1 area, Astrocytes and Mural cells (as designated by Zeisel et al.)

DNMFET tests gene sets for enrichment in deleterious de novo mutations ascertained from patients with neurodevelopmental disorder (EE= Epileptic Encephalopathy, ASD= Autism Spectrum Disorder, ID=Intellectual Disability, SCZ= Schizophrenia, combined= EE+ASD+ID+SCZ, DDD= Developmental disorder from the DDD study) as previously described by Johnson et al.


You can install the BrainCell package from github.



In addition to this, you would need to install all package dependencies. They are downloadable from CRAN (



The query gene sets need to be a list of character vectors of human ENSEMBL gene ID. In the example we run the function for CLtest, a list of two gene sets: the first gene set "M30" contains 320 genes and the second "M18" contains 149 genes.

 #[1] "list"   "vector"
 #[1] "M30" "M18"
 #[1] 320
 #"ENSG00000183527" "ENSG00000145526" "ENSG00000119946" "ENSG00000151849" "ENSG00000184524" "ENSG00000081148"
 #[1] 149

If we create a new folder "/BrainCellH_test_outputs" for outputs and save its path as "testpath"

 system(paste0("mkdir ",getwd(),"/BrainCellH_test_outputs"))

We run the BrainCell functions

 BrainH(clusterslist = CLtest, outpath = testpath, runName = "test")

BrainH function produces a pdf test_BrainHeatmap.pdf

 CellTax(clusterslist = CLtest, outpath = testpath, runName = "test")

CellTax function produces a pdf test_CellTaxonomyHeatmap.pdf

 resC=CellFET(clusterslist = CLtest, runName = "test")
 resD=DNMFET(clusterslist = CLtest, runName = "test")

CellFET and DNMFET functions need to be adressed to a results R object (here, resC and resD). These results R objects are a list of matrices with one matrice for each cell type tested in CellFET function, and for each phenotype tested in DNMFET function.

The following code will produce .txt files to have a overview of the results: test_cellFET.txt and test_DNMFET.txt

 # to save the CellFET outputs in .txt file
 allT<- resC[[1]]
      for (ccl in 2:length(resC)){
           allT<- rbind(allT,resC[[ccl]])
 write.table(allT, sep = '\t', file =paste0(testpath,'/test_cellFET.txt'), row.names = TRUE, quote = FALSE, col.names = NA)

 # to save the DNMFET outputs in .txt file
 allT<- resD[[1]]
      for (ccl in 2:length(resD)){
           allT<- rbind(allT,resD[[ccl]])
 write.table(allT, sep = '\t', file =paste0(testpath,'/test_DNMFET.txt'), row.names = TRUE, quote = FALSE, col.names = NA)


Please cite Delahaye-Duriez et al. 2016 Genome Biology


adelahay/BrainCell documentation built on May 10, 2019, 5:53 a.m.