From 97fd0b90ba19fd059832c5afbd7f21c647e21699 Mon Sep 17 00:00:00 2001 From: Weverton Gomes Date: Tue, 7 Jan 2025 17:21:07 -0300 Subject: [PATCH] update about.html, license.html, phenotype.html --- docs/about.html | 276 ++-- docs/license.html | 228 +-- docs/phenotype.html | 3284 +++++++++++++++---------------------------- 3 files changed, 1458 insertions(+), 2330 deletions(-) diff --git a/docs/about.html b/docs/about.html index 893fc04..c6f4e57 100644 --- a/docs/about.html +++ b/docs/about.html @@ -11,11 +11,11 @@ - + About - + @@ -64,7 +64,7 @@ - - - @@ -321,69 +318,6 @@ - - - @@ -393,16 +327,6 @@
- -
-
-
-
-
- -
- - @@ -456,7 +410,7 @@

2023-10-27

@@ -467,8 +421,8 @@

2023-10-27

  • Checks - +class="glyphicon glyphicon-exclamation-sign text-danger" +aria-hidden="true">
  • Past versions @@ -477,13 +431,13 @@

    2023-10-27

    -Last updated: 2023-10-27 +Last updated: 2025-01-07

    Checks: 7 +class="glyphicon glyphicon-ok text-success" aria-hidden="true"> 6 0 +aria-hidden="true"> 1

    Knit directory: @@ -507,18 +461,21 @@

    2023-10-27

    -
    -

    Great! Since the R Markdown file has been committed to the Git -repository, you know the exact version of the code that produced these -results.

    +

    The R Markdown file has unstaged changes. To know which version of +the R Markdown file created these results, you’ll want to first commit +it to the Git repo. If you’re still working on the analysis, you can +ignore this warning. When you’re finished, you can run +wflow_publish to commit the R Markdown file and build the +HTML.

    @@ -609,15 +566,15 @@

    2023-10-27

    @@ -627,7 +584,7 @@

    2023-10-27

    The results in this page were generated with repository version -02143bc. +5b6a406. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

    @@ -647,59 +604,121 @@

    2023-10-27

    Ignored: data/allchrAR08.txt Untracked files: - Untracked: GETGV.RDS - Untracked: data/Article.docx - Untracked: data/Article2.docx + Untracked: ETA_1_ScaleBayesA.dat + Untracked: ETA_1_parBayesB.dat + Untracked: analysis/figure/ + Untracked: analysis/mixed_models.Rmd Untracked: data/Articles/ + Untracked: data/Phenotyping2.xlsx + Untracked: data/Tabela auxiliar.xlsx + Untracked: data/data.rar + Untracked: mu.dat Untracked: output/BLUPS2.csv - Untracked: output/BLUPS3.csv + Untracked: output/BLUPS_GEBV_GETG_all clones.csv + Untracked: output/BLUPS_density_med.png + Untracked: output/BLUPS_density_med_row_col.png Untracked: output/BLUPS_drgBLUPs__boxplot_med.png + Untracked: output/BLUPS_drgBLUPs__boxplot_med_row_col.png Untracked: output/BLUPS_drgBLUPs_density_med.png Untracked: output/BLUPS_drgBLUPs_med.png Untracked: output/BLUPS_par_mmer.Rdata + Untracked: output/BLUPS_row_col.csv + Untracked: output/BLUPS_row_col_random.csv + Untracked: output/BLUPS_x_BLUPS_row_col_boxplot_med.png + Untracked: output/Density_residual_row_col.tiff Untracked: output/Figuras_article.rar - Untracked: output/GD_matrix.csv - Untracked: output/GEBVS_G_BLUP_BGLR.RDS + Untracked: output/GEBVS_BayesA.RDS + Untracked: output/GEBVS_BayesB.RDS + Untracked: output/GEBVS_DOM.RDS + Untracked: output/GEBVS_G_BLUP.RDS + Untracked: output/GEBVS_G_BLUP_row_col.RDS + Untracked: output/GEBVS_G_BLUP_row_col_random.RDS + Untracked: output/GEBVS_RF.RDS + Untracked: output/GEBVS_RKHS.RDS Untracked: output/GEBVS_RR_BLUP.RDS - Untracked: output/GEBVxBLUPS.tiff - Untracked: output/GEBVxGETV.tiff - Untracked: output/GEBVxGETV2.tiff - Untracked: output/G_matrix.csv + Untracked: output/GEBV_BLUP.csv + Untracked: output/GEBV_DOMxBLUPS.tiff + Untracked: output/GEBV_GBLUPxBLUPS.tiff + Untracked: output/GEBVxGETGV.tiff + Untracked: output/GETGVxBLUPS.tiff Untracked: output/G_matrix.rds Untracked: output/H2.csv - Untracked: output/Tabelas.xlsx + Untracked: output/H2_row_col.csv + Untracked: output/H2_row_col_random.csv + Untracked: output/Heatmap.tiff + Untracked: output/MSPE_all_methods.tiff + Untracked: output/Residuals_vs_fitted_row_col.tiff Untracked: output/accuracy_all_methods.tiff + Untracked: output/accuracy_all_methods_points.tiff + Untracked: output/cor_GEBVxBLUPS.tiff + Untracked: output/cor_GEBVxBLUPS_all_methods.tiff Untracked: output/correlation_blups.tiff Untracked: output/density_blups.tiff + Untracked: output/dierencial_selecao.csv + Untracked: output/dierencial_selecao.xlsx Untracked: output/drgBLUP.csv + Untracked: output/fitted_residual_data_row_col_random.csv + Untracked: output/fitted_values_row_col_random.csv + Untracked: output/indice_selection.tiff Untracked: output/indice_selection3.tiff + Untracked: output/indice_selection_GEBV.tiff + Untracked: output/indice_selection_GEBV_GETGV.tiff + Untracked: output/indice_selection_GETGV.tiff Untracked: output/kappa.tiff + Untracked: output/kappa2.tiff Untracked: output/mean_pheno.csv - Untracked: output/result_mixed_model.RData - Untracked: output/result_mixed_model2.RData - Untracked: output/result_mixed_model3.RData + Untracked: output/medias_semestre.xlsx + Untracked: output/pesos_BLUPS_all clones.csv + Untracked: output/pesos_GEBVS_all clones.csv + Untracked: output/pesos_GETGVS_all clones.csv + Untracked: output/pheno_mean_sd.csv + Untracked: output/residuos_row_col_random.csv Untracked: output/result_sommer.RData - Untracked: output/results_cv_BayesA.csv - Untracked: output/results_cv_BayesB.csv - Untracked: output/results_cv_DOM.csv - Untracked: output/results_cv_GETGV.csv - Untracked: output/results_cv_G_BLUP.csv - Untracked: output/results_cv_G_BLUP2.csv - Untracked: output/results_cv_G_BLUP_BGRL.csv - Untracked: output/results_cv_G_BLUP_BLUPS2.csv - Untracked: output/results_cv_G_BLUP_BLUPS3.csv - Untracked: output/results_cv_G_BLUP_sommer.csv - Untracked: output/results_cv_RF.csv - Untracked: output/results_cv_RKHS.csv - Untracked: output/results_cv_RR_BLUP.csv + Untracked: output/result_sommer_row_col.RData + Untracked: output/result_sommer_row_col_random.RDS + Untracked: output/results_MSPE.csv + Untracked: output/results_accuracy.csv + Untracked: output/results_cv_BayesA.RDS + Untracked: output/results_cv_BayesB.RDS + Untracked: output/results_cv_DOM.RDS + Untracked: output/results_cv_G_BLUP.RDS + Untracked: output/results_cv_G_BLUP_row_col.RDS + Untracked: output/results_cv_G_BLUP_row_col_random.RDS + Untracked: output/results_cv_RF.RDS + Untracked: output/results_cv_RKHS.RDS + Untracked: output/results_cv_RR_BLUP.RDS + Untracked: output/results_h2_GBLUP (1).rds + Untracked: output/results_h2_GBLUP.csv + Untracked: output/results_h2_GBLUP.rds + Untracked: output/results_h2_GBLUP_D.rds Untracked: output/results_kappa.csv Untracked: output/results_kappa2.csv + Untracked: output/results_values-selection.csv + Untracked: output/results_values_kappa.csv + Untracked: output/results_values_rescale_selection.csv + Untracked: output/results_values_selection.csv + Untracked: output/rstudio-export.zip + Untracked: output/teste_LRT.csv + Untracked: output/teste_LRT_row_col.csv + Untracked: output/teste_LRT_row_col_random.csv Untracked: output/varcomp.tiff Untracked: output/varcomp2.csv + Untracked: output/varcomp_row_col.csv + Untracked: output/varcomp_row_col.tiff + Untracked: output/varcomp_row_col_random.csv + Untracked: output/varcomp_row_col_random.tiff + Untracked: varE.dat Unstaged changes: - Deleted: data/Genomic Selection for Drought Tolerance Using Genome-Wide SNPs in Maize.pdf + Modified: README.md + Modified: analysis/GWS.Rmd + Modified: analysis/_site.yml + Modified: analysis/index.Rmd + Modified: analysis/license.Rmd + Modified: analysis/phenotype.Rmd + Modified: data/SNPs.rds Deleted: data/convet_haplo_diplo.txt + Modified: data/pheno_clean.csv Deleted: output/BLUPS.RDS Modified: output/BLUPS.csv Deleted: output/BLUPS_Multi.csv @@ -715,10 +734,35 @@

    2023-10-27

    Deleted: output/media_pheno_Multi.csv Deleted: output/resultMM.Rdata Deleted: output/result_G_BLUP.csv - Modified: output/results_cv.csv + Deleted: output/results_cv.csv Modified: output/varcomp.csv Deleted: output/varcomp_multi.csv +Staged changes: + New: Artigo GS tolerancia a seca_revised.rar + New: Artigo GS tolerancia a seca_revised/Costa et al_FPS_2024 manuscript.docx + New: Artigo GS tolerancia a seca_revised/Costa et al_FPS_2024 manuscript_revised.docx + New: Artigo GS tolerancia a seca_revised/Costa et al_FPS_2024 supplement.docx + New: Artigo GS tolerancia a seca_revised/Figure 1.tiff + New: Artigo GS tolerancia a seca_revised/Figure 2.tiff + New: Artigo GS tolerancia a seca_revised/Figure 3.tiff + New: Artigo GS tolerancia a seca_revised/Figure 4.tiff + New: Artigo GS tolerancia a seca_revised/GWS.Rmd + New: Artigo GS tolerancia a seca_revised/phenotype.Rmd + New: Artigo GS tolerancia a seca_revised/response to reviewers.docx + New: Seleção Genômica deficit hidrico.pptx + New: data/Article.docx + New: data/Article2.docx + New: data/Costa et al_FPS_2024 manuscript eng.docx + New: data/Costa et al_FPS_2024 manuscript eng_v1.docx + New: data/Costa et al_FPS_2024 manuscript eng_v2.docx + New: data/Costa et al_FPS_2024 manuscript eng_v3.docx + New: data/Costa et al_FPS_2024 manuscript.docx + New: data/Costa et al_FPS_2024 supplement.docx + New: data/Frontiers_Template.docx + Deleted: data/Genomic Selection for Drought Tolerance Using Genome-Wide SNPs in Maize.pdf + New: data/Supplementary_Material.docx +

    Note that any generated files, e.g. HTML, png, CSS, etc., are not @@ -765,6 +809,23 @@

    2023-10-27

    +html + + +c64a991 + + +Weverton Gomes + + +2023-10-27 + + +add phenotype html + + + + Rmd @@ -923,29 +984,30 @@

    2023-10-27

    -
    -

    Data and libraries

    +
    +

    Libraries

    Load Libraries

    library(kableExtra)
     library(tidyverse)
    -require(ComplexHeatmap)
    -library(data.table)
    -library(readxl)
    -library(metan)
    -library(DataExplorer)
    -library(ggthemes)
    -library(GGally)
    -library(furrr)
    -library(future)
    -plan(multisession)
    +#if (!require("BiocManager", quietly = TRUE))
    +#    install.packages("BiocManager")
    +#BiocManager::install("ComplexHeatmap")
    +require(ComplexHeatmap)
    +library(data.table)
    +library(readxl)
    +library(metan)
    +library(DataExplorer)
    +library(ggthemes)
    +library(GGally)
     theme_set(theme_bw())
    -
    -

    Data import and manipulation

    +
    +
    +

    Data import and manipulation

    Let’s import the phenotypic dataset, excluding the traits without information and the traits Local (redundant with Year) and Treatment (only one observation).

    -
    pheno <- read_excel("data/Phenotyping.xlsx", na = "NA") %>%
    -  select_if( ~ !all(is.na(.))) %>%  # Deleting traits without information 
    +
    pheno <- read_excel("data/Phenotyping2.xlsx", na = "NA") %>%
    +  select_if(~ !all(is.na(.))) %>%  # Deleting traits without information
       select(-c("Local", "Tratamento"))

    We will perform some manipulations to adjust our database and to facilitate the visualization of the exploratory analysis.

    @@ -954,16 +1016,19 @@

    Data import and manipulation

    into factors. After that, let’s create the trait ANo.Bloco for nesting in the model to obtain the BLUPs.

    pheno <- pheno %>%
    -  mutate(Clone = as.factor(Clone),
    -         Ano = as.factor(Ano),
    -         Bloco = as.factor(Bloco))   # Convert Clone, Ano,Bloco in factors
    -
    + mutate( + Clone = as.factor(Clone), + Ano = as.factor(Ano), + Bloco = as.factor(Bloco), + row = as.factor(row), + col = as.factor(col) + ) # Convert Clone, Ano, row, col and Bloco in factors

    Exploratory Data Analysis

    Introductory analysis of the entire dataset

    -
    introduce(pheno) %>% 
    -  t() %>% 
    +
    introduce(pheno) %>%
    +  t() %>%
       kbl(escape = F, align = 'c') %>%
       kable_classic(
         "hover",
    @@ -986,7 +1051,7 @@ 

    Exploratory Data Analysis

    columns -27 +29 @@ -994,7 +1059,7 @@

    Exploratory Data Analysis

    discrete_columns -3 +6 @@ -1002,7 +1067,7 @@

    Exploratory Data Analysis

    continuous_columns -24 +23 @@ -1034,7 +1099,7 @@

    Exploratory Data Analysis

    total_observations -63072 +67744 @@ -1042,7 +1107,7 @@

    Exploratory Data Analysis

    memory_usage -516592 +534240 @@ -1061,8 +1126,8 @@

    Year Analysis

    pheno2 <- pheno %>%
       count(Ano, Clone)
     
    -genmat <- model.matrix(~ -1 + Clone, data = pheno2)
    -envmat <- model.matrix(~ -1 + Ano, data = pheno2)
    +genmat <- model.matrix( ~ -1 + Clone, data = pheno2)
    +envmat <- model.matrix( ~ -1 + Ano, data = pheno2)
     genenvmat <- t(envmat) %*% genmat
     genenvmat_ch <- ifelse(genenvmat == 1, "Present", "Abscent")
     
    @@ -1112,29 +1177,28 @@ 

    Year Analysis

    -
    rm(pheno2, genmat, envmat, genenvmat, genenvmat_ch)

    From the heatmap, it is clear that the year 2016 has very few observations. So, we must eliminate it.

    -
    pheno <- pheno %>% 
    -  filter(Ano != 2016) %>% 
    -  droplevels()
    +
    pheno <- pheno %>%
    +  filter(Ano != 2016) %>%
    +  droplevels()

    Just for reference, let’s re-view the clone heatmap by year.

    -
    pheno2<- pheno %>% 
    -  count(Ano, Clone)
    -  
    -genmat = model.matrix( ~ -1 + Clone, data = pheno2)
    -envmat = model.matrix( ~ -1 + Ano, data = pheno2)
    -genenvmat = t(envmat) %*% genmat
    -genenvmat_ch = ifelse(genenvmat == 1, "Present", "Abscent")
    -
    -Heatmap(
    -  genenvmat_ch,
    -  col = c("white", "tomato"),
    -  show_column_names = F,
    -  heatmap_legend_param = list(title = ""),
    -  column_title = "Genotypes",
    -  row_title = "Environments"
    -)
    +
    pheno2 <- pheno %>%
    +  count(Ano, Clone)
    +
    +genmat = model.matrix(~ -1 + Clone, data = pheno2)
    +envmat = model.matrix(~ -1 + Ano, data = pheno2)
    +genenvmat = t(envmat) %*% genmat
    +genenvmat_ch = ifelse(genenvmat == 1, "Present", "Abscent")
    +
    +Heatmap(
    +  genenvmat_ch,
    +  col = c("white", "tomato"),
    +  show_column_names = F,
    +  heatmap_legend_param = list(title = ""),
    +  column_title = "Genotypes",
    +  row_title = "Environments"
    +)

    -
    rm(pheno2, genmat, envmat, genenvmat, genenvmat_ch)

    We can check how many clones we have in common between the years and also note that the years differ in the number of clones evaluated:

    -
    pheno2<- pheno %>% 
    -  count(Ano, Clone)
    -  
    -genmat = model.matrix( ~ -1 + Clone, data = pheno2)
    -envmat = model.matrix( ~ -1 + Ano, data = pheno2)
    -genenvmat = t(envmat) %*% genmat
    -
    -genenvmat %*% t(genenvmat) %>%
    -  kbl(escape = F,
    -      align = 'c') %>%
    -  kable_classic(
    -    "hover",
    -    full_width = F,
    -    position = "center",
    -    fixed_thead = T
    -  )
    +
    +

    Table 1 - Year of evaluation and number of genotypes +evaluated

    +
    pheno2 <- pheno %>%
    +  count(Ano, Clone)
    +
    +genmat = model.matrix(~ -1 + Clone, data = pheno2)
    +envmat = model.matrix(~ -1 + Ano, data = pheno2)
    +genenvmat = t(envmat) %*% genmat
    +
    +genenvmat %*% t(genenvmat) %>%
    +  kbl(escape = F, align = 'c') %>%
    +  kable_classic(
    +    "hover",
    +    full_width = F,
    +    position = "center",
    +    fixed_thead = T
    +  )
    @@ -1282,27 +1348,27 @@

    Year Analysis

    -
    rm(pheno2, genmat, envmat, genenvmat)
    +
    rm(pheno2, genmat, envmat, genenvmat, genenvmat_ch)

    The year 2020 has a lower number of clones in common, however, we will keep it for the analysis.

    Here, it is possible to observe that our dataset has clones that were evaluated in just one year. Let’s visualize this, to see how many clones were evaluated according to the number of years.

    -
    pheno %>%
    -  count(Ano, Clone) %>% 
    -  count(Clone) %>%
    -  count(n) %>%
    -  kbl(
    -    escape = F,
    -    align = 'c',
    -    col.names = c("N of Environment", "N of genotypes")
    -  ) %>%
    -  kable_classic(
    -    "hover",
    -    full_width = F,
    -    position = "center",
    -    fixed_thead = T
    -  )
    +
    pheno %>%
    +  count(Ano, Clone) %>%
    +  count(Clone) %>%
    +  count(n) %>%
    +  kbl(
    +    escape = F,
    +    align = 'c',
    +    col.names = c("N of Environment", "N of genotypes")
    +  ) %>%
    +  kable_classic(
    +    "hover",
    +    full_width = F,
    +    position = "center",
    +    fixed_thead = T
    +  )
    Storing counts in `nn`, as `n` already present in input
     ℹ Use `name = "new_name"` to pick a new name.
    @@ -1357,446 +1423,352 @@

    Year Analysis

    mixed models via REML in the analysis is the most suitable for obtaining BLUPs.

    +

    Analysis of traits

    -

    Now, we will analyze the frequency for each discrete feature.

    -
    plot_bar(pheno, ncol = 4)
    -

    -

    Mite Incidence and Flowering have little information for some levels -and many NA’s, we will also exclude these traits.

    -
    pheno <- pheno  %>% 
    -  select(-c(Incidence_Mites, Flowering))
    -

    Let’s just look at the missing values now, to check the -proportions.

    -
    plot_missing(pheno)
    -

    -

    - -

    -
    -
    -
    +

    Inicialmente, iremos verificar as estatísticas descritivas para cada +coluna.

    +
    summary(pheno) %>%
    +  t() %>%
    +  kbl(escape = F, align = 'c') %>%
    +  kable_classic(
    +    "hover",
    +    full_width = F,
    +    position = "center",
    +    fixed_thead = T
    +  )
    +
    - - - - - - - - - - - - -
    -Version + -Author + -Date +
    -bf7b1d3 - -WevertonGomesCosta - -2022-11-11 -
    -
    -
    -

    We have a high missing value ratio for Vigor, Leaf_Lenght, -Canopy_Width and Canopy_Lenght, I’ll exclude those too.

    -
    pheno <- pheno %>% 
    -  select(-c(Vigor, Leaf_Lenght, Canopy_Width, Canopy_Lenght))
    -

    Let’s check the distribution of traits by year now and let’s look at -the histograms of the quantitative traits:

    -
    plot_histogram(pheno, ncol = 5)
    -

    -

    - -

    -
    -
    - - - - - - + - - - - - - - - - -
    -Version + -Author + -Date + +
    -bf7b1d3 - -WevertonGomesCosta - -2022-11-11 -
    -
    -
    -

    For Branching, Leaf.Ret, Mite, PltArc, Stand6MAP and Staygreen don’t -have normal distribution. To get the BLUPs we will have to remove that -traits from the database.

    -
    pheno <- pheno %>% 
    -  select(-c(Branching, Leaf.Ret, Mite, PltArc, Stand6MAP, Staygreen))
    -
    -
    -

    Analisys of Clone

    -

    First, let’s check the amount of missing values for each clone by -year. We are filtering the Clones with the average bigger than 2 missing -values by year.

    -
    pheno2 <- pheno %>% 
    -  select(-Bloco) %>% 
    -  group_by(Clone, Ano) %>% 
    -  summarise_all(.funs = list(~sum(is.na(.)))) %>% 
    -  ungroup() %>% 
    -  select_numeric_cols() %>%
    -  mutate(mean = rowMeans(.),
    -         Clone.Ano = unique(interaction(pheno$Clone, pheno$Ano))) %>%
    -  filter(mean > 2) %>%
    -  droplevels()
    -
    -nlevels(pheno2$Clone.Ano) %>% 
    -  kbl(
    -    escape = F,
    -    align = 'c',
    -    col.names = c("N of genotypes")
    -  ) %>%
    -  kable_classic(
    -    "hover",
    -    full_width = F,
    -    position = "center",
    -    fixed_thead = T
    -  )
    - - - - - - -
    -N of genotypes
    -54 -
    -
    rm(pheno2)
    -

    54 clones presented many missing values, i.e., they were evaluated in -less than two blocks by year. Therefore, they should be excluded from -future analyses, according to the year.

    -

    Let’s evaluate the descriptive statistics of the combination between -clone and year for the traits.

    -
    ge_details(pheno, Ano, Clone, resp = everything()) %>% 
    -  t() %>% 
    -kbl(escape = F, align = 'c') %>%
    -  kable_classic(
    -    "hover",
    -    full_width = F,
    -    position = "center",
    -    fixed_thead = T
    -  )
    - - - + + + - - - + + + + + + - - - + + + + + + - - - + + + + + + - - - + + + @@ -1804,1907 +1776,1306 @@

    Analisys of Clone

    StC + + + - - - + + + + + + - - - + + + + + + - - -
    -Parameters +Clone -Mean +BGM-0164: 16 -SE +BGM-0170: 16 -SD +BGM-0396: 16 -CV +BGM-1243: 16 -Min +BGM-1267: 16 -Max +BGM-0134: 12 -MinENV +(Other) :2204 +
    +Ano -MaxENV +2017:660 -MinGEN +2018:552 -MaxGEN +2019:532
    -N_Roots + +2020:552 -4.29 +NA -0.06 +NA -2.51 +NA +
    +Bloco -58.56 +1:574 -0.12 (BGM-1031 in 2017) +2:574 -15.67 (2012-107-002 in 2019) +3:574 -2018 (1.62) +4:574 -2019 (5.76) +NA -BGM-0411 (0.33) +NA -2012-107-002 (11.33) +NA
    -FRY +row -4.95 +11 : 121 -0.09 +3 : 120 -4.04 +10 : 120 -81.79 +2 : 119 -0.12 (BGM-0886 in 2017) +6 : 118 -22.2 (BGM-1267 in 2018) +4 : 117 -2017 (2.75) +(Other):1581 +
    +col -2020 (6.52) +6 : 131 -BGM-1488 (0.34) +4 : 130 -IAC-14 (14.07) +8 : 130
    -ShY + +2 : 128 -14.23 +5 : 128 -0.22 +9 : 128 -10.16 +(Other):1521 +
    +N_Roots -71.45 +Min. : 0.125 -0.69 (BGM-0996 in 2017) +1st Qu.: 2.333 -61.17 (BGM-2124 in 2020) +Median : 4.000 -2017 (8.47) +Mean : 4.293 -2020 (25.87) +3rd Qu.: 6.000 -BGM-0048 (1.52) +Max. :15.667 -BGM-2124 (54.33) +NA’s :322
    -DMC +FRY -29.06 +Min. : 0.116 -0.17 +1st Qu.: 1.857 -6.1 +Median : 3.750 -21 +Mean : 4.946 -11.98 (BGM-0626 in 2020) +3rd Qu.: 6.857 -48.34 (BGM-1015 in 2020) +Max. :22.200 -2020 (26.21) +NA’s :335 +
    +ShY -2018 (35.38) +Min. : 0.694 -BGM-0626 (14.98) +1st Qu.: 6.944 -BGM-1015 (45.02) +Median :11.167
    -StY + +Mean :14.228 -1.52 +3rd Qu.:18.714 -0.04 +Max. :61.167 -1.27 +NA’s :211 +
    +DMC -84.01 +Min. :11.98 -0.02 (BGM-0340 in 2019) +1st Qu.:25.00 -8.87 (BGM-0396 in 2018) +Median :28.80 -2019 (1.32) +Mean :29.06 -2018 (1.84) +3rd Qu.:32.78 -BGM-0089 (0.06) +Max. :48.34 -BGM-1023 (4.76) +NA’s :968
    -Plant.Height +StY -1.19 +Min. :0.0154 -0.01 +1st Qu.:0.5494 -0.33 +Median :1.2068 -27.43 +Mean :1.5164 -0.36 (BGM-0426 in 2020) +3rd Qu.:2.1092 -3.03 (BR-11-24-156 in 2020) +Max. :8.8669 -2017 (1) +NA’s :978 +
    +Plant.Height -2019 (1.48) +Min. :0.3600 -Jatobá (0.58) +1st Qu.:0.9633 -BGM-1200 (1.91) +Median :1.1600
    -HI + +Mean :1.1919 -24.56 +3rd Qu.:1.3908 -0.27 +Max. :3.0333 -11.89 +NA’s :220 +
    +HI -48.42 +Min. : 1.574 -1.57 (BGM-1159 in 2017) +1st Qu.:15.726 -71.97 (BGM-1315 in 2018) +Median :23.345 -2020 (18.61) +Mean :24.556 -2018 (32.36) +3rd Qu.:31.884 -BGM-0961 (2.5) +Max. :71.967 -Mata_Fome_Branca (52.78) +NA’s :341
    -24.42 +Min. : 7.326 -0.17 +1st Qu.:20.350 -6.11 +Median :24.147 -25.05 +Mean :24.419 -7.33 (BGM-0626 in 2020) +3rd Qu.:28.160 -43.69 (BGM-1015 in 2020) +Max. :43.686 -2020 (21.56) +NA’s :968 +
    +PltArc -2018 (30.78) +Min. :1.000 -BGM-0626 (10.33) +1st Qu.:1.000 -BGM-1015 (40.37) +Median :2.000
    -Root.Le + +Mean :1.996 -23.21 +3rd Qu.:3.000 -0.13 +Max. :5.000 -5.8 +NA’s :678 +
    +Leaf.Ret -24.99 +Min. :0.3333 -7 (BGM-1574 in 2017) +1st Qu.:1.0000 -47.33 (BGM-0396 in 2018) +Median :1.3333 -2017 (19.72) +Mean :1.7796 -2019 (27.14) +3rd Qu.:2.0000 -Jatobá (8.5) +Max. :5.0000 -BGM-1956 (35.5) +NA’s :216
    -Root.Di +Root.Le -28.88 +Min. : 7.00 -0.18 +1st Qu.:19.00 -7.9 +Median :23.00 -27.35 +Mean :23.21 -6.12 (BGM-2142 in 2019) +3rd Qu.:27.00 -63.3 (BRS Mulatinha in 2018) +Max. :47.33 -2017 (24.49) +NA’s :339 +
    +Root.Di -2018 (34.74) +Min. : 6.12 -BGM-0089 (12.14) +1st Qu.:23.36 -BGM-1956 (48.91) +Median :28.17
    -Stem.D + +Mean :28.88 -2.11 +3rd Qu.:33.50 -0.01 +Max. :63.30 -0.38 +NA’s :339 +
    +Stem.D -17.9 +Min. :1.013 -1.01 (BGM-0592 in 2018) +1st Qu.:1.859 -4.37 (BRS Tapioqueira in 2020) +Median :2.101 -2018 (2.02) +Mean :2.112 -2017 (2.16) +3rd Qu.:2.362 -BGM-0048 (1.25) +Max. :4.373 -BGM-1523 (2.93) +NA’s :224
    -Nstem.Plant +Mite -2.13 +Min. :1.000 -0.03 +1st Qu.:3.000 -0.95 +Median :3.667 -44.53 +Mean :3.475 -1 (BGM-0036 in 2018) +3rd Qu.:4.000 -6.67 (BGM-0714 in 2019) +Max. :5.000 -2018 (1.44) +NA’s :222 +
    +Incidence_Mites -2019 (2.71) +Min. :1 -BGM-0066 (1) +1st Qu.:1 -BGM-0451 (4.44) +Median :1
    -

    Apparently we no longer have a genotype that could harm our analysis. -Now we must evaluate the clone-only descriptive statistics for the -traits. Some traits presented hight cv, StY and FRY, but we will go -continue.

    -
    desc_stat(pheno, by = Ano) %>%
    -  kbl(escape = F, align = 'c') %>%
    -  kable_classic(
    -    "hover",
    -    full_width = F,
    -    position = "center",
    -    fixed_thead = T
    -  )
    - - - - - - - - - - - - - - - - - - + + + - + + + - - + + + - + + + - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +
    -Ano - -variable - -cv - -max - -mean - -median - -min - -sd.amo - -se - -ci.t - -n.valid -
    -2017 +Mean :1 -DMC +3rd Qu.:1 -NA +Max. :1 --Inf +NA’s :674 +
    +Nstem.Plant -NaN +Min. :1.000 -NA +1st Qu.:1.333 -Inf +Median :2.000 -0.0000 +Mean :2.131 -NA +3rd Qu.:2.667 -NaN +Max. :6.667 -0 +NA’s :850
    -2017 + +Stand6MAP -FRY +Min. :1.000 -66.8379 +1st Qu.:4.000 -9.6700 +Median :6.000 -2.7517 +Mean :5.202 -2.4310 +3rd Qu.:7.000 -0.1160 +Max. :8.000 -1.8392 +NA’s :849 +
    +Branching -0.0743 +Min. :0.0000 -0.1459 +1st Qu.:0.0000 -613 +Median :0.3333
    -2017 +Mean :0.5911 -HI +3rd Qu.:1.0000 -48.2942 +Max. :4.0000 -66.6827 +NA’s :673 +
    +Staygreen -23.5691 +Min. :1.000 -22.7255 +1st Qu.:1.000 -1.5744 +Median :1.000 -11.3825 +Mean :1.292 -0.4612 +3rd Qu.:2.000 -0.9058 +Max. :3.000 -609 +NA’s :669
    -2017 + +Vigor -N_Roots +Mode:logical -48.8708 +TRUE:1075 -12.0000 +NA’s:1221 -4.3530 +NA -4.3330 +NA -0.1250 +NA -2.1273 +NA +
    +Flowering -0.0860 +Min. :0.0000 -0.1689 +1st Qu.:0.0000 -612 +Median :0.0000
    -2017 +Mean :0.0074 -Nstem.Plant +3rd Qu.:0.0000 -NA +Max. :1.0000 --Inf +NA’s :673 +
    +Canopy_Lenght -NaN +Min. : 10.00 -NA +1st Qu.: 54.33 -Inf +Median : 72.00 -0.0000 +Mean : 73.35 -NA +3rd Qu.: 91.67 -NaN +Max. :240.17 -0 +NA’s :1458
    -2017 - -Plant.Height + +Canopy_Width -21.0398 +Min. : 7.50 -1.6767 +1st Qu.: 56.33 -1.0023 +Median : 75.58 -1.0000 +Mean : 76.68 -0.4500 +3rd Qu.: 96.00 -0.2109 +Max. :213.33 -0.0084 - -0.0165 - -632 -
    -2017 - -Root.Di - -21.0039 - -39.6900 - -24.4889 - -24.4733 - -8.9867 - -5.1436 - -0.2077 - -0.4080 - -613 -
    -2017 - -Root.Le - -21.5823 - -31.6667 - -19.7236 - -19.6667 - -7.0000 - -4.2568 - -0.1719 - -0.3376 - -613 -
    -2017 - -ShY - -45.4973 - -22.2220 - -8.4677 - -8.0750 - -0.6940 - -3.8526 - -0.1542 - -0.3029 - -624 -
    -2017 - -StC - -NA - --Inf - -NaN - -NA - -Inf - -0.0000 - -NA - -NaN - -0 -
    -2017 - -StY - -NA - --Inf - -NaN - -NA - -Inf - -0.0000 - -NA - -NaN - -0 -
    -2017 - -Stem.D - -16.7774 - -3.3333 - -2.1581 - -2.1667 - -1.2000 - -0.3621 - -0.0144 - -0.0284 - -629 -
    -2018 - -DMC - -13.6086 - -46.0784 - -35.3819 - -36.0000 - -18.1818 - -4.8150 - -0.2785 - -0.5480 - -299 -
    -2018 - -FRY - -86.0073 - -22.2000 - -5.6640 - -4.2500 - -0.3330 - -4.8714 - -0.2776 - -0.5462 - -308 -
    -2018 - -HI - -41.5442 - -71.9673 - -32.3554 - -32.6094 - -5.8772 - -13.4418 - -0.7672 - -1.5096 - -307 -
    -2018 - -N_Roots - -63.2913 - -6.2500 - -1.6249 - -1.4085 - -0.1900 - -1.0284 - -0.0588 - -0.1157 - -306 -
    -2018 - -Nstem.Plant - -33.3849 - -3.3333 - -1.4397 - -1.3333 - -1.0000 - -0.4806 - -0.0248 - -0.0487 - -376 -
    -2018 - -Plant.Height - -28.0409 - -1.9967 - -1.0953 - -1.0600 - -0.4867 - -0.3071 - -0.0159 - -0.0313 - -373 -
    -2018 - -Root.Di - -23.3943 - -63.3033 - -34.7356 - -34.4400 - -14.1300 - -8.1262 - -0.4707 - -0.9264 - -298 -
    -2018 - -Root.Le - -27.1625 - -47.3333 - -23.6102 - -23.0000 - -9.5000 - -6.4131 - -0.3715 - -0.7311 - -298 -
    -2018 - -ShY - -69.0625 - -31.6000 - -8.7610 - -7.2000 - -1.0000 - -6.0506 - -0.3022 - -0.5940 - -401 -
    -2018 - -StC - -15.6937 - -41.4284 - -30.7820 - -31.3500 - -13.5318 - -4.8309 - -0.2794 - -0.5498 - -299 -
    -2018 - -StY - -91.8742 - -8.8669 - -1.8356 - -1.3539 - -0.0839 - -1.6864 - -0.0984 - -0.1936 - -294 -
    -2018 - -Stem.D - -22.3941 - -3.7317 - -2.0158 - -1.9785 - -1.0133 - -0.4514 - -0.0234 - -0.0460 - -372 -
    -2019 - -DMC - -13.8212 - -40.5941 - -28.2826 - -28.2828 - -15.3846 - -3.9090 - -0.1745 - -0.3428 - -502 +NA’s :1458
    -2019 - -FRY - -70.0326 - -22.2000 + +Leaf_Lenght -5.5039 +Min. : 3.750 -4.6670 +1st Qu.: 8.417 -0.1430 +Median :11.250 -3.8545 +Mean :11.676 -0.1712 +3rd Qu.:14.200 -0.3363 +Max. :32.667 -507 +NA’s :1459
    +

    We have a high missing value ratio for Vigor, Leaf_Lenght, +Canopy_Width and Canopy_Lenght, I’ll exclude those too. Mite Incidence +and Flowering have little information for some levels and many NA’s, we +will also exclude these traits.

    +
    pheno <- pheno %>%
    +  select(-c(
    +    Incidence_Mites,
    +    Vigor,
    +    Flowering,
    +    Leaf_Lenght,
    +    Canopy_Width,
    +    Canopy_Lenght
    +  ))
    +

    Let’s just look at the missing values now, to check the +proportions.

    +
    plot_missing(pheno)
    +

    +

    + +

    +
    +
    + + - - - - - - - - - - - + + + + + - - - - - - - - - - - + +
    -2019 - -HI - -41.8572 - -60.1626 - -27.2545 - -27.3973 - -1.7258 - -11.4080 - -0.5066 - -0.9954 - -507 - +Version + +Author + +Date +
    -2019 - -N_Roots - -47.2357 - -15.6670 - -5.7620 - -5.6670 - -0.3330 - -2.7217 - -0.1187 + +bf7b1d3 -0.2331 + +WevertonGomesCosta -526 + +2022-11-11
    +
    +
    +

    StC, DMC and StY still do not have good quality, but we will maintain +these traits, as they are important to us.

    +

    Let’s check the distribution of traits by year now and let’s look at +the histograms of the quantitative traits:

    +
    plot_histogram(pheno, ncol = 6)
    +

    +

    + +

    +
    +
    + + - - - - - - - - + + + + + + + - - + + +
    -2019 - -Nstem.Plant - -37.3740 - -6.6667 - -2.7113 - -2.6667 - -1.0000 - -1.0133 + +Version + +Author + +Date +
    +bf7b1d3 -0.0441 + +WevertonGomesCosta -0.0867 + +2022-11-11
    +
    +
    +

    For Branching, Leaf.Ret, Mite, PltArc, Stand6MAP and Staygreen don’t +have normal distribution. To get the BLUPs we will have to remove that +traits from the database.

    +
    pheno <- pheno %>%
    +  select(-c(Branching, Leaf.Ret, Mite, PltArc, Stand6MAP, Staygreen))
    +
    +
    +

    Analisys of Clone

    +

    First, let’s check the amount of missing values for each clone by +year. We are filtering the Clones with the average bigger than 2 missing +values by year.

    +
    pheno2 <- pheno %>%
    +  select(-Bloco) %>%
    +  group_by(Clone, Ano) %>%
    +  summarise_all(.funs = list(~ sum(is.na(.)))) %>%
    +  ungroup() %>%
    +  select_numeric_cols() %>%
    +  mutate(mean = rowMeans(.), Clone.Ano = unique(interaction(pheno$Clone, pheno$Ano))) %>%
    +  filter(mean > 2) %>%
    +  droplevels()
    +
    +nlevels(pheno2$Clone.Ano) %>%
    +  kbl(
    +    escape = F,
    +    align = 'c',
    +    col.names = c("N of genotypes")
    +  ) %>%
    +  kable_classic(
    +    "hover",
    +    full_width = F,
    +    position = "center",
    +    fixed_thead = T
    +  )
    + + + + + + + + + +
    +N of genotypes +
    -527 +40
    +
    rm(pheno2)
    +

    76 clones presented many missing values, i.e., they were evaluated in +less than two blocks by year. Therefore, they should be excluded from +future analyses, according to the year.

    +

    Let’s evaluate the descriptive statistics of the combination between +clone and year for the traits.

    +
    ge_details(pheno, Ano, Clone, resp = everything()) %>%
    +  t() %>%
    +  kbl(escape = F, align = 'c') %>%
    +  kable_classic(
    +    "hover",
    +    full_width = F,
    +    position = "center",
    +    fixed_thead = T
    +  )
    + + - - - - - - - - - - - - - + +
    -2019 + +Parameters -Plant.Height +Mean -19.1125 +SE -2.4233 +SD -1.4843 +CV -1.4633 +Min -0.7400 +Max -0.2837 +MinENV -0.0123 +MaxENV -0.0243 +MinGEN -528 +MaxGEN
    -2019 + +N_Roots -Root.Di +4.29 -24.3155 +0.06 -58.9267 +2.51 -33.4940 +58.56 -33.6500 +0.12 (BGM-1031 in 2017) -6.1200 +15.67 (2012-107-002 in 2019) -8.1442 +2018 (1.62) -0.3596 +2019 (5.76) -0.7064 +BGM-0411 (0.33) -513 +2012-107-002 (11.33)
    -2019 + +FRY -Root.Le +4.95 -21.1089 +0.09 -45.6667 +4.04 -27.1361 +81.79 -27.0000 +0.12 (BGM-0886 in 2017) -11.0000 +22.2 (BGM-1267 in 2018) -5.7281 +2017 (2.75) -0.2529 +2020 (6.52) -0.4969 +BGM-1488 (0.34) -513 +IAC-14 (14.07)
    -2019 + +ShY -ShY +14.23 -47.4901 +0.22 -47.5710 +10.16 -13.4607 +71.45 -12.7735 +0.69 (BGM-0996 in 2017) -1.2860 +61.17 (BGM-2124 in 2020) -6.3925 +2017 (8.47) -0.2782 +2020 (25.87) -0.5465 +BGM-0048 (1.52) -528 +BGM-2124 (54.33)
    -2019 + +DMC -StC +29.06 -16.5407 +0.17 -35.9441 +6.1 -23.6326 +21 -23.6328 +11.98 (BGM-0626 in 2020) -10.7346 +48.34 (BGM-1015 in 2020) -3.9090 +2020 (26.21) -0.1745 +2018 (35.38) -0.3428 +BGM-0626 (14.98) -502 +BGM-1015 (45.02)
    -2019 + +StY -StY +1.52 -72.3243 +0.04 -5.4021 +1.27 -1.3238 +84.01 -1.1095 +0.02 (BGM-0340 in 2019) -0.0154 +8.87 (BGM-0396 in 2018) -0.9574 +2019 (1.32) -0.0428 +2018 (1.84) -0.0841 +BGM-0089 (0.06) -500 +BGM-1023 (4.76)
    -2019 + +Plant.Height -Stem.D +1.19 -15.7037 +0.01 -3.3203 +0.33 -2.1061 +27.43 -2.0963 +0.36 (BGM-0426 in 2020) -1.1197 +3.03 (BR-11-24-156 in 2020) -0.3307 +2017 (1) -0.0144 +2019 (1.48) -0.0283 +Jatobá (0.58) -528 +BGM-1200 (1.91)
    -2020 + +HI -DMC +24.56 -22.5059 +0.27 -48.3360 +11.89 -26.2094 +48.42 -26.0400 +1.57 (BGM-1159 in 2017) -11.9760 +71.97 (BGM-1315 in 2018) -5.8986 +2020 (18.61) -0.2569 +2018 (32.36) -0.5048 +BGM-0961 (2.5) -527 +Mata_Fome_Branca (52.78)
    -2020 + +StC -FRY +24.42 -68.4455 +0.17 -20.5670 +6.11 -6.5246 +25.05 -5.9000 +7.33 (BGM-0626 in 2020) -0.4000 +43.69 (BGM-1015 in 2020) -4.4658 +2020 (21.56) -0.1934 +2018 (30.78) -0.3800 +BGM-0626 (10.33) -533 +BGM-1015 (40.37)
    -2020 + +Root.Le -HI +23.21 -43.3204 +0.13 -45.9340 +5.8 -18.6129 +24.99 -18.0486 +7 (BGM-1574 in 2017) -1.9608 +47.33 (BGM-0396 in 2018) -8.0632 +2017 (19.72) -0.3496 +2019 (27.14) -0.6867 +Jatobá (8.5) -532 +BGM-1956 (35.5)
    -2020 + +Root.Di -N_Roots +28.88 -47.0839 +0.18 -10.3330 +7.9 -4.3060 +27.35 -4.3330 +6.12 (BGM-2142 in 2019) -0.3330 +63.3 (BRS Mulatinha in 2018) -2.0274 +2017 (24.49) -0.0881 +2018 (34.74) -0.1730 +BGM-0089 (12.14) -530 +BGM-1956 (48.91)
    -2020 + +Stem.D -Nstem.Plant +2.11 -37.1507 +0.01 -4.6667 +0.38 -2.0463 +17.9 -2.0000 +1.01 (BGM-0592 in 2018) -1.0000 +4.37 (BRS Tapioqueira in 2020) -0.7602 +2018 (2.02) -0.0326 +2017 (2.16) -0.0641 +BGM-0048 (1.25) -543 +BGM-1523 (2.93)
    -2020 + +Nstem.Plant -Plant.Height +2.13 -24.0927 +0.03 -3.0333 +0.95 -1.1945 +44.53 -1.1600 +1 (BGM-0036 in 2018) -0.3600 +6.67 (BGM-0714 in 2019) -0.2878 +2018 (1.44) -0.0124 +2019 (2.71) -0.0243 +BGM-0066 (1) -543 +BGM-0451 (4.44)
    +

    Apparently we no longer have a genotype that could harm our analysis. +Now we must evaluate the clone-only descriptive statistics for the +traits. Some traits presented hight cv, StY and FRY, but we will go +continue.

    +
    desc_stat(pheno,
    +          by = Ano,
    +          na.rm = TRUE,
    +          stats = "cv") %>%
    +  na.omit() %>%
    +  arrange(desc(cv)) %>%
    +  pivot_wider(names_from = "Ano", values_from = "cv") %>%
    +  kbl(escape = F, align = 'c') %>%
    +  kable_classic(
    +    "hover",
    +    full_width = F,
    +    position = "center",
    +    fixed_thead = T
    +  )
    + + - + + + + + + + + + + - + + - + + - + + - + + - + + @@ -3715,16 +3086,16 @@

    Analisys of Clone

    especially: HI, Nstem.Plant, N_Roots, ShY, StY and FRY.

    This may be due to the presence of outliers, let’s inspect the entire dataset to assess whether there are outliers:

    -
    inspect(pheno %>%
    -          select_if( ~ !is.factor(.)), verbose = FALSE, plot =T) %>%
    -  kbl(escape = F, align = 'c') %>%
    -  kable_classic(
    -    "hover",
    -    full_width = F,
    -    position = "center",
    -    fixed_thead = T
    -  )
    - +
    inspect(pheno %>%
    +          select_if(~ !is.factor(.)), verbose = FALSE) %>%
    +  arrange(desc(Outlier)) %>%
    +  kbl(escape = F, align = 'c') %>%
    +  kable_classic(
    +    "hover",
    +    full_width = F,
    +    position = "center",
    +    fixed_thead = T
    +  )
    + +variable + +2018 + 2020 - + +2019 + +2017 +
    -Root.Di +StY -20.5858 +91.8742 -43.2733 +81.2220 -26.2101 +72.3243 -26.1800 +NA
    -11.8533 +FRY -5.3956 +86.0073 -0.2337 +68.4455 -0.4591 +70.0326 -533 +66.8379
    -2020 - -Root.Le +ShY -18.9730 +69.0625 -36.6667 +42.7475 -23.2345 +47.4901 -23.3333 +45.4973
    -9.0000 +N_Roots -4.4083 +63.2913 -0.1909 +47.0839 -0.3751 +47.2357 -533 +48.8708
    -2020 - -ShY +HI -42.7475 +41.5442 -61.1670 +43.3204 -25.8653 +41.8572 -25.9165 +48.2942
    -3.3330 +Nstem.Plant -11.0568 +33.3849 -0.4794 +37.1507 -0.9417 +37.3740 -532 +NA
    -2020 - -StC +Plant.Height -27.3600 +28.0409 -43.6860 +24.0927 -21.5594 +19.1125 -21.3900 +21.0398
    -7.3260 +StC -5.8986 +15.6937 -0.2569 +27.3600 -0.5048 +16.5407 -527 +NA
    -2020 - -StY +Root.Le -81.2220 +27.1625 -6.0724 +18.9730 -1.5211 +21.1089 -1.2326 +21.5823
    -0.0483 +Root.Di -1.2354 +23.3943 -0.0540 +20.5858 -0.1060 +24.3155 -524 +21.0039
    -2020 - -Stem.D +DMC -17.5042 +13.6086 -4.3733 +22.5059 -2.1321 +13.8212 -2.1207 +NA
    -1.0547 +Stem.D -0.3732 +22.3941 -0.0160 +17.5042 -0.0315 +15.7037 -543 +16.7774
    @@ -3763,7 +3134,7 @@

    Analisys of Clone

    -N_Roots +ShY numeric @@ -3775,19 +3146,19 @@

    Analisys of Clone

    -1974 +2085 -0.12 +0.69 -4.00 +11.17 -15.67 +61.17 -16 +89 NA @@ -3827,7 +3198,7 @@

    Analisys of Clone

    -ShY +StY numeric @@ -3839,19 +3210,19 @@

    Analisys of Clone

    -2085 +1318 -0.69 +0.02 -11.17 +1.21 -61.17 +8.87 -89 +49 NA @@ -3859,7 +3230,7 @@

    Analisys of Clone

    -DMC +Root.Di numeric @@ -3871,19 +3242,19 @@

    Analisys of Clone

    -1328 +1957 -11.98 +6.12 -28.80 +28.17 -48.34 +63.30 -6 +32 NA @@ -3891,7 +3262,7 @@

    Analisys of Clone

    -StY +Nstem.Plant numeric @@ -3903,19 +3274,19 @@

    Analisys of Clone

    -1318 +1446 -0.02 +1.00 -1.21 +2.00 -8.87 +6.67 -49 +30 NA @@ -3955,7 +3326,7 @@

    Analisys of Clone

    -HI +Stem.D numeric @@ -3967,19 +3338,19 @@

    Analisys of Clone

    -1955 +2072 -1.57 +1.01 -23.35 +2.10 -71.97 +4.37 -15 +22 NA @@ -3987,7 +3358,7 @@

    Analisys of Clone

    -StC +Root.Le numeric @@ -3999,19 +3370,19 @@

    Analisys of Clone

    -1328 +1957 -7.33 +7.00 -24.15 +23.00 -43.69 +47.33 -6 +19 NA @@ -4019,7 +3390,7 @@

    Analisys of Clone

    -Root.Le +N_Roots numeric @@ -4031,19 +3402,19 @@

    Analisys of Clone

    -1957 +1974 -7.00 +0.12 -23.00 +4.00 -47.33 +15.67 -19 +16 NA @@ -4051,7 +3422,7 @@

    Analisys of Clone

    -Root.Di +HI numeric @@ -4063,19 +3434,19 @@

    Analisys of Clone

    -1957 +1955 -6.12 +1.57 -28.17 +23.35 -63.30 +71.97 -32 +15 NA @@ -4083,7 +3454,7 @@

    Analisys of Clone

    -Stem.D +DMC numeric @@ -4095,19 +3466,19 @@

    Analisys of Clone

    -2072 +1328 -1.01 +11.98 -2.10 +28.80 -4.37 +48.34 -22 +6 NA @@ -4115,7 +3486,7 @@

    Analisys of Clone

    -Nstem.Plant +StC numeric @@ -4127,19 +3498,19 @@

    Analisys of Clone

    -1446 +1328 -1.00 +7.33 -2.00 +24.15 -6.67 +43.69 -30 +6 NA @@ -4166,330 +3537,26 @@

    Analisys of Clone

    General Inspection

    Now let’s just perform a general inspection of the data to finish the manipulations.

    -
    corr_plot(pheno, col.by = Ano)
    -

    +
    corr_plot(pheno, col.by = Ano)
    +

    StC with DMC and StY with FRY show high correlation.

    Furthermore most of the traits apparently show normal distribution of phenotypic data. So let’s save the clean data and move on to getting the blups.

    -
    write.csv(pheno, "data/pheno_clean.csv", row.names = F, quote = F)
    -
    -pheno<-read.csv("data/pheno_clean.csv") %>% 
    -  mutate(Clone = as.factor(Clone),
    -         Ano = as.factor(Ano),
    -         Bloco = as.factor(Bloco))
    - - - -
    -

    Genotype-environment analysis by mixed-effect models

    -

    First, I’m going to create a function to get the blups and some -parameters from our model.

    -
    BLUPS_par_mmer <- function(model, trait) {
    -  # log likelihood of the model, AIC, convergence T/F
    -  modelfit <- summary(model)$logo
    -  # number of groups for factors, could be used to compute DF
    -  groups <- summary(model)$groups
    -  # variance components
    -  varcomp <- summary(model)$varcomp
    -  
    -  # variance components
    -  Vg <- model$sigma$Clone %>% as.vector()
    -  Ve <- model$sigma$units %>% as.vector()
    -  
    -  # Narrow-sense heritability
    -  H2_narrow <- Vg / (Vg + Ve)
    -  
    -  # Broad-sense heritability
    -  Va <- model$sigma$`Ano:Clone` %>% as.vector()
    -  Ve <- model$sigma$units %>% as.vector()
    -  n.ano <- length(model$U$Ano[[trait]])
    -  H2_Broad<- (Vg) / (Vg + (Va/n.ano) + (Ve/(2*n.ano)))  
    -  
    -  # Extract the BLUPs and PEVs, compute Reliability (REL),
    -  # de-regressed BLUPs and weights for downstream analysis
    -  blups <- model$U$Clone %>%
    -    unlist() %>%
    -    tibble(Clone = names(.), BLUP = .) %>%
    -    mutate(
    -      Clone = gsub("Clone", "", Clone),
    -      PEV = diag(as.matrix(model$PevU$Clone[[1]])),
    -      # prediction error variance
    -      REL = 1 - PEV / Vg,
    -      # Reliability
    -      drgBLUP = BLUP / REL,
    -      # De-regressed BLUP
    -      WT = (1 - H2_narrow) / ((0.1 + (1 - REL) / REL) * H2_narrow) # weight for downstream
    -    )
    -  
    -  # Combine all outputs into one object the function can return()
    -  out <- list(
    -    Trait = trait,
    -    H2_Broad = H2_Broad,
    -    H2_narrow=H2_narrow,
    -    modelfit = list(modelfit),
    -    groups = list(groups),
    -    blups = list(blups),
    -    varcomp = list(varcomp)
    -  )
    -  
    -  return(out)
    -}
    -
    -save(BLUPS_par_mmer, file = "output/BLUPS_par_mmer.Rdata")
    -
    -

    The BLUP model

    -

    Here we have to remember that we have outliers for some traits and -also that we must exclude the year 2017 for some.

    -
    traits <- colnames(pheno)[4:ncol(pheno)]
    -pheno <- pheno %>%
    -  mutate_at(traits, as.numeric)
    -

    Now let’s perform the mixed model analysis to get the BLUPs.

    -
    load("output/BLUPS_par_mmer.Rdata")
    -
    -resultMM <- future_map(traits, function(i) {
    -      data <- pheno %>%
    -        select(1:3,all_of(i)) %>% 
    -        na.omit() %>% 
    -        droplevels()
    -    
    -    model <- sommer::mmer(fixed = as.formula(paste(i, "~", "Ano:Bloco")),
    -      random = ~ Clone + Ano + Ano:Clone,
    -      rcov= ~ units,
    -      data = data,
    -      verbose = FALSE) # Clone:Ano and Ano.Bloco are random and Clone and Ano is fixed
    -    
    -    result <- BLUPS_par_mmer(model, i)
    -  }
    -)
    -
    -names(resultMM) <- traits
    -save(resultMM, file = "output/result_sommer.RData")
    -
    -
    -

    BLUPS for Clone

    -

    First, I will add the average of the traits with the BLUPs for better -interpretation.

    -
    mean_pheno <- as.data.frame(pheno %>%
    -                               summarise_if(is.numeric, mean, na.rm = TRUE))
    -
    -write.csv(mean_pheno, "output/mean_pheno.csv", row.names = F)
    -

    As I used “future_map” to run each stage 1 analysis in parallel, each -trait is in a separate element of a list. We need to process the -resultMM object into a data.frame or matrix for further analysis.

    -
    BLUPS <- bind_rows(lapply(traits, function(i) {
    -  data.frame(
    -    trait = i,
    -    Clone = str_split_i(resultMM[[i]][["blups"]][[1]][["Clone"]], pattern = "[.]", -1),
    -    resultMM[[i]][["blups"]][[1]][-1],
    -    BLUPS_mean = resultMM[[i]][["blups"]][[1]][["BLUP"]] + mean_pheno[, i],
    -    drgBLUP_mean = resultMM[[i]][["blups"]][[1]][["drgBLUP"]] + mean_pheno[, i]
    -  )
    -}))
    -
    -H2 <- bind_rows(lapply(traits, function(i) {
    -  data.frame(trait = i,
    -             H2_Broad =  resultMM[[i]][["H2_Broad"]],
    -             H2_narrow =  resultMM[[i]][["H2_narrow"]])
    -}))
    -
    -varcomp <- bind_rows(lapply(traits, function(i) {
    -  data.frame(
    -    trait = i,
    -    grp = c("Clone", "Ano", "Ano:Clone", "units"),
    -    resultMM[[i]][["varcomp"]][[1]]
    -  )
    -}))
    -

    Saving the results of BLUPs and parameters

    -
    write.csv(BLUPS,
    -          "output/BLUPS.csv",
    -          row.names = F,
    -          quote = F)
    -
    -write.csv(H2,
    -          "output/H2.csv",
    -          row.names = F,
    -          quote = F)
    -
    -write.csv(varcomp,
    -          "output/varcomp.csv",
    -          row.names = F,
    -          quote = F)
    -

    Create a figure about de variance components

    -
    varcomp |> 
    -  ggplot(aes(x = trait, y =  VarComp, fill = fct_reorder(grp, VarComp), by = trait)) +
    -  geom_col(position = "fill")+ 
    -  labs(y="Variance Component (%)",
    -       x="Traits",
    -       fill = "Var. Comp.")+
    -  scale_fill_gdocs()+
    -  theme_minimal()+
    -  theme(text = element_text(size = 25, face = "bold"),
    -    axis.text.x = element_text(
    -      size = 20,
    -      angle = 45,
    -      hjust = 1,
    -      vjust = 1
    -    )) 
    -

    -

    - -

    -
    -
    - - - - - - - - - - - - - - - -
    -Version - -Author - -Date -
    -bf7b1d3 - -WevertonGomesCosta - -2022-11-11 -
    -
    -
    -
    ggsave("output/varcomp.tiff", width = 16, height = 8)
    -
    -
    -

    Ploting BLUPS for all traits

    -

    Let’s plot the density and boxplots figures of the traits.

    -
    BLUPS %>%
    -  pivot_longer(8:9, names_to = "Method", values_to = "Values") %>%
    -  ggplot(aes(x = Values, fill = Method)) +
    -  geom_boxplot(alpha = 0.8) +
    -  facet_wrap(trait~., ncol = 4, scales = "free") +
    -  theme_bw() + 
    -  theme(text = element_text(size = 15)) +
    -  scale_fill_gdocs() +
    -  scale_color_gdocs() +
    -  labs(x = "", y = "")
    -

    -

    - -

    -
    -
    - - - - - - - - - - - - - - - -
    -Version - -Author - -Date -
    -bf7b1d3 - -WevertonGomesCosta - -2022-11-11 -
    -
    -
    -
    ggsave("output/BLUPS_drgBLUPs__boxplot_med.png", width = 16, height = 10, dpi =300)
    -

    Here we will only evaluate the distribution of BLUPs without the -mean.

    -
    BLUPS %>%
    -  pivot_longer(8:9, names_to = "Method", values_to = "Values") %>%
    -  ggplot(aes(x = Values, fill = Method, color = Method)) +
    -  geom_density(alpha = 0.8) +
    -  facet_wrap(trait~., ncol = 4, scales = "free") +
    -  theme_bw() + 
    -  theme(text = element_text(size = 15)) +
    -  scale_fill_gdocs() +
    -  scale_color_gdocs() +
    -  labs(x = "", y = "")
    -

    -

    - -

    -
    -
    - - - - - - - - - - - - - - - - - - - - -
    -Version - -Author - -Date -
    -6cc4d23 - -WevertonGomesCosta - -2022-11-17 -
    -bf7b1d3 - -WevertonGomesCosta - -2022-11-11 -
    -
    -
    -
    ggsave("output/BLUPS_drgBLUPs_density_med.png", width = 16, height = 10, dpi =300)
    -

    Apparently most BLUPs for the traits follow normal distribution and -can be applied to GWS by conventional methods.

    -

    Then, now we go to execute the Genomic Wide Selection script: GWS.Rmd

    +
    write.csv(pheno,
    +          "data/pheno_clean.csv",
    +          row.names = F,
    +          quote = F)
    +
    +pheno_mean_sd <- desc_stat(pheno, stats = c("mean, min, max, cv"))
    +
    +write.csv(pheno_mean_sd,
    +          "output/pheno_mean_sd.csv",
    +          row.names = F,
    +          quote = F)
    +

    Proceed with Genotype-environment analysis using mixed-effect models +to obtain BLUPs (Best Linear Unbiased Predictors) and further interpret +the results to identify superior genotypes.


    -
    sessionInfo()
    -
    R version 4.2.3 (2023-03-15 ucrt)
    +
    sessionInfo()
    +
    R version 4.3.1 (2023-06-16 ucrt)
     Platform: x86_64-w64-mingw32/x64 (64-bit)
     Running under: Windows 10 x64 (build 19045)
     
     Matrix products: default
     
    +
     locale:
     [1] LC_COLLATE=Portuguese_Brazil.utf8  LC_CTYPE=Portuguese_Brazil.utf8   
     [3] LC_MONETARY=Portuguese_Brazil.utf8 LC_NUMERIC=C                      
     [5] LC_TIME=Portuguese_Brazil.utf8    
     
    +time zone: America/Sao_Paulo
    +tzcode source: internal
    +
     attached base packages:
     [1] grid      stats     graphics  grDevices utils     datasets  methods  
     [8] base     
     
     other attached packages:
    - [1] furrr_0.3.1           future_1.33.0         GGally_2.1.2         
    - [4] ggthemes_4.2.4        DataExplorer_0.8.2    metan_1.18.0         
    - [7] readxl_1.4.3          data.table_1.14.8     ComplexHeatmap_2.14.0
    -[10] lubridate_1.9.2       forcats_1.0.0         stringr_1.5.0        
    -[13] dplyr_1.1.2           purrr_1.0.2           readr_2.1.4          
    -[16] tidyr_1.3.0           tibble_3.2.1          ggplot2_3.4.3        
    -[19] tidyverse_2.0.0       kableExtra_1.3.4     
    + [1] GGally_2.1.2          ggthemes_4.2.4        DataExplorer_0.8.2   
    + [4] metan_1.18.0          readxl_1.4.3          data.table_1.14.8    
    + [7] ComplexHeatmap_2.16.0 lubridate_1.9.2       forcats_1.0.0        
    +[10] stringr_1.5.0         dplyr_1.1.2           purrr_1.0.2          
    +[13] readr_2.1.4           tidyr_1.3.0           tibble_3.2.1         
    +[16] ggplot2_3.4.3         tidyverse_2.0.0       kableExtra_1.3.4     
     
     loaded via a namespace (and not attached):
    -  [1] minqa_1.2.6         colorspace_2.1-0    rjson_0.2.21       
    -  [4] rprojroot_2.0.3     circlize_0.4.15     GlobalOptions_0.1.2
    -  [7] fs_1.6.3            clue_0.3-65         rstudioapi_0.15.0  
    - [10] listenv_0.9.0       farver_2.1.1        ggrepel_0.9.3      
    - [13] fansi_1.0.4         mathjaxr_1.6-0      xml2_1.3.5         
    - [16] codetools_0.2-19    splines_4.2.3       doParallel_1.0.17  
    - [19] cachem_1.0.8        knitr_1.44          polyclip_1.10-4    
    - [22] jsonlite_1.8.7      workflowr_1.7.1     nloptr_2.0.3       
    - [25] cluster_2.1.4       png_0.1-8           ggforce_0.4.1      
    - [28] compiler_4.2.3      httr_1.4.7          Matrix_1.6-1       
    - [31] fastmap_1.1.1       cli_3.6.1           later_1.3.1        
    - [34] tweenr_2.0.2        htmltools_0.5.6     tools_4.2.3        
    - [37] lmerTest_3.1-3      igraph_1.5.1        gtable_0.3.4       
    - [40] glue_1.6.2          Rcpp_1.0.11         cellranger_1.1.0   
    - [43] jquerylib_0.1.4     vctrs_0.6.3         svglite_2.1.1      
    - [46] nlme_3.1-163        iterators_1.0.14    xfun_0.40          
    - [49] globals_0.16.2      networkD3_0.4       lme4_1.1-34        
    - [52] rvest_1.0.3         timechange_0.2.0    lifecycle_1.0.3    
    - [55] MASS_7.3-58.2       scales_1.2.1        ragg_1.2.6         
    - [58] hms_1.1.3           promises_1.2.1      parallel_4.2.3     
    - [61] RColorBrewer_1.1-3  yaml_2.3.7          gridExtra_2.3      
    - [64] sass_0.4.7          reshape_0.8.9       stringi_1.7.12     
    - [67] S4Vectors_0.36.2    foreach_1.5.2       BiocGenerics_0.44.0
    - [70] boot_1.3-28.1       shape_1.4.6         rlang_1.1.1        
    - [73] pkgconfig_2.0.3     systemfonts_1.0.4   matrixStats_1.0.0  
    - [76] evaluate_0.22       lattice_0.21-8      labeling_0.4.3     
    - [79] patchwork_1.1.3     htmlwidgets_1.6.2   tidyselect_1.2.0   
    - [82] parallelly_1.36.0   plyr_1.8.8          magrittr_2.0.3     
    - [85] R6_2.5.1            IRanges_2.32.0      generics_0.1.3     
    - [88] mgcv_1.9-0          pillar_1.9.0        whisker_0.4.1      
    - [91] withr_2.5.1         crayon_1.5.2        utf8_1.2.3         
    - [94] tzdb_0.4.0          rmarkdown_2.25      GetoptLong_1.0.5   
    - [97] git2r_0.32.0        digest_0.6.33       webshot_0.5.5      
    -[100] httpuv_1.6.11       numDeriv_2016.8-1.1 textshaping_0.3.7  
    -[103] stats4_4.2.3        munsell_0.5.0       viridisLite_0.4.2  
    -[106] bslib_0.5.1        
    + [1] gridExtra_2.3 rlang_1.1.1 magrittr_2.0.3 + [4] clue_0.3-64 GetoptLong_1.0.5 git2r_0.32.0 + [7] matrixStats_1.0.0 compiler_4.3.1 png_0.1-8 + [10] systemfonts_1.0.4 vctrs_0.6.3 rvest_1.0.3 + [13] pkgconfig_2.0.3 shape_1.4.6 crayon_1.5.2 + [16] fastmap_1.1.1 labeling_0.4.2 utf8_1.2.3 + [19] promises_1.2.1 rmarkdown_2.24 tzdb_0.4.0 + [22] nloptr_2.0.3 xfun_0.40 cachem_1.0.8 + [25] jsonlite_1.8.7 highr_0.10 later_1.3.1 + [28] reshape_0.8.9 tweenr_2.0.2 parallel_4.3.1 + [31] cluster_2.1.4 R6_2.5.1 bslib_0.5.1 + [34] stringi_1.7.12 RColorBrewer_1.1-3 boot_1.3-28.1 + [37] numDeriv_2016.8-1.1 jquerylib_0.1.4 cellranger_1.1.0 + [40] Rcpp_1.0.11 iterators_1.0.14 knitr_1.43 + [43] IRanges_2.34.1 igraph_1.5.1 Matrix_1.6-1 + [46] httpuv_1.6.11 splines_4.3.1 timechange_0.2.0 + [49] tidyselect_1.2.0 rstudioapi_0.15.0 yaml_2.3.7 + [52] doParallel_1.0.17 codetools_0.2-19 lmerTest_3.1-3 + [55] lattice_0.21-8 plyr_1.8.8 withr_2.5.2 + [58] evaluate_0.22 polyclip_1.10-4 xml2_1.3.5 + [61] circlize_0.4.15 pillar_1.9.0 whisker_0.4.1 + [64] foreach_1.5.2 stats4_4.3.1 generics_0.1.3 + [67] rprojroot_2.0.3 mathjaxr_1.6-0 S4Vectors_0.38.1 + [70] hms_1.1.3 munsell_0.5.0 scales_1.2.1 + [73] minqa_1.2.6 glue_1.6.2 tools_4.3.1 + [76] lme4_1.1-34 webshot_0.5.5 fs_1.6.3 + [79] colorspace_2.1-0 networkD3_0.4 nlme_3.1-163 + [82] patchwork_1.1.3 ggforce_0.4.1 cli_3.6.1 + [85] workflowr_1.7.1 fansi_1.0.4 viridisLite_0.4.2 + [88] svglite_2.1.1 gtable_0.3.4 sass_0.4.7 + [91] digest_0.6.33 BiocGenerics_0.46.0 ggrepel_0.9.3 + [94] htmlwidgets_1.6.2 rjson_0.2.21 farver_2.1.1 + [97] htmltools_0.5.6 lifecycle_1.0.3 httr_1.4.7 +[100] GlobalOptions_0.1.2 MASS_7.3-60
    +
    @@ -4589,8 +3658,6 @@

    Ploting BLUPS for all traits

    - - @@ -4623,35 +3690,6 @@

    Ploting BLUPS for all traits

    -