collapse-methods: collapse

Description Arguments Details Value collapse,LumiBatch and column collapse,LumiBatch and Missing values Author(s) Examples

Description

collapse a dataset to have just 1 row per unique value of key.

Arguments

x

an object

decreasing

logical: should the sort order be increasing or decreasing?

na.last

for controlling the treatment of NAs. If TRUE, missing values in the data are put last; if FALSE, they are put first; if NA, they are removed.

FUN

a function used to determine which row to include, when there are multiple rows with the same 'column' value. eg mean, min, max, var, sd, mad, prod

column

the column name within x which contains the keys. see details

...

arguments passed to FUN

Details

given an object with data, and 1 'key' column, containing possibly non-unique identifiers, create a result, which has unique values for those keys. The 'key' column could be a gene symbol, and each row could be a probe; the goal is to convert a 1-row-per-probe table into 1-row-per-gene.

Value

something

collapse,LumiBatch and column

The column should be the name of a column found in the fData(x) slot. hint: colnames(fData(x)), or fvarLabels(x)

collapse,LumiBatch and Missing values

Often some probes don't have a genesymbol, and should thus have an NA in this column. na.list controls what to do with the gene-less probes. na.last=TRUE keeps the probes & moves them to the bottom of the result. na.last=FALSE keeps the probes & leaves them in the sorted order specified by FUN. Note this is different to other implementations of na.last. na.last=NA (default) discards these probes from the result.

Author(s)

Mark Cowley

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
 load("Rmisc/x.averaged.RDa.gz")
	tmp <- collapse(x.averaged, FUN=var, decreasing=TRUE, na.last=FALSE, "SymbolReannotated")

## End(Not run)

if( require(lumi) ) {
  data(example.lumi)
  ex <- example.lumi[1:20, ]
  featureData(ex)$GeneSymbol <- c("TP53", "BRCA1", "BRCA2", "KRAS", "SMAD4")
  collapsed <- collapse(ex, TRUE, NA, mean, "GeneSymbol")
  collapsed
}

drmjc/microarrays documentation built on May 15, 2019, 2:26 p.m.