Learn R Programming

mapfuser (version 0.1.2)

predict.mapfuser: Predict centiMorgan positions from fitted gam models on the mapfuser object

Description

Takes a fitted thin plate regression spline produced by gam() and produces predictions of centi Morgan positions using known physical genome positions and fitted gam models.

Usage

# S3 method for mapfuser
predict(object, to_predict, ...)

Arguments

object

A mapfuser object with fitted gam models

to_predict

A csv file with columns marker, chromosome ID and position in mega base pairs.

...

ingored in function call

Value

A data frame with columns "Marker", "Chr", "Position", and "Position_physical"

Examples

Run this code
# NOT RUN {
# Read a table with positions to interpolate and/or extrapolate
fpath <- system.file("extdata", package="mapfuser")
to_predict <- read.table(paste0(fpath, "/BaySha_physical.csv"), sep = ",", header = TRUE)
MF.obj <- predict(MF.obj, to_predict)
# Write to csv
write.table(MF.obj$predictions, file = "preds.csv", sep = ",", col.names = TRUE, row.names = FALSE)
# }

Run the code above in your browser using DataLab