## Run the function to fit P-splines on a subset of genotypes.
subGenoVator <- c("G160", "G151")
fit.spline <- fitSpline(inDat = spatCorrectedVator,
trait = "EffpsII_corr",
genotypes = subGenoVator,
knots = 50)
## Extract the tables of predicted values and P-spline coefficients.
predDat <- fit.spline$predDat
coefDat <- fit.spline$coefDat
## The coefficients are then used to tag suspect time courses
outVator <- detectSerieOut(corrDat = spatCorrectedVator,
predDat = predDat,
coefDat = coefDat,
trait = "EffpsII_corr",
genotypes = subGenoVator,
thrCor = 0.9,
thrPca = 30,
thrSlope = 0.7)
## Replace the outliers by NA in the corrected data.
spatCorrectedVatorOut <- removeSerieOut(dat = spatCorrectedVator,
serieOut = outVator)
## Only replace the slope outliers by NA in the corrected data.
spatCorrectedVatorOut2 <- removeSerieOut(dat = spatCorrectedVator,
serieOut = outVator,
reason = "slope")
## Replace the outliers by NA in the corrected data.
## Replace both the corrected value and the raw trait value by NA.
spatCorrectedVatorOut3 <-
removeSerieOut(dat = spatCorrectedVator,
serieOut = outVator,
traits = c("EffpsII", "EffpsII_corr"))
Run the code above in your browser using DataLab