Last data update: 2014.03.03
R: Fit a Probe Level Model to Affymetrix Genechip Data.
Fit a Probe Level Model to Affymetrix Genechip Data.
Description
This function converts an
AffyBatch
into an
PLMset
by fitting a specified robust linear model to the
probe level data.
Usage
fitPLM(object,model=PM ~ -1 + probes +samples,
variable.type=c(default="factor"),
constraint.type=c(default="contr.treatment"),
subset=NULL,
background=TRUE, normalize=TRUE, background.method="RMA.2",
normalize.method="quantile", background.param=list(),
normalize.param=list(), output.param=verify.output.param(),
model.param=verify.model.param(object, model),
verbosity.level=0)
Arguments
object
an AffyBatch
model
A formula describing the model to fit. This is slightly
different from the standard method of specifying formulae in R. Read
the description below
variable.type
a way to specify whether variables in the model
are factors or standard variables
constraint.type
should factor variables sum to zero or have
first variable set to zero (endpoint constraint)
subset
a vector with the names of probesets to be used. If NULL
then all probesets are used.
normalize
logical value. If TRUE
normalize data using
quantile normalization
background
logical value. If TRUE
background correct
using RMA background correction
background.method
name of background method to use.
normalize.method
name of normalization method to use.
background.param
A list of parameters for background routines
normalize.param
A list of parameters for normalization
routines
output.param
A list of parameters controlling optional output
from the routine.
model.param
A list of parameters controlling model procedure
verbosity.level
An integer specifying how much to print
out. Higher values indicate more verbose. A value of 0 will print nothing
Details
This function fits robust Probe Level linear Models to all the probesets in
an AffyBatch
. This is carried out
on a probeset by probeset basis. The user has quite a lot of control
over which model is used and what outputs are stored. For more details
please read the vignette.
Value
An PLMset
Author(s)
Ben Bolstad bmb@bmbolstad.com
References
Bolstad, BM (2004) Low Level Analysis of High-density
Oligonucleotide Array Data: Background, Normalization and
Summarization . PhD Dissertation. University of California,
Berkeley.
See Also
expresso
,
rma
, threestep
Examples
if (require(affydata)) {
data(Dilution)
Pset <- fitPLM(Dilution, model=PM ~ -1 + probes + samples)
se(Pset)[1:5,]
image(Pset)
NUSE(Pset)
#now lets try a wider class of models
## Not run: Pset <- fitPLM(Dilution,model=PM ~ -1 + probes +liver,
normalize=FALSE,background=FALSE)
## End(Not run)
## Not run: coefs(Pset)[1:10,]
## Not run: Pset <- fitPLM(Dilution,model=PM ~ -1 + probes + liver +
scanner, normalize=FALSE,background=FALSE)
## End(Not run)
coefs(Pset)[1:10,]
#try liver as a covariate
logliver <- log2(c(20,20,10,10))
## Not run: Pset <- fitPLM(Dilution, model=PM~-1+probes+logliver+scanner,
normalize=FALSE, background=FALSE, variable.type=c(logliver="covariate"))
## End(Not run)
coefs(Pset)[1:10,]
#try a different se.type
## Not run: Pset <- fitPLM(Dilution, model=PM~-1+probes+scanner,
normalize=FALSE,background=FALSE,m odel.param=list(se.type=2))
## End(Not run)
se(Pset)[1:10,]
}
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(affyPLM)
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: affy
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: gcrma
Loading required package: preprocessCore
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/affyPLM/fitPLM.Rd_%03d_medium.png", width=480, height=480)
> ### Name: fitPLM
> ### Title: Fit a Probe Level Model to Affymetrix Genechip Data.
> ### Aliases: fitPLM
> ### Keywords: manip
>
> ### ** Examples
>
> if (require(affydata)) {
+ data(Dilution)
+ Pset <- fitPLM(Dilution, model=PM ~ -1 + probes + samples)
+ se(Pset)[1:5,]
+
+ image(Pset)
+ NUSE(Pset)
+
+ #now lets try a wider class of models
+ ## Not run:
+ ##D Pset <- fitPLM(Dilution,model=PM ~ -1 + probes +liver,
+ ##D normalize=FALSE,background=FALSE)
+ ## End(Not run)
+ ## Not run: coefs(Pset)[1:10,]
+
+ ## Not run:
+ ##D Pset <- fitPLM(Dilution,model=PM ~ -1 + probes + liver +
+ ##D scanner, normalize=FALSE,background=FALSE)
+ ## End(Not run)
+ coefs(Pset)[1:10,]
+
+ #try liver as a covariate
+ logliver <- log2(c(20,20,10,10))
+ ## Not run:
+ ##D Pset <- fitPLM(Dilution, model=PM~-1+probes+logliver+scanner,
+ ##D normalize=FALSE, background=FALSE, variable.type=c(logliver="covariate"))
+ ## End(Not run)
+ coefs(Pset)[1:10,]
+
+ #try a different se.type
+ ## Not run:
+ ##D Pset <- fitPLM(Dilution, model=PM~-1+probes+scanner,
+ ##D normalize=FALSE,background=FALSE,m odel.param=list(se.type=2))
+ ## End(Not run)
+ se(Pset)[1:10,]
+ }
Loading required package: affydata
Package LibPath Item
[1,] "affydata" "/home/ddbj/local/lib64/R/library" "Dilution"
Title
[1,] "AffyBatch instance Dilution"
20A 20B 10A 10B
1000_at 0.03798884 0.03674159 0.03947771 0.03526104
1001_at 0.05850398 0.05889818 0.05917896 0.05606087
1002_f_at 0.06684381 0.06552410 0.06373685 0.06468718
1003_s_at 0.06114870 0.05960099 0.06161744 0.06088377
1004_at 0.05008044 0.04901129 0.04981253 0.04707150
1005_at 0.03306727 0.03260940 0.03616108 0.03333392
1006_at 0.06250004 0.05937301 0.05909922 0.05929328
1007_s_at 0.03227312 0.03123055 0.03342962 0.03165328
1008_f_at 0.03742424 0.03946406 0.03788041 0.03814034
1009_at 0.02842615 0.02861797 0.03055512 0.02849441
Warning messages:
1: replacing previous import 'AnnotationDbi::tail' by 'utils::tail' when loading 'hgu95av2cdf'
2: replacing previous import 'AnnotationDbi::head' by 'utils::head' when loading 'hgu95av2cdf'
>
>
>
>
>
> dev.off()
null device
1
>