Last updated: 2023-01-23

Checks: 7 0

Knit directory: Cardiotoxicity/

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(20230109) 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 dc890ec. 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:    .RData
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    analysis/figure/
    Ignored:    data/.txt
    Ignored:    data/allgenes.txt
    Ignored:    data/backGL.txt
    Ignored:    data/data_outline.txt
    Ignored:    data/filenameonly.txt
    Ignored:    data/mymatrix.RDS
    Ignored:    data/sigVDA24.txt
    Ignored:    data/sigVDA3.txt
    Ignored:    data/sigVDX24.txt
    Ignored:    data/sigVDX3.txt
    Ignored:    data/sigVEP24.txt
    Ignored:    data/sigVEP3.txt
    Ignored:    data/sigVMT24.txt
    Ignored:    data/sigVMT3.txt
    Ignored:    data/sigVTR24.txt
    Ignored:    data/sigVTR3.txt

Untracked files:
    Untracked:  analysis/.txt
    Untracked:  reneebasecode.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/GO_analysis.Rmd) and HTML (docs/GO_analysis.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 dc890ec reneeisnowhere 2023-01-23 Updating the source dir
Rmd a78eab0 reneeisnowhere 2023-01-23 updated Go analysis
Rmd d9edc06 reneeisnowhere 2023-01-20 try a little update later
Rmd b7eac76 reneeisnowhere 2023-01-20 updating GO
html 6c21cf8 reneeisnowhere 2023-01-20 Build site.
Rmd 443a9f3 reneeisnowhere 2023-01-20 adding in GO analysis

GO Analysis

I have created several files from the RNA analysis that contain the significant genes(determined by adj.P.val < 0.1) from each Time and Condition. The names of the files are in the following format: ‘sigV’+Drug(2 letters)+time.

example: ‘sigVDA3.txt’ means this file contains the significant DE genes from the Daunorubicin 3 hour compared to Vehicle Control 3 hour analysis

library(gprofiler2)
library(tidyverse)
library(readr)
library(BiocGenerics)
library(gridExtra)

The analysis is based on all genes that passed the rowMeans>0 from the previous page[] (https://reneeisnowhere.github.io/Cardiotoxicity/RNAseqrun_1_analysis.html)

a note of working dir for me, remember that rmd files render from its working dir, therefore relative files need to do the /.. to get to the right relative dir.

I first looked at the data setting ‘measure_underrepresentation = TRUE’ in this interactive plot with all genes from the sigDA3 dataset

then I looked at the same data with ‘measure_underrepresentation = FALSE’

Analysis of Up versus Down

I then separated the VDA3 file by log2 Fold Change to see how the gene sets are enriched.

p2_down <- gostplot(gp_down, capped = FALSE, interactive = TRUE)

p2_down #+ ggtitle("Duanorubicin down regulated gene enrichment at 3 hours")

Graphing specific gene expression

apple <- c('CDKN1A',"BBC3", "MDM2", "BCL2", "BAX", "GPX1", 'MFN2')#,"HAS3",'CYBA','TOP2B', 'TP53', 'ABCC1', 'ABCC5', 'RRAGD', 'DUSP13', 'NDUFAF1', 'TDP2', 'TXNIP','BRCA1', 'CTCF','RAD21','RYR2')
##find the index number for each gene
indices <- match(apple, x$genes$SYMBOL)
###subset the matrix
entreset <- x$genes$ENTREZID[indices]
gnames <- cbind(entreset,apple)
colnames(gnames) <- c("ENTREZID","SYMBOL" )


## Now to investigate specific gene expression and analyse similar vs difference of genes up and down between drug "classes"  (anthracycline vs non-anthracycline).
The nextstep is to make plots of all the genes you want to see.  I am stopping here, because I would like to add 
for (gn in indices){
  print(Da24counts %>% filter(Tags == gn) %>% ggplot(aes(x=as.factor(Samples), y=Freq))+
  geom_boxplot(aes(fill = as.factor(Samples)))+
    theme_cowplot(font_size =12,)+
    
    ggtitle(paste0(gnames$gnames," expression in Daunorubicin at 24 hours"))+
    
    labs(y = "Log2(cpm)",x= "", fill = "Treatment"))
}
`{r}
plot_function <- function(index, df) {
  for (i in index) {
    data <- df %>% filter(ENTREZID == i)
    if (!nrow(data)) next
   print(data %>% ggplot(aes(x=as.factor(Samples), y=Counts))+
            geom_boxplot(aes(fill = as.factor(Samples)))+
            theme_cowplot(font_size =12,)+
            ggtitle(paste0(i," expression "))+
            
            labs(y = "Log2(cpm)",x= "", fill = "Treatment")) 
    }
}

apple <- as.data.frame(sigVDA24$ENTREZID)


plot_function(apple,Dx3counts)+theme(axis.text.x = element_text(size= 8,angle = 90))+scale_x_discrete(labels=ENTREZID)

sessionInfo()
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

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

other attached packages:
 [1] gridExtra_2.3       BiocGenerics_0.42.0 forcats_0.5.2      
 [4] stringr_1.5.0       dplyr_1.0.10        purrr_1.0.1        
 [7] readr_2.1.3         tidyr_1.2.1         tibble_3.1.8       
[10] ggplot2_3.4.0       tidyverse_1.3.2     gprofiler2_0.2.1   
[13] workflowr_1.7.0    

loaded via a namespace (and not attached):
 [1] bitops_1.0-7        fs_1.5.2            lubridate_1.9.0    
 [4] bit64_4.0.5         httr_1.4.4          rprojroot_2.0.3    
 [7] tools_4.2.2         backports_1.4.1     bslib_0.4.2        
[10] utf8_1.2.2          R6_2.5.1            DBI_1.1.3          
[13] lazyeval_0.2.2      colorspace_2.0-3    withr_2.5.0        
[16] tidyselect_1.2.0    processx_3.8.0      bit_4.0.5          
[19] compiler_4.2.2      git2r_0.30.1        cli_3.6.0          
[22] rvest_1.0.3         xml2_1.3.3          plotly_4.10.1      
[25] labeling_0.4.2      sass_0.4.4          scales_1.2.1       
[28] callr_3.7.3         digest_0.6.31       rmarkdown_2.20     
[31] pkgconfig_2.0.3     htmltools_0.5.4     highr_0.10         
[34] dbplyr_2.3.0        fastmap_1.1.0       htmlwidgets_1.6.1  
[37] rlang_1.0.6         readxl_1.4.1        rstudioapi_0.14    
[40] shiny_1.7.4         jquerylib_0.1.4     generics_0.1.3     
[43] jsonlite_1.8.4      crosstalk_1.2.0     vroom_1.6.0        
[46] googlesheets4_1.0.1 RCurl_1.98-1.9      magrittr_2.0.3     
[49] Rcpp_1.0.9          munsell_0.5.0       fansi_1.0.3        
[52] lifecycle_1.0.3     stringi_1.7.12      whisker_0.4.1      
[55] yaml_2.3.6          grid_4.2.2          parallel_4.2.2     
[58] promises_1.2.0.1    crayon_1.5.2        haven_2.5.1        
[61] hms_1.1.2           knitr_1.41          ps_1.7.2           
[64] pillar_1.8.1        reprex_2.0.2        glue_1.6.2         
[67] evaluate_0.20       getPass_0.2-2       data.table_1.14.6  
[70] modelr_0.1.10       vctrs_0.5.1         tzdb_0.3.0         
[73] httpuv_1.6.8        cellranger_1.1.0    gtable_0.3.1       
[76] assertthat_0.2.1    cachem_1.0.6        xfun_0.36          
[79] mime_0.12           xtable_1.8-4        broom_1.0.2        
[82] later_1.3.0         googledrive_2.0.0   viridisLite_0.4.1  
[85] gargle_1.2.1        timechange_0.2.0    ellipsis_0.3.2