This function removes duplicates row names from an expression set, summarizing them with a function of the users choice.
The "absMax" function located in package "reb" we have found to be useful.
Usage
aggregateExprs(x, package = "hgu133plus2", using = "ENTREZID", FUN, ...)
Arguments
x
expression data - matrix, eSet, or ExpressionSet
package
annotation package of expression data
using
format type that gene IDs are converted to
FUN
function by which to summarize duplicated values
...
extra parameters passed on to FUN
Value
A matrix of expression data with the rows aggregated to a unique format chosen by the user.
The new identifiers of the returned matrix are those specified with the "using" argument.
To see possible values, use the ls() command illustrated below in the examples.
Author(s)
Kyle Furge <kyle.furge@vai.org> and Karl Dykema <karl.dykema@vai.org>
Examples
if (require(hgu95av2.db) & require(annaffy)) {
library(annaffy)
data(aafExpr)
class(exprs(aafExpr))
exprs(aafExpr)[1:4, 1:4]
#list possible values for the "using" argument
ls(pos=which(search()=="package:hgu95av2.db"))
convert <- aggregateExprs(exprs(aafExpr),"hgu95av2.db",FUN=mean,na.rm=TRUE)
convert[1:4,1:4]
}
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(PGSEA)
Loading required package: GO.db
Loading required package: AnnotationDbi
Loading required package: stats4
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: 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: 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: KEGG.db
KEGG.db contains mappings based on older data because the original
resource was removed from the the public domain before the most
recent update was produced. This package should now be considered
deprecated and future versions of Bioconductor may not have it
available. Users who want more current data are encouraged to look
at the KEGGREST or reactome.db packages
Loading required package: annaffy
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/PGSEA/aggregateExprs.Rd_%03d_medium.png", width=480, height=480)
> ### Name: aggregateExprs
> ### Title: Aggregate expression data
> ### Aliases: aggregateExprs
> ### Keywords: datasets
>
> ### ** Examples
>
> if (require(hgu95av2.db) & require(annaffy)) {
+ library(annaffy)
+ data(aafExpr)
+ class(exprs(aafExpr))
+ exprs(aafExpr)[1:4, 1:4]
+
+ #list possible values for the "using" argument
+ ls(pos=which(search()=="package:hgu95av2.db"))
+
+ convert <- aggregateExprs(exprs(aafExpr),"hgu95av2.db",FUN=mean,na.rm=TRUE)
+ convert[1:4,1:4]
+ }
Loading required package: hgu95av2.db
Loading required package: org.Hs.eg.db
Ctrl 1 Ctrl 2 Ctrl 3 Ctrl 4
100505761 6.321550 6.087082 6.308172 6.359439
10098 2.422148 2.434130 2.668644 2.169154
10138 3.215181 3.299501 3.443626 3.364141
10277 5.748689 5.779519 5.756394 6.082581
>
>
>
>
>
> dev.off()
null device
1
>