Last updated: 2022-11-15

Checks: 7 0

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.

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 afd22f8. 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:


Untracked files:
    Untracked:  code/analysisSR.R
    Untracked:  code/geneGO.R
    Untracked:  code/multiPrep.R
    Untracked:  code/snpGene.77509.err
    Untracked:  code/snpGene.77509.out
    Untracked:  code/snpGene.77515.err
    Untracked:  code/snpGene.77515.out
    Untracked:  code/snpGene.sbatch
    Untracked:  data/eQTL_traits_females.csv
    Untracked:  data/eQTL_traits_males.csv
    Untracked:  data/goGroups.txt

Unstaged changes:
    Deleted:    analysis/database.Rmd
    Modified:   code/baseScript-lineComp.R
    Modified:   code/fourLinePrep.R

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/multiComp.Rmd) and HTML (docs/multiComp.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 afd22f8 nklimko 2022-11-15 wflow_publish("analysis/*")
html 79e98ca nklimko 2022-11-15 Build site.
Rmd ca79c22 nklimko 2022-11-15 wflow_publish("analysis/*")

# Read in tables
dtf <- fread("data/eQTL_traits_females.csv")
dtm <- fread("data/eQTL_traits_males.csv")

#Change column order to line, starvation, everything else
setcolorder(dtf, c(1,10,2:9,11:19))
#male has aggression moved to end to line up all other column indices
setcolorder(dtm, c(1,11,3:10,12:20,2))

# Bind tables on line
bound <- dtm[dtf, on=.(line)]

colnames(bound)
 [1] "line"                "starvation"          "cafe"               
 [4] "chillcoma"           "day.bout.number"     "day.sleep"          
 [7] "night.bout.number"   "night.sleep"         "phototaxis.4day"    
[10] "startle"             "waking.activity"     "free.glucose"       
[13] "glycogen"            "free.glycerol"       "triglyceride"       
[16] "protein"             "body.weight"         "thorax.length"      
[19] "thorax.width"        "aggression"          "i.starvation"       
[22] "i.cafe"              "i.chillcoma"         "i.day.bout.number"  
[25] "i.day.sleep"         "i.night.bout.number" "i.night.sleep"      
[28] "i.phototaxis.4day"   "i.startle"           "i.waking.activity"  
[31] "i.free.glucose"      "i.glycogen"          "i.free.glycerol"    
[34] "i.triglyceride"      "i.protein"           "i.body.weight"      
[37] "i.thorax.length"     "i.thorax.width"     
# create average starvation
x <- (bound[,2,with=FALSE] + bound[,21,with=FALSE]) / 2

storage <- rep(0,20)
gg <- vector(mode='list', length=18)

  # AGGRESSION, male only


yL <- colnames(bound[, 20, with=FALSE])

x <- bound[,2] 
y <- bound[,20]
raw <- na.omit(cbind(x,y))
clean <- setDT(raw)
colnames(clean) <- c("starvation", "trait")

corCoeff <- str_sub(as.character(cor.test(clean$starvation, clean$trait)[4]), 8,16)
storage[1] <- as.numeric(corCoeff)

graphTitle <- paste0(colnames(bound[, 20, with=FALSE]),": R=",corCoeff)

gg[[1]] <- ggplot(clean, aes(x=starvation, y=trait)) +
  geom_point() +
  geom_smooth(formula = y ~ x, method=lm) +
  labs(title = graphTitle, x="starvation",y=yL)

# Determine average of each trait
for(i in 3:19)
{
  #title <- paste("starvation resistance vs",colnames(bound[, i, with=FALSE]))
  j <- i + 19
  y <- (bound[,i,with=FALSE] + bound[,j,with=FALSE]) / 2


yL <- colnames(bound[, i, with=FALSE])

raw <- na.omit(cbind(x,y))
clean <- setDT(raw)
colnames(clean) <- c("starvation", "trait")


corCoeff <- str_sub(as.character(cor.test(clean$starvation, clean$trait)[4]), 8,16)
storage[i-1] <- as.numeric(corCoeff)

graphTitle <- paste0(colnames(bound[, i, with=FALSE]),": R=",corCoeff)

gg[[i-1]] <- ggplot(clean, aes(x=starvation, y=trait)) +
  geom_point() +
  geom_smooth(formula = y ~ x, method=lm) +
  labs(title = graphTitle, x="starvation",y=yL)
  
  
}

par(mfrow=c(2,2))
plot_grid(gg[[1]],gg[[2]],gg[[3]],gg[[4]],ncol=2)
Warning in grid.Call.graphics(C_polygon, x$x, x$y, index): semi-transparency is
not supported on this device: reported only once per page

Version Author Date
79e98ca nklimko 2022-11-15
plot_grid(gg[[5]],gg[[6]],gg[[7]],gg[[8]],ncol=2)
Warning in grid.Call.graphics(C_polygon, x$x, x$y, index): semi-transparency is
not supported on this device: reported only once per page

Version Author Date
79e98ca nklimko 2022-11-15
plot_grid(gg[[9]],gg[[10]],gg[[11]],gg[[12]],ncol=2)
Warning in grid.Call.graphics(C_polygon, x$x, x$y, index): semi-transparency is
not supported on this device: reported only once per page

Version Author Date
79e98ca nklimko 2022-11-15
plot_grid(gg[[13]],gg[[14]],gg[[15]],gg[[16]],ncol=2)
Warning in grid.Call.graphics(C_polygon, x$x, x$y, index): semi-transparency is
not supported on this device: reported only once per page

Version Author Date
79e98ca nklimko 2022-11-15
plot_grid(gg[[17]])
Warning in grid.Call.graphics(C_polygon, x$x, x$y, index): semi-transparency is
not supported on this device: reported only once per page

Version Author Date
79e98ca nklimko 2022-11-15

About


sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /opt/ohpc/pub/Software/openblas_0.3.10/lib/libopenblas_haswellp-r0.3.10.dev.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] cowplot_1.1.1     ggplot2_3.3.5     data.table_1.14.2 stringr_1.4.0    
[5] dplyr_1.0.8       workflowr_1.7.0  

