TS_select: Select a part of the (G-BLUEs) time series

Description Usage Arguments Details Value Author(s) Examples

View source: R/TS_select.R

Description

Return a selection of a part of the G-BLUEs time series showing some optimal properties in terms of internal consistency and heritability.

Usage

1
TS_select(data, h2, method = "CPA", interval = 0)

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

method

Character string indicating which method to choose to select the elements of the time series. Must be either 'CPA', or 'h2_opt'. Default = 'CPA'.

interval

Numeric value defining the number of day before and after the day with the largest heritability that are returned. Default = 0.

Details

If method = 'CPA', the functions determine time windows using a change point analysis and return the time window with the largest heritability. If method = 'h2_opt', the function return the TS data at the date where the heritability is the maximum +/- interval days.

Value

List with the following items:

if method = 'CPA'

TS_sel

Numeric matrix with the genotype trait values within the OTW with the highest heritability.

if method = 'h2_opt'

TS_sel

Vector of the genotype trait values at the date with the highest heritability or numeric matrix with the genotype trait values at the day with the highest heritability with optionally +/- interval days.

Author(s)

Vincent Garin, Soumyashree Kar

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

TS_sel <- TS_select(data = data, h2 = h2)


## End(Not run)

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