Last updated: 2023-06-20

Checks: 6 1

Knit directory: dgrp-starve/

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.


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.

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(20221101) 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.

Using absolute paths to the files within your workflowr project makes it difficult for you and others to run your code on a different machine. Change the absolute path(s) below to the suggested relative path(s) to make your code more reproducible.

absolute relative
/data2/morgante_lab/nklimko/rep/dgrp-starve/ .

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 db82ff0. 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:    code/snake/
    Ignored:    data/snake/

Untracked files:
    Untracked:  .snakemake/
    Untracked:  Rplot.pdf
    Untracked:  analysis/linearReg.Rmd
    Untracked:  bglr-f.R
    Untracked:  code/PCA/
    Untracked:  code/data-prep/
    Untracked:  code/fabio/
    Untracked:  code/gBayesC.R
    Untracked:  code/id_bank_creation.R
    Untracked:  code/intro-starve/
    Untracked:  code/methodComp/
    Untracked:  code/regress/
    Untracked:  colorCode
    Untracked:  data/bayesF.rds
    Untracked:  data/bayesM.rds
    Untracked:  data/bglr-f-130k.rds
    Untracked:  data/bglr-f.rds
    Untracked:  data/bglr-m-130k.rds
    Untracked:  data/bglr-m.rds
    Untracked:  data/corLoop-f-minus.rds
    Untracked:  data/corLoop-f.rds
    Untracked:  data/corLoop-m-Minus.rds
    Untracked:  data/corLoop-m-minus.rds
    Untracked:  data/corLoop-m.rds
    Untracked:  data/fRegress.txt
    Untracked:  data/fRegress_adj.txt
    Untracked:  data/fm.burglar
    Untracked:  data/gbayesC-f.Rds
    Untracked:  data/gbayesC-m.Rds
    Untracked:  data/gbayesC.Rds
    Untracked:  data/gbayes_100k-f.Rds
    Untracked:  data/gbayes_100k-m.Rds
    Untracked:  data/goGroups.txt
    Untracked:  data/id_bank
    Untracked:  data/id_bank.Rds
    Untracked:  data/mPart.txt
    Untracked:  data/mRegress.txt
    Untracked:  data/mRegress_adj.txt
    Untracked:  data/multiReg.rData
    Untracked:  data/pheno_f
    Untracked:  data/pheno_m
    Untracked:  data/starve-f.txt
    Untracked:  data/starve-m.txt
    Untracked:  data/xp-f.txt
    Untracked:  data/xp-m.txt
    Untracked:  data/xp_f
    Untracked:  data/xp_m
    Untracked:  data/y_save.txt
    Untracked:  f-cor.png
    Untracked:  figure/
    Untracked:  junk/
    Untracked:  m-cor.png
    Untracked:  notes/
    Untracked:  posterPlots.R
    Untracked:  runtime.png
    Untracked:  snake/

