Last data update: 2014.03.03

R: Formats results of the enrichment test on anatomical...
makeTableR Documentation

Formats results of the enrichment test on anatomical structures.

Description

This function loads the results from the topGO test and creates an output table with organ names, fold enrichment and FDR. Data are sorted by p-value and only terms below the specified FDR cutoff are included.

Usage

makeTable(topAnatData, topAnatObject, results, cutoff = 1)

Arguments

topAnatData

A list produced by the function loadTopAnatData().

topAnatObject

An object produced by the function topAnat().

results

A result object, produced by the runtest() function of topGO.

cutoff

An FDR cutoff between 0 and 1. Only terms with FDR lower than this cutoff are included. Default is 1, meaning that all terms are included.

Value

A data frame with significantly enriched anatomical structures, sorted by p-value.

Author(s)

Julien Roux julien.roux@unil.ch.

Examples

{
 ## Launch topGO test on data loaded from Bgee
  myTopAnatData <- loadTopAnatData(species = "10090", datatype = "rna_seq")
  geneList <- as.factor(c(rep(0, times=90), rep(1, times=10)))
  names(geneList) <- c("ENSMUSG00000064370", "ENSMUSG00000064368", "ENSMUSG00000064367",
                    "ENSMUSG00000064363", "ENSMUSG00000065947", "ENSMUSG00000064360",
                    "ENSMUSG00000064358", "ENSMUSG00000064357", "ENSMUSG00000064356",
                    "ENSMUSG00000064354", "ENSMUSG00000064351", "ENSMUSG00000064345",
                    "ENSMUSG00000064341", "ENSMUSG00000029757", "ENSMUSG00000079941",
                    "ENSMUSG00000053367", "ENSMUSG00000016626", "ENSMUSG00000037816",
                    "ENSMUSG00000036781", "ENSMUSG00000022519", "ENSMUSG00000079606",
                    "ENSMUSG00000068966", "ENSMUSG00000038608", "ENSMUSG00000047473",
                    "ENSMUSG00000038542", "ENSMUSG00000025386", "ENSMUSG00000028145",
                    "ENSMUSG00000024816", "ENSMUSG00000020978", "ENSMUSG00000055373",
                    "ENSMUSG00000038155", "ENSMUSG00000046408", "ENSMUSG00000030032",
                    "ENSMUSG00000042249", "ENSMUSG00000071909", "ENSMUSG00000039670",
                    "ENSMUSG00000032501", "ENSMUSG00000054252", "ENSMUSG00000068071",
                    "ENSMUSG00000067578", "ENSMUSG00000074892", "ENSMUSG00000027905",
                    "ENSMUSG00000058216", "ENSMUSG00000078754", "ENSMUSG00000062101",
                    "ENSMUSG00000043633", "ENSMUSG00000071350", "ENSMUSG00000021639",
                    "ENSMUSG00000059113", "ENSMUSG00000049115", "ENSMUSG00000053310",
                    "ENSMUSG00000043832", "ENSMUSG00000063767", "ENSMUSG00000026775",
                    "ENSMUSG00000038537", "ENSMUSG00000078716", "ENSMUSG00000096820",
                    "ENSMUSG00000075089", "ENSMUSG00000049971", "ENSMUSG00000014303",
                    "ENSMUSG00000056054", "ENSMUSG00000033082", "ENSMUSG00000020801",
                   "ENSMUSG00000030590", "ENSMUSG00000026188", "ENSMUSG00000014301",
                    "ENSMUSG00000073491", "ENSMUSG00000014529", "ENSMUSG00000036960",
                    "ENSMUSG00000058748", "ENSMUSG00000047388", "ENSMUSG00000002204",
                    "ENSMUSG00000034285", "ENSMUSG00000109129", "ENSMUSG00000035275",
                    "ENSMUSG00000051184", "ENSMUSG00000034424", "ENSMUSG00000041828",
                    "ENSMUSG00000029416", "ENSMUSG00000030468", "ENSMUSG00000029911",
                    "ENSMUSG00000055633", "ENSMUSG00000027495", "ENSMUSG00000029624",
                    "ENSMUSG00000045518", "ENSMUSG00000074259", "ENSMUSG00000035228",
                    "ENSMUSG00000038533", "ENSMUSG00000030401", "ENSMUSG00000014602",
                    "ENSMUSG00000041827", "ENSMUSG00000042345", "ENSMUSG00000028530",
                    "ENSMUSG00000038722", "ENSMUSG00000075088", "ENSMUSG00000039629",
                    "ENSMUSG00000067567", "ENSMUSG00000057594", "ENSMUSG00000005907",
                   "ENSMUSG00000027496")
  myTopAnatObject <- topAnat(myTopAnatData, geneList)
  resFis <- runTest(myTopAnatObject, algorithm = 'elim', statistic = 'fisher')
 ## Format results
  tableOver <- makeTable(myTopAnatData, myTopAnatObject, resFis, 0.1)
}

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BgeeDB)
Loading required package: topGO
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Loading required package: graph
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: GO.db
Loading required package: AnnotationDbi
Loading required package: stats4
Loading required package: IRanges
Loading required package: S4Vectors

