glmPred2nt {mseq}R Documentation

predict using iterative glm with dinucleotide composition

Description

Predict the log preferences using the trained iterative glm model with dinucleotide composition.

Usage

glmPred2nt(train.glm, newdata)

Arguments

train.glm the trained iterative glm model
newdata the new data

Value

the predicted log preferences. a numeric vector.

Examples

 # read and expand the data
 data(g1_part) # for real data, please use read.csv, like g1 <- read.csv("g1.csv")
 data <- expData2nt(g1_part, 2, 1) # In real datasets, surrounding sequences should be set longer.
 
 # train and predict by Poisson linear model
 train.data <- data[data$index < 6, ]
 test.data <- data[data$index >= 6, ]
 train.glm <- iterGlm2nt(train.data)
 pred.pref <- exp(glmPred2nt(train.glm, test.data))

[Package mseq version 1.1 Index]