loaded via a namespace (and not attached):
 [1] tidyselect_1.1.2 xfun_0.30        bslib_0.3.1      purrr_0.3.4     
 [5] lattice_0.20-45  splines_4.0.3    colorspace_2.0-3 vctrs_0.4.1     
 [9] generics_0.1.2   htmltools_0.5.2  mgcv_1.8-40      yaml_2.3.5      
[13] utf8_1.2.2       rlang_1.0.4      later_1.3.0      pillar_1.7.0    
[17] jquerylib_0.1.4  withr_2.5.0      glue_1.6.2       DBI_1.1.2       
[21] lifecycle_1.0.1  munsell_0.5.0    gtable_0.3.0     evaluate_0.15   
[25] labeling_0.4.2   knitr_1.38       callr_3.7.0      fastmap_1.1.0   
[29] httpuv_1.6.5     ps_1.6.0         fansi_1.0.3      highr_0.9       
[33] Rcpp_1.0.8.3     promises_1.2.0.1 scales_1.2.0     jsonlite_1.8.0  
[37] farver_2.1.0     fs_1.5.2         digest_0.6.29    stringi_1.7.6   
[41] processx_3.5.3   getPass_0.2-2    rprojroot_2.0.3  grid_4.0.3      
[45] cli_3.3.0        tools_4.0.3      magrittr_2.0.3   sass_0.4.1      
[49] tibble_3.1.6     crayon_1.5.1     whisker_0.4      pkgconfig_2.0.3 
[53] Matrix_1.4-1     ellipsis_0.3.2   assertthat_0.2.1 rmarkdown_2.16  
[57] httr_1.4.2       rstudioapi_0.13  R6_2.5.1         nlme_3.1-157    
[61] git2r_0.30.1     compiler_4.0.3