# smoothExp

From smoothMiner v0.1-10
by Vince Carey

##### smooth gene expression trajectories in an ExpressionSet, using a phenoData variable as the domain

smooth gene expression trajectories in an ExpressionSet, using a phenoData variable as the domain

- Keywords
- models

##### Usage

```
smoothExp(eset, phenovar, keepAt = NULL, fitter = mgcv::gam,
fmla = y ~ s(x, k = 9, fx = TRUE), retain =
c("gcv.ubre", "sig2", "coefficients"), igran = 50,
exclind = NULL, dogcv.locfit = FALSE, maxna = 5, pv =
varfitRanpart(fitter, fmla))
smoothExpFull(eset, phenovar, fitter, fmla=y ~ s(x, k = 9, fx=TRUE))
```

##### Arguments

- eset
- instance of
`ExpressionSet`

- phenovar
- string naming a phenoData variable in
`eset`

that will serve as the domain of the expression trajectory function - keepAt
- sequence of values of domain variable at which fitted values are to be computed and saved
- fitter
- R function that will fit a model given a
formula as supplied in
`fmla`

- fmla
- A formula object that will serve as a template;
variable
`y`

is bound to expression values, and`x`

is bound to domain values - retain
- names of extra components of the fitted model object to be extracted and saved
- igran
- granularity of the iteration count report (string
emitted if
`options()$verbose`

is TRUE - dogcv.locfit
- set to TRUE to obtain the locfit gcv estimate
- exclind
- if
`pv`

is`varpredFIX`

a fixed set of test point indices is specified in this vector; leave NULL otherwise - maxna
- numeric threshold, maximum number of NA values of expression permitted; if there are more, the gene is skipped
- pv
- predictive variance plugin -- accepts a closure

##### Details

This function iterates over all features in an ExpressionSet instance, fitting smooth models for expression as a function of some phenodata variable, typically a time measure. The objective is to support a ``drop-in'' interface, so that alternate smoothing technologies may be incorporated.

##### Value

- a list with one element per gene with components
`origx`

,`origy`

,`newx`

,`preds`

and`extras`

for the`retain`

components, and`locfit.gcv`

if`dogcv.locfit`

is set.

##### Note

A related function `smoothExpFull`

is available
that retains the full fitted model object -- this can
be very unwieldy but has good downstream functionality;
arbitrary predictions can be obtained, for example.

##### Examples

```
data(yccalp)
okp = options()
options(verbose=TRUE)
dem = smoothExp( yccalp[1:20,], "minutes", keepAt=seq(0,120,5), igran=5)
plot(dem[[1]])
dem2 = smoothExp( yccalp[1:20,], "minutes", keepAt=seq(0,120,5),
fitter=locfit::locfit, fmla=y~lp(x,nn=.4),dogcv.locfit=TRUE, igran=5)
plot(dem2[[1]])
dem3 = smoothExp( yccalp[1:20,], "minutes", keepAt=seq(0,120,5),
fitter=locfit::locfit, fmla=y~lp(x,nn=.4),dogcv.locfit=FALSE,
exclind=c(3,6,9,12,15), pv=varfitFIX(locfit::locfit,
y~lp(x,nn=.4), c(3,6,9,12,15)), igran=5)
plot(dem3[[1]])
pv2 = gcvs(dem2) # get locfit gcv est
pv3 = extract(dem3, "predvar") # use the fixed test points est
ipar = par(no.readonly=TRUE)
par(mfrow=c(2,2))
plot(pv2,pv3)
pv3
bes3 = names(sort(pv3))[1]
plot(dem2[[bes3]], main="full data fit")
plot(dem3[[bes3]], main="leave 5 out fit, x=test point")
par(ipar)
options(okp)
```

*Documentation reproduced from package smoothMiner, version 0.1-10, License: Artistic-2.0*

### Community examples

Looks like there are no examples yet.