Unstaged changes:
    Modified:   .Rprofile
    Modified:   .gitattributes
    Modified:   .gitignore
    Modified:   README.md
    Modified:   _workflowr.yml
    Modified:   analysis/_site.yml
    Modified:   analysis/about.Rmd
    Deleted:    analysis/gremlo.R
    Modified:   analysis/license.Rmd
    Modified:   analysis/linReg.Rmd
    Deleted:    analysis/methodComp-f.Rmd
    Deleted:    analysis/methodComp-m.Rmd
    Modified:   analysis/methodComp.Rmd
    Modified:   analysis/methodPred.Rmd
    Modified:   analysis/multiComp.Rmd
    Modified:   analysis/multiReg.Rmd
    Modified:   analysis/pca.Rmd
    Modified:   analysis/predict.Rmd
    Modified:   analysis/recap.Rmd
    Modified:   analysis/rewrite.Rmd
    Modified:   analysis/starve.Rmd
    Deleted:    analysis/stepwise-f.Rmd
    Deleted:    analysis/stepwise-m.Rmd
    Deleted:    analysis/testing.R
    Deleted:    analysis/tips.Rmd
    Modified:   analysis/trace.Rmd
    Modified:   code/README.md
    Deleted:    code/baseScript-lineComp.R
    Deleted:    code/combineSNP.R
    Deleted:    code/four-comp.76979.err
    Deleted:    code/four-comp.76979.out
    Deleted:    code/four-comp.sbatch
    Deleted:    code/fourLinePrep.R
    Deleted:    code/line_avgMinus.R
    Deleted:    code/line_avgPlus.R
    Deleted:    code/line_difMinus.R
    Deleted:    code/line_difPlus.R
    Deleted:    code/snpGene.R
    Deleted:    code/starveDataPrep.R
    Modified:   data/README.md
    Modified:   data/avgMinus-result.txt
    Modified:   data/avgMinus.txt
    Modified:   data/avgPlus-result.txt
    Modified:   data/avgPlus.txt
    Modified:   data/difMinus-result.txt
    Modified:   data/difMinus.txt
    Modified:   data/difPlus-result.txt
    Modified:   data/difPlus.txt
    Modified:   data/geneHits.txt
    Modified:   data/snpList.txt
    Modified:   data/starve.csv
    Modified:   dgrp-starve.Rproj
    Modified:   output/README.md
    Modified:   output/avgMinus-result.txt
    Modified:   output/avgPlus-result.txt
    Modified:   output/difMinus-result.txt
    Modified:   output/difPlus-result.txt

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/multitraitPred.Rmd) and HTML (docs/multitraitPred.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 db82ff0 nklimko 2023-06-20 wflow_publish("analysis/multitraitPred.Rmd")
html 8e5b37b nklimko 2023-06-05 Build site.
html 3de3cc4 nklimko 2023-05-30 Build site.
Rmd a742cc3 nklimko 2023-05-30 wflow_publish("analysis/multitraitPred.Rmd")
html 21bf8de nklimko 2023-05-30 Build site.
Rmd 9fb475c nklimko 2023-05-30 wflow_publish("analysis/multitraitPred.Rmd")

The following methods are currently implemented:

  • BayesC

  • GBLUP

  • MultiBayesC

  • MultiGBLUP

  • mr.mash

  • MultiLASSO

###FEMALE
#setwd('/data2/morgante_lab/nklimko/rep/dgrp-starve/')

bayesC <- readRDS("snake/data/20_cor/bayesC_f_starvation.Rds")
gblup <- readRDS("snake/data/20_cor/gblup_f_starvation.Rds")

multigblupData <- readRDS('snake/data/20_cor/multigblup_f_starvation.Rds')
temp <- unlist(multigblupData)
multigblup <- temp[seq(1, length(temp), by=4)]

multibayesCData <- readRDS('snake/data/20_cor/multibayesC_f_starvation.Rds')
temp <- unlist(multibayesCData)
multibayesC <- temp[seq(1, length(temp), by=4)]

mr.mashData <- readRDS('snake/data/20_cor/mr.mash_f_starvation.Rds')
temp <- unlist(mr.mashData)
mr.mash <- temp[seq(1, length(temp), by=4)]

mlassoData <- readRDS('snake/data/20_cor/mlasso_f_starvation.Rds')
temp <- unlist(mlassoData)
mlasso <- temp[seq(1, length(temp), by=4)]

topmbc <- unlist(readRDS('snake/data/20_cor/multibayesC_f_sr.top3.Rds'))
top_multibayesC <- topmbc[seq(1, length(topmbc), by=16)]

topblup <- unlist(readRDS('snake/data/20_cor/multiblup_f_sr.top3.Rds'))
top_multiblup <- topblup[seq(1, length(topblup), by=16)]

temp <- c(gblup, bayesC, multigblup, multibayesC, mr.mash, mlasso, top_multiblup, top_multibayesC)

label <- c(rep("gblup", iter), rep("bayesC", iter), rep("multigblup", iter), rep("multibayesC", iter), rep("mr.mash", iter), rep('mlasso', iter), rep('top_multiblup', iter), rep("top_multibayesC", iter))

data <- data.table(cor=as.numeric(temp), method=label)

gg[[1]] <- ggplot(data, aes(x=method, y=cor, fill=method)) +
  geom_violin(color = NA, width = 0.65) +
  geom_boxplot(color='#440154FF', width = 0.15) +
  theme_minimal() +
  stat_summary(fun=mean, color='#440154FF', geom='point', 
               shape=18, size=3, show.legend=FALSE) +
  labs(x=NULL,y='Correlation between True and Predicted Phenotype',tag='F') +
  theme(legend.position='none',
        axis.text.x = element_text(angle = -45, size=10),
        text=element_text(size=10),
        plot.tag = element_text(size=15)) +
  scale_fill_viridis(begin = 0.4, end=0.9,discrete=TRUE)


print(paste0(c('bayesC', 'gblup', 'multibayesC', 'multigblup', 'mr.mash', 'top_multibayesC', 'top_multiblup'),': ',c(mean(bayesC), mean(gblup), mean(multibayesC), mean(multigblup), mean(mr.mash), mean(top_multibayesC), mean(top_multiblup))))
[1] "bayesC: 0.28144367623869"           "gblup: 0.279982238117636"          
[3] "multibayesC: 0.252335414801586"     "multigblup: 0.272734703328458"     
[5] "mr.mash: 0.263852919847503"         "top_multibayesC: 0.241689113192319"
[7] "top_multiblup: 0.275657017370914"  
### MALE
#setwd('/data2/morgante_lab/nklimko/rep/dgrp-starve/')


bayesC <- readRDS("snake/data/20_cor/bayesC_m_starvation.Rds")
gblup <- readRDS("snake/data/20_cor/gblup_m_starvation.Rds")

multigblupData <- readRDS('snake/data/20_cor/multigblup_m_starvation.Rds')
temp <- unlist(multigblupData)
multigblup <- temp[seq(1, length(temp), by=4)]

multibayesCData <- readRDS('snake/data/20_cor/multibayesC_m_starvation.Rds')
temp <- unlist(multibayesCData)
multibayesC <- temp[seq(1, length(temp), by=4)]

mr.mashData <- readRDS('snake/data/20_cor/mr.mash_m_starvation.Rds')
temp <- unlist(mr.mashData)
mr.mash <- temp[seq(1, length(temp), by=4)]

mlassoData <- ('snake/data/20_cor/mlasso_m_starvation.Rds')
temp <- unlist(mlassoData)
mlasso <- temp[seq(1, length(temp), by=4)]

topmbc <- unlist(readRDS('snake/data/20_cor/multibayesC_f_sr.top3.Rds'))
top_multibayesC <- topmbc[seq(1, length(topmbc), by=16)]

topblup <- unlist(readRDS('snake/data/20_cor/multiblup_f_sr.top3.Rds'))
top_multiblup <- topblup[seq(1, length(topblup), by=16)]

temp <- c(gblup, bayesC, multigblup, multibayesC, mr.mash, mlasso, top_multiblup, top_multibayesC)

label <- c(rep("gblup", iter), rep("bayesC", iter), rep("multigblup", iter), rep("multibayesC", iter), rep("mr.mash", iter), rep('mlasso', iter), rep('top_multiblup', iter), rep("top_multibayesC", iter))

data <- data.table(cor=as.numeric(temp), method=label)
Warning in data.table(cor = as.numeric(temp), method = label): NAs introduced
by coercion
Warning in as.data.table.list(x, keep.rownames = keep.rownames, check.names =
check.names, : Item 1 has 351 rows but longest item has 400; recycled with
remainder.
gg[[2]] <- ggplot(data, aes(x=method, y=cor, fill=method)) +
  geom_violin(color = NA, width = 0.65) +
  geom_boxplot(color='#440154FF', width = 0.15) +
  theme_minimal() +
  stat_summary(fun=mean, color='#440154FF', geom='point', 
               shape=18, size=3, show.legend=FALSE) +
  labs(x=NULL,y='Correlation between True and Predicted Phenotype',tag='M') +
  theme(legend.position='none',
        axis.text.x = element_text(angle = -45, size=10),
        text=element_text(size=10),
        plot.tag = element_text(size=15)) +
  scale_fill_viridis(begin = 0.4, end=0.9,discrete=TRUE)

print(paste0(c('bayesC', 'gblup', 'multibayesC', 'multigblup', 'mr.mash', 'top_multibayesC', 'top_multiblup'),': ',c(mean(bayesC), mean(gblup), mean(multibayesC), mean(multigblup), mean(mr.mash), mean(top_multibayesC), mean(top_multiblup))))
[1] "bayesC: 0.348274542374069"          "gblup: 0.349139906076041"          
[3] "multibayesC: 0.313346489684489"     "multigblup: 0.3433458357234"       
[5] "mr.mash: 0.334111164959302"         "top_multibayesC: 0.241689113192319"
[7] "top_multiblup: 0.275657017370914"  

Correlation Coefficient Boxplots

plot_grid(gg[[1]],gg[[2]], ncol=2)

Version Author Date
8e5b37b nklimko 2023-06-05
21bf8de nklimko 2023-05-30

Alpha variation

setwd('snake/data/20_cor/')


tempDat <- list.files(pattern="lasso_\\d") %>% map(readRDS) %>% bind_cols()
New names:
• `` -> `...1`
• `` -> `...2`
• `` -> `...3`
• `` -> `...4`
• `` -> `...5`
• `` -> `...6`
• `` -> `...7`
• `` -> `...8`
• `` -> `...9`
• `` -> `...10`
#tempDat <- list.files(path='snake/data/20_cor', pattern="lasso_\\d") %>% map(readRDS) %>% bind_cols()

dat <- data.frame(cor=unlist(tempDat[,seq(1,9,2)]))
label = rep(seq(0,1,0.25), each=iter)

data <- data.table(cor=as.numeric(unlist(dat)), alpha=as.factor(label))


gg[[3]] <- ggplot(data, aes(x=alpha, y=cor, fill=alpha)) +
  geom_violin(color = NA, width = 0.65) +
  geom_boxplot(color='#440154FF', width = 0.15) +
  theme_minimal() +
  stat_summary(fun=mean, color='#440154FF', geom='point', 
               shape=18, size=3, show.legend=FALSE) +
  labs(x=NULL,y='Correlation between True and Predicted Phenotype',tag='F') +
  theme(legend.position='none',
        axis.text.x = element_text(angle = -45, size=10),
        text=element_text(size=10),
        plot.tag = element_text(size=15)) +
        scale_fill_viridis(begin = 0.4, end=0.9,discrete=TRUE)


dat <- data.frame(cor=unlist(tempDat[,seq(2,10,2)]))
label = rep(seq(0,1,0.25), each=iter)

data <- data.table(cor=as.numeric(unlist(dat)), alpha=as.factor(label))

gg[[4]] <- ggplot(data, aes(x=alpha, y=cor, fill=alpha)) +
  geom_violin(color = NA, width = 0.65) +
  geom_boxplot(color='#440154FF', width = 0.15) +
  theme_minimal() +
  stat_summary(fun=mean, color='#440154FF', geom='point', 
               shape=18, size=3, show.legend=FALSE) +
  labs(x=NULL,y='Correlation between True and Predicted Phenotype',tag='M') +
  theme(legend.position='none',
        axis.text.x = element_text(angle = -45, size=10),
        text=element_text(size=10),
        plot.tag = element_text(size=15)) +
        scale_fill_viridis(begin = 0.4, end=0.9,discrete=TRUE)
plot_grid(gg[[3]],gg[[4]], ncol=2)


sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Rocky Linux 8.5 (Green Obsidian)

Matrix products: default
BLAS/LAPACK: /opt/ohpc/pub/libs/gnu9/openblas/0.3.7/lib/libopenblasp-r0.3.7.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
 [1] lubridate_1.9.2   forcats_1.0.0     stringr_1.5.0     purrr_1.0.1      
 [5] readr_2.1.4       tidyr_1.3.0       tibble_3.2.1      tidyverse_2.0.0  
 [9] scales_1.2.1      viridis_0.6.2     viridisLite_0.4.2 doParallel_1.0.17
[13] iterators_1.0.14  foreach_1.5.2     qqman_0.1.8       cowplot_1.1.1    
[17] ggplot2_3.4.2     data.table_1.14.8 dplyr_1.1.2       workflowr_1.7.0  

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.10      getPass_0.2-2    ps_1.7.2         rprojroot_2.0.3 
 [5] digest_0.6.31    utf8_1.2.3       R6_2.5.1         evaluate_0.20   
 [9] httr_1.4.5       highr_0.10       pillar_1.9.0     rlang_1.1.1     
[13] rstudioapi_0.14  whisker_0.4.1    callr_3.7.3      jquerylib_0.1.4 
[17] rmarkdown_2.20   labeling_0.4.2   munsell_0.5.0    compiler_4.1.2  
[21] httpuv_1.6.9     xfun_0.37        pkgconfig_2.0.3  htmltools_0.5.4 
[25] tidyselect_1.2.0 gridExtra_2.3    codetools_0.2-19 fansi_1.0.4     
[29] calibrate_1.7.7  tzdb_0.3.0       withr_2.5.0      later_1.3.0     
[33] MASS_7.3-58.3    grid_4.1.2       jsonlite_1.8.4   gtable_0.3.3    
[37] lifecycle_1.0.3  git2r_0.31.0     magrittr_2.0.3   cli_3.6.1       
[41] stringi_1.7.12   cachem_1.0.7     farver_2.1.1     fs_1.6.1        
[45] promises_1.2.0.1 bslib_0.4.2      generics_0.1.3   vctrs_0.6.2     
[49] tools_4.1.2      glue_1.6.2       hms_1.1.3        processx_3.8.0  
[53] fastmap_1.1.1    yaml_2.3.7       timechange_0.2.0 colorspace_2.1-0
[57] knitr_1.42       sass_0.4.5