Learn R Programming

FIT (version 0.0.6)

predict: Predicts gene expressions using pretrained models.

Description

Predicts gene expressions using pretrained models.

Usage

predict(models, attribute, weather)

Arguments

models

A list of trained models for the genes of interest.

At the moment the collection of trained models returned by FIT::train() cannot be directly passed to FIT::predict(): the user has to explicitly convert it to an appropriate format by using FIT::train.to.predict.adaptor(). (This restriction might be removed in a future.)

attribute

An object that represents the attributes of microarray/RNA-seq data. The object can be created from a dumped/saved dataframe of size nsamples * nattributes using FIT::load.attribute(). (At the moment it is an instance of a hidden class IO$Attribute, but this may be subject to change.)

weather

An object that represents actual or hypothetical weather data with which predictions of gene expressions are made. The object can be created from a dumped/saved dataframe of size ntimepoints * nfactors using FIT::load.weather(). (At the moment it is an instance of a hidden class IO$Weather, but this may be subject to change.)

Value

A list of prediction results as returned by the models.

Examples

Run this code
# NOT RUN {
# prepare models
# NOTE: FIT::train() returns a nested list of models
#   so we have to flatten it using FIT::train.to.predict.adaptor()
#   before passing it to FIT::predict().
models <- FIT::train(..)
models.flattened <- FIT::train.to.predict.adaptor(models)

# load data used for prediction
prediction.attribute  <- FIT::load.attribute('attribute.2009.txt')
prediction.weather    <- FIT::load.weather('weather.2009.dat', 'weather')
prediction.expression <- FIT::load.expression('expression.2009.dat', 'ex', genes)

prediction.results <- FIT::predict(models.flattened,
                                   prediction.attribute,
                                   prediction.weather)
# }

Run the code above in your browser using DataLab