### Estimate parameters for fitted P-splines.
## Run the function to fit P-splines on a subset of genotypes.
subGeno <- c("G160", "G151")
fit.spline <- fitSpline(inDat = spatCorrectedVator,
trait = "EffpsII_corr",
genotypes = subGeno,
knots = 50)
## Estimate the maximum value of the predictions at the beginning of the time course.
## The spline was fitted at a timePoints scale, i.e. date-time so
## timeMin and timeMax should be given at this scale as well.
paramVator <- estimateSplineParameters(x = fit.spline,
estimate = "predictions",
what = "max",
timeMin = 1527784620,
timeMax = 1528500000,
genotypes = subGeno)
head(paramVator)
## Create a boxplot of the estimates.
plot(paramVator, plotType = "box")
## Estimate the minimum and maximum value of the predictions.
paramVator2 <- estimateSplineParameters(x = fit.spline,
estimate = "predictions",
what = c("min", "max"),
genotypes = subGeno)
head(paramVator2)
### Estimate parameters for fitted HDM-splines.
## The data from the Phenovator platform have been corrected for spatial
## trends and outliers for single observations have been removed.
## We need to specify the genotype-by-treatment interaction.
## Treatment: water regime (WW, WD).
spatCorrectedArch[["treat"]] <- substr(spatCorrectedArch[["geno.decomp"]],
start = 1, stop = 2)
spatCorrectedArch[["genoTreat"]] <-
interaction(spatCorrectedArch[["genotype"]],
spatCorrectedArch[["treat"]], sep = "_")
## Fit P-Splines Hierarchical Curve Data Model for selection of genotypes.
fit.psHDM <- fitSplineHDM(inDat = spatCorrectedArch,
trait = "LeafArea_corr",
genotypes = c("GenoA14_WD", "GenoA51_WD",
"GenoB11_WW", "GenoB02_WD",
"GenoB02_WW"),
time = "timeNumber",
pop = "geno.decomp",
genotype = "genoTreat",
plotId = "plotId",
difVar = list(geno = FALSE, plot = FALSE),
smoothPop = list(nseg = 4, bdeg = 3, pord = 2),
smoothGeno = list(nseg = 4, bdeg = 3, pord = 2),
smoothPlot = list(nseg = 4, bdeg = 3, pord = 2),
weights = "wt",
trace = FALSE)
## Estimate minimum, maximum, and mean for predictions at the genotype level.
## The spline was fitted at the timeNumber scale, so timeMax
## should be given at that scale as well.
paramArch <- estimateSplineParameters(x = fit.psHDM,
what = c("min", "max", "mean"),
fitLevel = "geno",
estimate = "predictions",
timeMax = 28)
head(paramArch)
## Create a boxplot of the estimates.
plot(paramArch, plotType = "box")
## Estimate area under the curve for predictions at the plot level.
paramArch2 <- estimateSplineParameters(x = fit.psHDM,
what = "AUC",
fitLevel = "plot",
estimate = "predictions")
head(paramArch2)
Run the code above in your browser using DataLab