Attaching package: 'S4Vectors'

The following objects are masked from 'package:base':

    colMeans, colSums, expand.grid, rowMeans, rowSums


Loading required package: SparseM

Attaching package: 'SparseM'

The following object is masked from 'package:base':

    backsolve


groupGOTerms: 	GOBPTerm, GOMFTerm, GOCCTerm environments built.

Attaching package: 'topGO'

The following object is masked from 'package:IRanges':

    members

Loading required package: tidyr

Attaching package: 'tidyr'

The following object is masked from 'package:S4Vectors':

    expand

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/BgeeDB/makeTable.Rd_%03d_medium.png", width=480, height=480)
> ### Name: makeTable
> ### Title: Formats results of the enrichment test on anatomical structures.
> ### Aliases: makeTable
> 
> ### ** Examples
> 
> {
+  ## Launch topGO test on data loaded from Bgee
+   myTopAnatData <- loadTopAnatData(species = "10090", datatype = "rna_seq")
+   geneList <- as.factor(c(rep(0, times=90), rep(1, times=10)))
+   names(geneList) <- c("ENSMUSG00000064370", "ENSMUSG00000064368", "ENSMUSG00000064367",
+                     "ENSMUSG00000064363", "ENSMUSG00000065947", "ENSMUSG00000064360",
+                     "ENSMUSG00000064358", "ENSMUSG00000064357", "ENSMUSG00000064356",
+                     "ENSMUSG00000064354", "ENSMUSG00000064351", "ENSMUSG00000064345",
+                     "ENSMUSG00000064341", "ENSMUSG00000029757", "ENSMUSG00000079941",
+                     "ENSMUSG00000053367", "ENSMUSG00000016626", "ENSMUSG00000037816",
+                     "ENSMUSG00000036781", "ENSMUSG00000022519", "ENSMUSG00000079606",
+                     "ENSMUSG00000068966", "ENSMUSG00000038608", "ENSMUSG00000047473",
+                     "ENSMUSG00000038542", "ENSMUSG00000025386", "ENSMUSG00000028145",
+                     "ENSMUSG00000024816", "ENSMUSG00000020978", "ENSMUSG00000055373",
+                     "ENSMUSG00000038155", "ENSMUSG00000046408", "ENSMUSG00000030032",
+                     "ENSMUSG00000042249", "ENSMUSG00000071909", "ENSMUSG00000039670",
+                     "ENSMUSG00000032501", "ENSMUSG00000054252", "ENSMUSG00000068071",
+                     "ENSMUSG00000067578", "ENSMUSG00000074892", "ENSMUSG00000027905",
+                     "ENSMUSG00000058216", "ENSMUSG00000078754", "ENSMUSG00000062101",
+                     "ENSMUSG00000043633", "ENSMUSG00000071350", "ENSMUSG00000021639",
+                     "ENSMUSG00000059113", "ENSMUSG00000049115", "ENSMUSG00000053310",
+                     "ENSMUSG00000043832", "ENSMUSG00000063767", "ENSMUSG00000026775",
+                     "ENSMUSG00000038537", "ENSMUSG00000078716", "ENSMUSG00000096820",
+                     "ENSMUSG00000075089", "ENSMUSG00000049971", "ENSMUSG00000014303",
+                     "ENSMUSG00000056054", "ENSMUSG00000033082", "ENSMUSG00000020801",
+                    "ENSMUSG00000030590", "ENSMUSG00000026188", "ENSMUSG00000014301",
+                     "ENSMUSG00000073491", "ENSMUSG00000014529", "ENSMUSG00000036960",
+                     "ENSMUSG00000058748", "ENSMUSG00000047388", "ENSMUSG00000002204",
+                     "ENSMUSG00000034285", "ENSMUSG00000109129", "ENSMUSG00000035275",
+                     "ENSMUSG00000051184", "ENSMUSG00000034424", "ENSMUSG00000041828",
+                     "ENSMUSG00000029416", "ENSMUSG00000030468", "ENSMUSG00000029911",
+                     "ENSMUSG00000055633", "ENSMUSG00000027495", "ENSMUSG00000029624",
+                     "ENSMUSG00000045518", "ENSMUSG00000074259", "ENSMUSG00000035228",
+                     "ENSMUSG00000038533", "ENSMUSG00000030401", "ENSMUSG00000014602",
+                     "ENSMUSG00000041827", "ENSMUSG00000042345", "ENSMUSG00000028530",
+                     "ENSMUSG00000038722", "ENSMUSG00000075088", "ENSMUSG00000039629",
+                     "ENSMUSG00000067567", "ENSMUSG00000057594", "ENSMUSG00000005907",
+                    "ENSMUSG00000027496")
+   myTopAnatObject <- topAnat(myTopAnatData, geneList)
+   resFis <- runTest(myTopAnatObject, algorithm = 'elim', statistic = 'fisher')
+  ## Format results
+   tableOver <- makeTable(myTopAnatData, myTopAnatObject, resFis, 0.1)
+ }

