Last updated: 2023-10-03

Checks: 6 1

Knit directory: HenriqueDGen/

This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


The R Markdown file has staged 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.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20211012) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 54268fe. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .DS_Store
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    data/.DS_Store
    Ignored:    output/.DS_Store
    Ignored:    output/Figures/.DS_Store

Unstaged changes:
    Modified:   output/MediasBLUPs.txt

Staged changes:
    Modified:   analysis/AnalisesModelosMistos.Rmd
    Modified:   analysis/Den_IndSH.Rmd
    New:        output/MediasBLUPs.txt
    Modified:   output/ShannonWeaverIndex.csv

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/Den_IndSH.Rmd) and HTML (docs/Den_IndSH.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd 54268fe LucianoRogerio 2023-07-31 Adding Foliar Retention to final Boxplot
Rmd fef5cf2 LucianoRogerio 2023-07-26 Adicao Dados 2022
html fef5cf2 LucianoRogerio 2023-07-26 Adicao Dados 2022
Rmd e08b1a6 LucianoRogerio 2022-04-05 Last Analysis
html e08b1a6 LucianoRogerio 2022-04-05 Last Analysis
Rmd e020351 LucianoRogerio 2022-03-29 Update Henrique Analysis
html e020351 LucianoRogerio 2022-03-29 Update Henrique Analysis
Rmd 67d31e9 LucianoRogerio 2021-12-07 Fix the navigation buttons on Dendrogram and SH webpage
html 67d31e9 LucianoRogerio 2021-12-07 Fix the navigation buttons on Dendrogram and SH webpage
Rmd 2abb2a7 LucianoRogerio 2021-12-07 Small english changes at the website
html 2abb2a7 LucianoRogerio 2021-12-07 Small english changes at the website
Rmd f272038 LucianoRogerio 2021-12-07 Update of the analysis and website layout
html f272038 LucianoRogerio 2021-12-07 Update of the analysis and website layout
Rmd e535227 LucianoRogerio 2021-11-24 Update Layout Website
html 3ca0498 LucianoRogerio 2021-11-18 Build site.
Rmd f51cdc6 LucianoRogerio 2021-11-18 Add the Dendrogram analysis
html f51cdc6 LucianoRogerio 2021-11-18 Add the Dendrogram analysis
Rmd cbf63bd LucianoRogerio 2021-11-16 Add Dendrogram
html cbf63bd LucianoRogerio 2021-11-16 Add Dendrogram
Rmd e89306d LucianoRogerio 2021-11-09 DAPC Analysis finished
Rmd 33422ee LucianoRogerio 2021-11-09 DAPC Analysis finished

Dendrogram

Wrong Page?

library(devtools)
Loading required package: usethis
suppressMessages(library(tidyverse)); suppressMessages(library(circlize))
suppressMessages(library(ComplexHeatmap)); suppressMessages(library(dendextend))

DAPCHenGraph <- readRDS(here::here("output", "DAPCAn.RDS"))
DAPCS <- DAPCHenGraph$ind.coord
DAPCS <- scale(DAPCS, center = T, scale = T)

BLUPS <- readRDS(here::here("output", "BLUPsDiseaseAgro.RDS"))
BLUPS[ , -1] <- scale(BLUPS[ , -1], center = T, scale = T)
BLUPS[is.na(BLUPS)] <- 0
rownames(BLUPS) <- BLUPS$CLONE

col_fun1 = colorRamp2(c(-5.5, 0, 6.5), c("darkblue", "white", "darkred"))

km <- DAPCHenGraph$grp
km1 <- km[km == 1] %>% names
km2 <- km[km == 2] %>% names
km3 <- km[km == 3] %>% names

orderDen1 <- as.dendrogram(hclust(dist(DAPCS[(rownames(DAPCS) %in% km1),1:2]))) %>% order.dendrogram(.) %>% 
  rownames(DAPCS[(rownames(DAPCS) %in% km1),])[.]
orderDen2 <- as.dendrogram(hclust(dist(DAPCS[(rownames(DAPCS) %in% km2),1:2]))) %>% order.dendrogram(.) %>% 
  rownames(DAPCS[(rownames(DAPCS) %in% km2),])[.]
orderDen3 <- as.dendrogram(hclust(dist(DAPCS[(rownames(DAPCS) %in% km3),1:2]))) %>% order.dendrogram(.) %>% 
  rownames(DAPCS[(rownames(DAPCS) %in% km3),])[.]

orderDen <- c(orderDen1, orderDen2, orderDen3)

pos <- match(orderDen, BLUPS$CLONE)
BLUPS <- BLUPS[pos,]
  
#tiff(filename = here::here("output", "Fig10_CircularHeatmapDAGrp.tiff"), res = 350, compression = "lzw",
#     units = "cm", height = 15, width = 15)
set.seed(1)
circos.par(gap.after = c(20)) 
circos.heatmap(DAPCS[,1:2], col = col_fun1, track.height = 0.1,
               dend.side = "outside", clustering.method = "ward.D2", split = km,
               dend.track.height = 0.2, show.sector.labels = T)
Note: 1 point is out of plotting region in sector '1', track '1'.
Note: 1 point is out of plotting region in sector '1', track '1'.
Note: 1 point is out of plotting region in sector '1', track '1'.
Note: 1 point is out of plotting region in sector '2', track '1'.
Note: 1 point is out of plotting region in sector '2', track '1'.
Note: 1 point is out of plotting region in sector '2', track '1'.
Note: 1 point is out of plotting region in sector '3', track '1'.
Note: 1 point is out of plotting region in sector '3', track '1'.
Note: 1 point is out of plotting region in sector '3', track '1'.
circos.track(track.index = get.current.track.index(), panel.fun = function(x, y) {
  if(CELL_META$sector.numeric.index == 1) { # the last sector
    cn = c("2ºDA", "1ºDA")
    n = length(cn)
    circos.text(x = rep(-3, n), y = (1:n)*4 - 10.5, labels = cn, 
                cex = 0.5, adj = c(0, 0.5), facing = "outside")
  }
}, bg.border = NA)
Note: 2 points are out of plotting region in sector '1', track '1'.
circos.heatmap(BLUPS[,-1], col = col_fun1, track.height = 0.4, cluster = FALSE)
circos.track(track.index = get.current.track.index(), panel.fun = function(x, y) {
  if(CELL_META$sector.numeric.index == 1) { # the last sector
    cn = colnames(BLUPS)[10:2]
    n = length(cn)
    circos.text(x = rep(-3, n), y = (1:n)*1.15 -0.6, labels = cn, 
                cex = 0.5, adj = c(0, 0.5), facing = "outside")
  }
}, bg.border = NA)
Note: 9 points are out of plotting region in sector '1', track '3'.
circos.clear()
#adding legend key
library(ComplexHeatmap)
lgd_links = Legend(at=c(-5.5,0,6.5), col_fun = col_fun1, 
                   title_position = "topleft", title = "Value", direction = "vertical")
draw(lgd_links, x = unit(1, "npc") - unit(5, "mm"), y = unit(8, "mm"), 
     just = c("right", "bottom"))

Version Author Date
fef5cf2 LucianoRogerio 2023-07-26
e08b1a6 LucianoRogerio 2022-04-05
e020351 LucianoRogerio 2022-03-29
#dev.off()

Shannon-Weaver index

suppressMessages(library(tidyverse)); library(magrittr)

Attaching package: 'magrittr'
The following object is masked from 'package:purrr':

    set_names
The following object is masked from 'package:tidyr':

    extract
library(here)
here() starts at /Users/luciano/Documents/GitHub/HenriqueDGen
source(here::here("code", "Shannon-Weaver.R"))

BLUPS <- readRDS(here::here("output", "BLUPsDiseaseAgro.RDS"))
Grps <- readRDS(here::here("output", "DAPCAn.RDS")) %$% grp

Groups <- tibble(CLONE = names(Grps),
                 Group = as.character(Grps))

BLUPS2 <- BLUPS %>% left_join(Groups, by = "CLONE")
MIN <- apply(BLUPS[,2:11], FUN = min, MARGIN = 2, na.rm = T)
MAX <- apply(BLUPS[,2:11], FUN = max, MARGIN = 2, na.rm = T)

IndSH <- BLUPS2 %>% dplyr::group_by(Group) %>% 
  dplyr::summarise(SH_Anth = Shannon.Weaver.QT(Anth, min = MIN[1], max = MAX[1],formula = 2),
                   SH_BlLS = Shannon.Weaver.QT(BlLS, min = MIN[2], max = MAX[2],formula = 2),
                   SH_BrLS = Shannon.Weaver.QT(BrLS, min = MIN[3], max = MAX[3],formula = 2),
                   SH_WhLS = Shannon.Weaver.QT(WhLS, min = MIN[4], max = MAX[4],formula = 2),
                   SH_Vigor = Shannon.Weaver.QT(Vigor, min = MIN[5], max = MAX[5],formula = 2),
                   SH_NR = Shannon.Weaver.QT(NR, min = MIN[6], max = MAX[6],formula = 2),
                   SH_RF = Shannon.Weaver.QT(RF, min = MIN[7], max = MAX[7],formula = 2),
                   SH_DRY = Shannon.Weaver.QT(DRY, min = MIN[8], max = MAX[8],formula = 2),
                   SH_DMC = Shannon.Weaver.QT(DMC, min = MIN[9], max = MAX[9],formula = 2),
                   SH_PTR = Shannon.Weaver.QT(PTR, min = MIN[10], max = MAX[10],formula = 2),
                   SH_PPA = Shannon.Weaver.QT(PPA, min = MIN[11], max = MAX[11],formula = 2))

Table 1. Shannon-Weaver Index per DAPC group of cassava agronomic and foliar disease traits

[Next page]

Last page

Back to home


sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.5.2

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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] reactable_0.4.4       here_1.0.1            magrittr_2.0.3       
 [4] dendextend_1.17.1     ComplexHeatmap_2.16.0 circlize_0.4.15      
 [7] lubridate_1.9.2       forcats_1.0.0         stringr_1.5.0        
