Last updated: 2023-08-28

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 debb4cd. 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/
    Ignored:    junk/
    Ignored:    notes/

Untracked files:
    Untracked:  .snakemake/
    Untracked:  Rplot.pdf
    Untracked:  analysis/linearReg.Rmd
    Untracked:  bglr-f.R
    Untracked:  cnn.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/hist_data_f.Rds
    Untracked:  data/hist_data_m.Rds
    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:  m-cor.png
    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/allHist2.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/top3.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/allHist.Rmd) and HTML (docs/allHist.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
html debb4cd nklimko 2023-08-25 Build site.
html d7f9155 nklimko 2023-08-25 Build site.
Rmd 2c78f8a nklimko 2023-08-25 wflow_publish(“analysis/allHist.Rmd”)
html a64ae81 nklimko 2023-08-15 Build site.
Rmd 3505b00 nklimko 2023-08-15 wflow_publish(“analysis/allHist.Rmd”)

ggTidy <- function(data){
  
  for(i in 1:dim(data)[2]){
    
    name <- colnames(data)[i]
    temp <- cbind(rep(name, dim(data)[1]), data[,i, with=FALSE])
    
    if(i==1){
      hold <- temp
    } else{
      hold <- rbind(hold, temp, use.names=FALSE)
    }
  }
  colnames(hold) <- c("method", "cor")
  
  return(hold)
}

filt <- function(data, method){
  
  if(method=="sr"){
    col <- 1
    return(unlist(data[col, ]))
  } else if(method=="nested"){
    hold <- vector(length=50)
    for(i in 1:length(data)){
      hold[i] <- data[[i]]$cor 
    }
    return(hold)
  } else if(method=='top3'){
    col <- 1
    start <- 1
    skip <- 16
    
    raw <- unlist(data[col, ])
    trim <- raw[seq(start, length(raw), by=skip)]
    
    return(trim)
  } else{
    print('Method not recognized.')
    return(NA)
  }
}

The following methods are currently implemented:

  • Mr. Mash

  • GBLUP

  • BayesC

addNewData <- 1

if(addNewData){
  #READ IN
  raw_sr_rf <- readRDS("snake/data/sr/30_summary/rf_f.Rds")
  raw_sr_pcr <- readRDS("snake/data/sr/30_summary/pcr_f.Rds")
  raw_sr_varbvs <- readRDS("snake/data/20_cor/varbvs_f_starvation.Rds")
  
  raw_sr_bayesC <- readRDS("snake/data/sr/30_summary/bayesC_0.9_f.Rds")
  raw_top3_bayesC <- readRDS('snake/data/top3/30_summary/multibayesC_f_top3.Rds')
  #raw_top3_gblup <- readRDS('snake/data/top3/30_summary/multibayesC_f.Rds')
  
  raw_sr_gblup <- readRDS("snake/data/20_cor/gblup_f_starvation.Rds")
  raw_top3_gblup <- readRDS('snake/data/top3/30_summary/multigblup_f_top3.Rds')
  #raw_top3_gblup <- readRDS('snake/data/top3/30_summary/multigblup_f.Rds')
  
  raw_sr_rr <- readRDS("snake/data/20_cor/rr_f_starvation.Rds")
  raw_sr_lasso <- readRDS("snake/data/20_cor/lasso_f_starvation.Rds")
  raw_top3_lasso <- readRDS("snake/data/top3/30_summary/mlasso_f.Rds")
  
  #raw_top3_mash <- readRDS('snake/data/top3/30_summary/mash_f.Rds')
  raw_top3_mash <- readRDS('snake/data/top3/30_summary/mr.mash_f_top3.Rds')
  raw_top3_datamash <- readRDS('snake/data/top3/30_summary/datadrive_f.Rds')
  
  raw_sr_nn <-readRDS('snake/data/sr/30_summary/nn_f.Rds')
  raw_sr_pcr <- readRDS('snake/data/sr/30_summary/pcr_f.Rds')
  
  
  #FILTER
  sr_rf <- filt(raw_sr_rf, "sr")
  sr_pcr <- filt(raw_sr_pcr, "sr")
  sr_varbvs <- filt(raw_sr_varbvs, "nested")
  
  sr_bayesC <- filt(raw_sr_bayesC, "sr")
  top3_bayesC <- filt(raw_top3_bayesC, "top3")
  
  sr_gblup <- filt(raw_sr_gblup, "nested")
  top3_gblup <- filt(raw_top3_gblup, "top3")
  
  sr_rr <- filt(raw_sr_rr, "nested")
  sr_lasso <- filt(raw_sr_lasso, "nested")
  top3_lasso <- filt(raw_top3_lasso, "top3")
  
  top3_mash <- filt(raw_top3_mash, "top3")
  top3_datamash <- filt(raw_top3_datamash, "top3")
  
  sr_nn <- filt(raw_sr_nn, "sr")
  sr_pcr <- filt(raw_sr_pcr, "sr")
  
  allData <- data.table(sr_rf, sr_pcr, sr_nn, sr_varbvs, sr_bayesC,
                        top3_bayesC, sr_gblup, top3_gblup,
                        sr_rr, sr_lasso, top3_lasso, top3_mash,
                        top3_datamash)
  
  saveRDS(allData, "data/hist_data_f.Rds")
  
}
allData <- readRDS("data/hist_data_f.Rds")
print(colMeans(allData))
        sr_rf        sr_pcr         sr_nn     sr_varbvs     sr_bayesC 
   0.36402243    0.45831216   -0.01710806    0.41300077    0.31800121 
  top3_bayesC      sr_gblup    top3_gblup         sr_rr      sr_lasso 
   0.25436812    0.27998224    0.30159686    0.28108963    0.34736423 
   top3_lasso     top3_mash top3_datamash 
   0.18794887    0.09036488    0.13114167 
data <- ggTidy(allData)

#graphing----
iter <- 50

data$method <- factor(data$method, levels=unique(data$method))

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',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)
addNewData <- 1

if(addNewData){
  #READ IN
  raw_sr_rf <- readRDS("snake/data/sr/30_summary/rf_m.Rds")
  raw_sr_pcr <- readRDS("snake/data/sr/30_summary/pcr_m.Rds")
  raw_sr_varbvs <- readRDS("snake/data/20_cor/varbvs_m_starvation.Rds")
  
  raw_sr_bayesC <- readRDS("snake/data/sr/30_summary/bayesC_0.9_m.Rds")
  raw_top3_bayesC <- readRDS('snake/data/top3/30_summary/multibayesC_m_top3.Rds')
  #raw_top3_gblup <- readRDS('snake/data/top3/30_summary/multibayesC_m.Rds')
  
  raw_sr_gblup <- readRDS("snake/data/20_cor/gblup_m_starvation.Rds")
  raw_top3_gblup <- readRDS('snake/data/top3/30_summary/multigblup_m_top3.Rds')
  #raw_top3_gblup <- readRDS('snake/data/top3/30_summary/multigblup_m.Rds')
  
  raw_sr_rr <- readRDS("snake/data/20_cor/rr_m_starvation.Rds")
  raw_sr_lasso <- readRDS("snake/data/20_cor/lasso_m_starvation.Rds")
  raw_top3_lasso <- readRDS("snake/data/top3/30_summary/mlasso_m.Rds")
  
  #raw_top3_mash <- readRDS('snake/data/top3/30_summary/mash_m.Rds')
  raw_top3_mash <- readRDS('snake/data/top3/30_summary/mr.mash_m_top3.Rds')
  raw_top3_datamash <- readRDS('snake/data/top3/30_summary/datadrive_m.Rds')
  
  raw_sr_nn <-readRDS('snake/data/sr/30_summary/nn_m.Rds')
  raw_sr_pcr <- readRDS('snake/data/sr/30_summary/pcr_m.Rds')
  
  #FILTER
  sr_rf <- filt(raw_sr_rf, "sr")
  sr_pcr <- filt(raw_sr_pcr, "sr")
  sr_varbvs <- filt(raw_sr_varbvs, "nested")
  
  sr_bayesC <- filt(raw_sr_bayesC, "sr")
  top3_bayesC <- filt(raw_top3_bayesC, "top3")
  
  sr_gblup <- filt(raw_sr_gblup, "nested")
  top3_gblup <- filt(raw_top3_gblup, "top3")
  
  sr_rr <- filt(raw_sr_rr, "nested")
  sr_lasso <- filt(raw_sr_lasso, "nested")
  top3_lasso <- filt(raw_top3_lasso, "top3")
  
  top3_mash <- filt(raw_top3_mash, "top3")
  top3_datamash <- filt(raw_top3_datamash, "top3")
  sr_nn <- filt(raw_sr_nn, "sr")
  
  allData <- data.table(sr_rf, sr_pcr, sr_nn, sr_varbvs, sr_bayesC,
                        top3_bayesC, sr_gblup, top3_gblup,
                        sr_rr, sr_lasso, top3_lasso, top3_mash,
                        top3_datamash)
  
  saveRDS(allData, "data/hist_data_m.Rds")
}
allData <- readRDS("data/hist_data_m.Rds")
print(colMeans(allData))
        sr_rf        sr_pcr         sr_nn     sr_varbvs     sr_bayesC 
  0.381755740   0.528333785  -0.009744473   0.255439602   0.431298902 
  top3_bayesC      sr_gblup    top3_gblup         sr_rr      sr_lasso 
  0.352033267   0.349139906   0.365246159   0.362573999   0.246061992 
   top3_lasso     top3_mash top3_datamash 
  0.090795620   0.252217985   0.276341392 
data <- ggTidy(allData)

#graphing----
iter <- 50

data$method <- factor(data$method, levels=unique(data$method))

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',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)

Female Correlation

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

Version Author Date
d7f9155 nklimko 2023-08-25
a64ae81 nklimko 2023-08-15

Male Correlation

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

Version Author Date
d7f9155 nklimko 2023-08-25
a64ae81 nklimko 2023-08-15

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] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] reshape2_1.4.4    melt_1.10.0       ggcorrplot_0.1.4  lubridate_1.9.2  
 [5] forcats_1.0.0     stringr_1.5.0     purrr_1.0.1       readr_2.1.4      
 [9] tidyr_1.3.0       tibble_3.2.1      tidyverse_2.0.0   scales_1.2.1     