Warning: an organ relationships file was found in the working directory and will be used as is. Please delete and rerun the function if you want the data to be updated.

Warning: an organ names file was found in the working directory and will be used as is. Please delete and rerun the function if you want the data to be updated.

Warning: a gene to organs mapping file was found in the working directory and will be used as is. Please delete and rerun the function if you want the data to be updated.

Parsing the results...............................................

Adding BGEE:0 as unique root of all terms of the ontology.........

Done.

Checking topAnatData object.........

Checking gene list..................
Warning: Some genes in your gene list have no expression data in Bgee, and will not be included in the analysis.  92  genes in background will be kept.

Building 'most specific' Terms......  ( 20 Terms found. )

Build DAG topology..................  ( 192 terms and 322 relations. )

Annotating nodes (Can be long)......  ( 92 genes annotated to the nodes. )

			 -- Elim Algorithm -- 

		 the algorithm is scoring 192 nontrivial nodes
		 parameters: 
			 test statistic: fisher
			 cutOff: 0.01

	 Level 19:	1 nodes to be scored	(0 eliminated genes)

	 Level 18:	3 nodes to be scored	(0 eliminated genes)

	 Level 17:	4 nodes to be scored	(0 eliminated genes)

	 Level 16:	9 nodes to be scored	(0 eliminated genes)

	 Level 15:	9 nodes to be scored	(0 eliminated genes)

	 Level 14:	11 nodes to be scored	(0 eliminated genes)

	 Level 13:	19 nodes to be scored	(0 eliminated genes)

	 Level 12:	23 nodes to be scored	(0 eliminated genes)

	 Level 11:	26 nodes to be scored	(0 eliminated genes)

	 Level 10:	24 nodes to be scored	(0 eliminated genes)

	 Level 9:	21 nodes to be scored	(0 eliminated genes)

	 Level 8:	7 nodes to be scored	(0 eliminated genes)

	 Level 7:	7 nodes to be scored	(0 eliminated genes)

	 Level 6:	9 nodes to be scored	(0 eliminated genes)

	 Level 5:	9 nodes to be scored	(0 eliminated genes)

	 Level 4:	2 nodes to be scored	(0 eliminated genes)

	 Level 3:	4 nodes to be scored	(0 eliminated genes)

	 Level 2:	3 nodes to be scored	(0 eliminated genes)

	 Level 1:	1 nodes to be scored	(0 eliminated genes)

Warning: there was no significant term at a FDR threshold of 0.1 

> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>