[10] dplyr_1.1.2           purrr_1.0.2           readr_2.1.4          
[13] tidyr_1.3.0           tibble_3.2.1          ggplot2_3.4.3        
[16] tidyverse_2.0.0       devtools_2.4.5        usethis_2.2.2        

loaded via a namespace (and not attached):
 [1] tidyselect_1.2.0    viridisLite_0.4.2   viridis_0.6.4      
 [4] fastmap_1.1.1       promises_1.2.1      digest_0.6.33      
 [7] timechange_0.2.0    mime_0.12           lifecycle_1.0.3    
[10] cluster_2.1.4       ellipsis_0.3.2      processx_3.8.2     
[13] compiler_4.3.1      rlang_1.1.1         sass_0.4.7         
[16] tools_4.3.1         utf8_1.2.3          yaml_2.3.7         
[19] knitr_1.43          prettyunits_1.1.1   htmlwidgets_1.6.2  
[22] pkgbuild_1.4.2      RColorBrewer_1.1-3  pkgload_1.3.2.1    
[25] miniUI_0.1.1.1      workflowr_1.7.0     withr_2.5.0        
[28] BiocGenerics_0.46.0 stats4_4.3.1        fansi_1.0.4        
[31] urlchecker_1.0.1    git2r_0.32.0        profvis_0.3.8      
[34] xtable_1.8-4        colorspace_2.1-0    scales_1.2.1       
[37] iterators_1.0.14    cli_3.6.1           rmarkdown_2.24     
[40] crayon_1.5.2        generics_0.1.3      remotes_2.4.2.1    
[43] rstudioapi_0.15.0   tzdb_0.4.0          rjson_0.2.21       
[46] sessioninfo_1.2.2   cachem_1.0.8        parallel_4.3.1     
[49] matrixStats_1.0.0   vctrs_0.6.3         jsonlite_1.8.7     
[52] callr_3.7.3         IRanges_2.34.1      hms_1.1.3          
[55] GetoptLong_1.0.5    S4Vectors_0.38.1    clue_0.3-64        
[58] crosstalk_1.2.0     foreach_1.5.2       jquerylib_0.1.4    
[61] glue_1.6.2          reactR_0.4.4        codetools_0.2-19   
[64] ps_1.7.5            stringi_1.7.12      gtable_0.3.3       
[67] shape_1.4.6         later_1.3.1         munsell_0.5.0      
[70] pillar_1.9.0        htmltools_0.5.6     R6_2.5.1           
[73] doParallel_1.0.17   rprojroot_2.0.3     evaluate_0.21      
[76] shiny_1.7.5         highr_0.10          png_0.1-8          
[79] memoise_2.0.1       httpuv_1.6.11       bslib_0.5.1        
[82] Rcpp_1.0.11         gridExtra_2.3       whisker_0.4.1      
[85] xfun_0.40           fs_1.6.3            pkgconfig_2.0.3    
[88] GlobalOptions_0.1.2