[13] viridis_0.6.2     viridisLite_0.4.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.11       getPass_0.2-2     ps_1.7.5          rprojroot_2.0.3  
 [5] digest_0.6.33     utf8_1.2.3        plyr_1.8.8        R6_2.5.1         
 [9] evaluate_0.21     httr_1.4.5        highr_0.10        pillar_1.9.0     
[13] rlang_1.1.1       rstudioapi_0.15.0 whisker_0.4.1     callr_3.7.3      
[17] jquerylib_0.1.4   rmarkdown_2.23    labeling_0.4.2    munsell_0.5.0    
[21] compiler_4.1.2    httpuv_1.6.9      xfun_0.39         pkgconfig_2.0.3  
[25] htmltools_0.5.5   tidyselect_1.2.0  gridExtra_2.3     fansi_1.0.4      
[29] calibrate_1.7.7   tzdb_0.3.0        withr_2.5.0       later_1.3.1      
[33] MASS_7.3-60       grid_4.1.2        jsonlite_1.8.7    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.8      farver_2.1.1      fs_1.6.3         
[45] promises_1.2.0.1  bslib_0.5.0       generics_0.1.3    vctrs_0.6.2      
[49] tools_4.1.2       glue_1.6.2        hms_1.1.3         processx_3.8.2   
[53] fastmap_1.1.1     yaml_2.3.7        timechange_0.2.0  colorspace_2.1-0 
[57] knitr_1.43        sass_0.4.7