#### Perform gene expression enrichment analysis on 13 test genes in five developmental
#### stages of the human brain using the hypergeometric test implemented in FUNC[5]
## create input vector with test genes
genes=rep(1,13)
names(genes)=c('NCAPG', 'APOL4', 'NGFR', 'NXPH4', 'C21orf59', 'CACNG2', 'AGTR1', 'ANO1',
'BTBD3', 'MTUS1', 'CALB1', 'GYG1', 'PAX2')
## run enrichment analysis
res=aba_enrich(genes,dataset='5_stages',cutoff_quantiles=c(0.5,0.7,0.9),n_randsets=100)
## get expression data for the first 10 brain structures of the enrichment analysis output
get_expression(res$results$structure_id[1:10],background=FALSE)
## plot this expression with dendrogram
plot_expression(res$results$structure_id[1:10],dendro=TRUE,age_category=1)
## plot expression from the 10 highest scoring brain structures
## in age category 3 without dendrogram
plot_expression(res$results[res$results$age_category==3,'structure_id'][1:10],
dendro=FALSE,age_category=3)
## get the full name of a structure given the structure id
get_name('Allen:10657')
## get ids of the substructers of 'Allen:10208' that have expression data annotated
get_sampled_substructures('Allen:10208')
## get ids of the superstructers of 'Allen:10208'
get_superstructures('Allen:10208')
#### Perform gene expression enrichment analysis on 15 test genes in the adult human brain
#### using the wilcoxon rank test implemented in FUNC[5]
## create input vector with random scores associated with the test genes (using entrez-Ids)
genes=sample(1:50,15)
names(genes)=c(324,8312,673,1029,64764,1499,3021,3417,3418,8085,3845,9968,5290,5727,5728)
## run enrichment analysis
res=aba_enrich(genes,dataset='adult',test='wilcoxon',cutoff_quantiles=c(0.2,0.5,0.8),
n_randsets=100)
## plot expression from the 10 highest scoring brain structures without dendrogram
plot_expression(res$results$structure_id[1:10],dendro=FALSE)
#### Explore expression data idependently from enrichment analysis
## get expression data for six genes in the brain structure 'Allen:4010'
get_expression(structure_ids=c('Allen:4010'),gene_ids=c(324,8312,673,1029,64764,1499),
dataset='adult')
## plot this expression
plot_expression(structure_ids=c('Allen:4010'),gene_ids=c(324,8312,673,1029,64764,1499),
dataset='adult')
## 'Allen:4010' apparently was not sampled directly
## get the names of the substructures that provide expression data for 'Allen:4010'
get_name(get_sampled_substructures('Allen:4010'))
## plot expression data of six genes in two brain regions
## from children (3-11 yrs, age_category 3)
plot_expression(structure_ids=c('Allen:10657','Allen:10208'),
gene_ids=c('ENSG00000168036', 'ENSG00000157764', 'ENSG00000182158', 'ENSG00000147889',
'ENSG00000103126', 'ENSG00000134982'),dataset='5_stages',dendro=FALSE, age_category=3)
## get developmental effect scores of six genes in two brain regions
get_expression(structure_ids=c('Allen:10657','Allen:10208'), gene_ids=c('ENSG00000168036',
'ENSG00000157764', 'ENSG00000182158', 'ENSG00000147889'),dataset='dev_effect')
Run the code above in your browser using DataLab