cpa_getOTW: Obtain the Optimal Time Window (OTW)

Description Usage Arguments Details Value Author(s) References Examples

View source: R/cpa_getOTW.R

Description

Perform Change Point Analysis (CPA) on genotype adjusted means or G-BLUEs time series of a trait

Usage

1

Arguments

data

Numeric Matrix of dimension (N_genotype x N_days) containing the G-BLUEs of a particular trait. The data colnmanes must be in Date compatible format 'dd-mm-yyyy'.

h2

Numeric vector of dimension (N_days) containing the heritability estimates on each day for the trait

Details

Entire temporal data set is partitioned into windows based on the differences in the distribution of trait heritability and phenotypic separability using a change point analysis procedure defined by Matteson et al. (2014).

Value

Return:

Matrix Genotype adjusted means within the Optimal Time Window or the duration within an experiment with maximum genotypic and phenotypic diversity.

Author(s)

Soumyashree Kar, Vincent Garin

References

Matteson, D.S. and James, N.A. (2014). A nonparametric approach for multiple change point analysis of multivariate data. Journal of the American Statistical Association, 109(505), pp.334-345.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
data(SG_PH_data)
SG_PH_data$col_f <- factor(SG_PH_data$col)
SG_PH_data$row_f <- factor(SG_PH_data$row)

SG_PH_data$rep <- factor(SG_PH_data$rep)
SG_PH_data$block <- factor(SG_PH_data$block)

exp_des_data = SG_PH_data[, c("row", "col", "row_f", "col_f","genotype",
                              "rep", "block")]

## Not run: 

op <- SpaTemHTP_proc(exp_des_data, pheno_data = SG_PH_data[, 6:28],
                     out_det = TRUE, miss_imp = TRUE, sp_adj = TRUE,
                     random = ~ rep +  rep:block + row_f + col_f,
                     h2_comp = TRUE, plot = TRUE)
                     
data <- op$G_BLUES

# make sure data colnmanes are dd-mm-yyyy Date format compatible
dates <- substr(colnames(data), 2, nchar(colnames(data)))
dates <- str_replace_all(string = dates, pattern = '\\.', replacement = '-')
colnames(data) <- dates

h2 <- op$h2

OTW <- cpa_getOTW(data = data, h2 = h2)


## End(Not run)

ICRISAT-GEMS/SpaTemHTP documentation built on March 9, 2021, 12:12 a.m.