Last updated: 2025-05-22

Checks: 7 0

Knit directory: CX5461_Project/

This reproducible R Markdown analysis was created with workflowr (version 1.7.1). 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(20250129) 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 ae21d3a. 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:    0.1 box.svg
    Ignored:    Rplot04.svg
    Ignored:    analysis/Corrmotif_Conc.html
    Ignored:    analysis/DGE_Analysis.html

Untracked files:
    Untracked:  0.1 density.svg
    Untracked:  0.1.emf
    Untracked:  0.1.svg
    Untracked:  0.5 box.svg
    Untracked:  0.5 density.svg
    Untracked:  0.5.svg
    Untracked:  Additional/
    Untracked:  CX_5461_Pattern_Genes_24hr.csv
    Untracked:  CX_5461_Pattern_Genes_3hr.csv
    Untracked:  Cell viability box plot.svg
    Untracked:  DRC1.svg
    Untracked:  Figure 1.jpeg
    Untracked:  Figure 1.pdf
    Untracked:  Figure_CM_Purity.pdf
    Untracked:  Rplot.svg
    Untracked:  Rplot01.svg
    Untracked:  Rplot02.svg
    Untracked:  Rplot03.svg
    Untracked:  Rplot05.svg
    Untracked:  Rplot06.svg
    Untracked:  Rplot07.svg
    Untracked:  Rplot08.jpeg
    Untracked:  Rplot08.svg
    Untracked:  Rplot09.svg
    Untracked:  Rplot10.svg
    Untracked:  Rplot11.svg
    Untracked:  TOP2B.bed
    Untracked:  TS HPA (Violin).svg
    Untracked:  TS HPA.svg
    Untracked:  TS_HA.svg
    Untracked:  TS_HV.svg
    Untracked:  Violin HA.svg
    Untracked:  Violin HV (CX vs DOX).svg
    Untracked:  Violin HV.svg
    Untracked:  data/AF.csv
    Untracked:  data/AF_Mapped.csv
    Untracked:  data/AF_genes.csv
    Untracked:  data/Annotated_DOX_Gene_Table.csv
    Untracked:  data/CAD_genes.csv
    Untracked:  data/Cardiotox.csv
    Untracked:  data/Cardiotox_mapped.csv
    Untracked:  data/DOX_Vald.csv
    Untracked:  data/DOX_Vald_Mapped.csv
    Untracked:  data/DOX_alt.csv
    Untracked:  data/Entrez_Cardiotox.csv
    Untracked:  data/Entrez_Cardiotox_Mapped.csv
    Untracked:  data/GWAS.xlsx
    Untracked:  data/GWAS_SNPs.bed
    Untracked:  data/HF.csv
    Untracked:  data/HF_Mapped.csv
    Untracked:  data/HF_genes.csv
    Untracked:  data/Hypertension_genes.csv
    Untracked:  data/MI_genes.csv
    Untracked:  data/P53_Target_mapped.csv
    Untracked:  data/Sample_annotated.csv
    Untracked:  data/Samples.csv
    Untracked:  data/Samples.xlsx
    Untracked:  data/TOP2A.bed
    Untracked:  data/TOP2A_target.csv
    Untracked:  data/TOP2A_target_lit.csv
    Untracked:  data/TOP2A_target_lit_mapped.csv
    Untracked:  data/TOP2A_target_mapped.csv
    Untracked:  data/TOP2B.bed
    Untracked:  data/TOP2B_target.csv
    Untracked:  data/TOP2B_target_heatmap.csv
    Untracked:  data/TOP2B_target_heatmap_mapped.csv
    Untracked:  data/TOP2B_target_mapped.csv
    Untracked:  data/TS.csv
    Untracked:  data/TS_HPA.csv
    Untracked:  data/TS_HPA_mapped.csv
    Untracked:  data/Toptable_CX_0.1_24.csv
    Untracked:  data/Toptable_CX_0.1_3.csv
    Untracked:  data/Toptable_CX_0.1_48.csv
    Untracked:  data/Toptable_CX_0.5_24.csv
    Untracked:  data/Toptable_CX_0.5_3.csv
    Untracked:  data/Toptable_CX_0.5_48.csv
    Untracked:  data/Toptable_DOX_0.1_24.csv
    Untracked:  data/Toptable_DOX_0.1_3.csv
    Untracked:  data/Toptable_DOX_0.1_48.csv
    Untracked:  data/Toptable_DOX_0.5_24.csv
    Untracked:  data/Toptable_DOX_0.5_3.csv
    Untracked:  data/Toptable_DOX_0.5_48.csv
    Untracked:  data/count.tsv
    Untracked:  data/ts_data_mapped
    Untracked:  results/
    Untracked:  run_bedtools.bat

Unstaged changes:
    Deleted:    analysis/Actox.Rmd
    Modified:   data/count.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/Correlation_Heatmap_of_Samples.Rmd) and HTML (docs/Correlation_Heatmap_of_Samples.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 ae21d3a sayanpaul01 2025-05-22 Commit
html ae21d3a sayanpaul01 2025-05-22 Commit
html 1f78838 sayanpaul01 2025-02-02 Build site.
html 8174820 sayanpaul01 2025-02-02 Build site.
Rmd 2add0dc sayanpaul01 2025-02-02 Added correlation heatmap analysis
html 51d11b3 sayanpaul01 2025-02-02 Build site.
Rmd e3ba601 sayanpaul01 2025-02-02 Added Correlation Heatmap of Samples

📌 Correlation Heatmap of Samples

This analysis generates Pearson and Spearman correlation heatmaps to explore relationships between RNA-seq samples.


📌 Load Required Libraries

# Load required libraries
library(ComplexHeatmap)
Warning: package 'ComplexHeatmap' was built under R version 4.3.1
library(circlize)  # For color mapping
Warning: package 'circlize' was built under R version 4.3.3
library(dplyr)
Warning: package 'dplyr' was built under R version 4.3.2
library(edgeR)
Warning: package 'edgeR' was built under R version 4.3.2
Warning: package 'limma' was built under R version 4.3.1
library(ggplot2)
library(reshape2)
library(Biobase)
Warning: package 'Biobase' was built under R version 4.3.1
Warning: package 'BiocGenerics' was built under R version 4.3.1
library(limma)
library(tidyverse)
Warning: package 'tidyverse' was built under R version 4.3.2
Warning: package 'tidyr' was built under R version 4.3.3
Warning: package 'readr' was built under R version 4.3.3
Warning: package 'purrr' was built under R version 4.3.3
Warning: package 'stringr' was built under R version 4.3.2
Warning: package 'lubridate' was built under R version 4.3.3
library(scales)
Warning: package 'scales' was built under R version 4.3.2
library(biomaRt)
Warning: package 'biomaRt' was built under R version 4.3.2
library(ggrepel)
Warning: package 'ggrepel' was built under R version 4.3.3
library(corrplot)
Warning: package 'corrplot' was built under R version 4.3.3
library(Hmisc)
Warning: package 'Hmisc' was built under R version 4.3.3
library(org.Hs.eg.db)
Warning: package 'AnnotationDbi' was built under R version 4.3.2
Warning: package 'IRanges' was built under R version 4.3.1
Warning: package 'S4Vectors' was built under R version 4.3.2
library(AnnotationDbi)
library(tidyr)
library(ggfortify)

📍 Load Count Matrix

📌Data Preparation

# Ensure the correct column names are assigned
lcpm_2 <- filcpm_matrix
colnames(lcpm_2) <- Metadata$Sample_name

# Compute correlation matrices
cor_matrix_pearson <- cor(lcpm_2, method = "pearson")
cor_matrix_spearman <- cor(lcpm_2, method = "spearman")

# Extract metadata columns
individuals    <- as.character(Metadata$Ind)
timepoints     <- as.character(Metadata$Time)
drugs          <- as.character(Metadata$Drug)
concentrations <- as.character(Metadata$Conc.)
sex            <- as.character(Metadata$Sex) 

# Define color palettes for annotations
ind_colors <- c("1" = "red", "2" = "blue", "3" = "green", "4" = "orange", "5" = "thistle", "6" = "magenta4")
time_colors <- c("3" = "purple", "24" = "pink", "48" = "tomato3")
drug_colors <- c("CX-5461" = "yellow", "DOX" = "magenta4", "VEH" = "red3")
conc_colors <- c("0.1" = "lightblue", "0.5" = "lightcoral")

sex_colors <- c("Male" = "skyblue3", "Female" = "deeppink3")

# Create annotations
top_annotation <- HeatmapAnnotation(
  individuals = individuals,
  sex = sex,  # New annotation
  timepoints = timepoints,
  drugs = drugs,
  concentrations = concentrations,
  col = list(
    individuals = ind_colors,
    sex = sex_colors,  # Link sex to palette
    timepoints = time_colors,
    drugs = drug_colors,
    concentrations = conc_colors
  ),
  annotation_legend_param = list(
    sex = list(title = "Sex"),
    individuals = list(title = "Individual"),
    timepoints = list(title = "Time"),
    drugs = list(title = "Drug"),
    concentrations = list(title = "Concentration")
  )
)

📌Pearson Correlation Heatmap

# Generate the heatmap with annotations (Pearson Correlation)
heatmap_pearson <- Heatmap(cor_matrix_pearson,
                           name = "Pearson Correlation",
                           top_annotation = top_annotation,
                           show_row_names = TRUE,
                           show_column_names = TRUE,
                           cluster_rows = TRUE,
                           cluster_columns = TRUE)


# Draw the heatmap
draw(heatmap_pearson)

Version Author Date
ae21d3a sayanpaul01 2025-05-22
8174820 sayanpaul01 2025-02-02
51d11b3 sayanpaul01 2025-02-02

📌Spearman Correlation Heatmap

# Generate the heatmap with annotations (Spearman Correlation)
heatmap_spearman <- Heatmap(cor_matrix_spearman,
                            name = "Spearman Correlation",
                            top_annotation = top_annotation,
                            show_row_names = TRUE,
                            show_column_names = TRUE,
                            cluster_rows = TRUE,
                            cluster_columns = TRUE)
# Draw the heatmap
draw(heatmap_spearman)

Version Author Date
ae21d3a sayanpaul01 2025-05-22
8174820 sayanpaul01 2025-02-02
51d11b3 sayanpaul01 2025-02-02

sessionInfo()
R version 4.3.0 (2023-04-21 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 26100)

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    

time zone: America/Chicago
tzcode source: internal

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

other attached packages:
 [1] ggfortify_0.4.17      org.Hs.eg.db_3.18.0   AnnotationDbi_1.64.1 
 [4] IRanges_2.36.0        S4Vectors_0.40.2      Hmisc_5.2-3          
 [7] corrplot_0.95         ggrepel_0.9.6         biomaRt_2.58.2       
[10] scales_1.3.0          lubridate_1.9.4       forcats_1.0.0        
[13] stringr_1.5.1         purrr_1.0.4           readr_2.1.5          
[16] tidyr_1.3.1           tibble_3.2.1          tidyverse_2.0.0      
[19] Biobase_2.62.0        BiocGenerics_0.48.1   reshape2_1.4.4       
[22] ggplot2_3.5.2         edgeR_4.0.16          limma_3.58.1         
[25] dplyr_1.1.4           circlize_0.4.16       ComplexHeatmap_2.18.0
[28] workflowr_1.7.1      

loaded via a namespace (and not attached):
  [1] DBI_1.2.3               bitops_1.0-9            gridExtra_2.3          
  [4] rlang_1.1.3             magrittr_2.0.3          clue_0.3-66            
  [7] GetoptLong_1.0.5        git2r_0.36.2            matrixStats_1.5.0      
 [10] compiler_4.3.0          RSQLite_2.3.9           getPass_0.2-4          
 [13] png_0.1-8               callr_3.7.6             vctrs_0.6.5            
 [16] pkgconfig_2.0.3         shape_1.4.6.1           crayon_1.5.3           
 [19] fastmap_1.2.0           magick_2.8.6            backports_1.5.0        
 [22] dbplyr_2.5.0            XVector_0.42.0          promises_1.3.2         
 [25] rmarkdown_2.29          tzdb_0.5.0              ps_1.8.1               
 [28] bit_4.6.0               xfun_0.52               zlibbioc_1.48.2        
 [31] cachem_1.1.0            GenomeInfoDb_1.38.8     jsonlite_2.0.0         
 [34] progress_1.2.3          blob_1.2.4              later_1.3.2            
 [37] parallel_4.3.0          prettyunits_1.2.0       cluster_2.1.8.1        
 [40] R6_2.6.1                bslib_0.9.0             stringi_1.8.3          
 [43] RColorBrewer_1.1-3      rpart_4.1.24            jquerylib_0.1.4        
 [46] Rcpp_1.0.12             iterators_1.0.14        knitr_1.50             
 [49] base64enc_0.1-3         nnet_7.3-20             httpuv_1.6.15          
 [52] timechange_0.3.0        tidyselect_1.2.1        rstudioapi_0.17.1      
 [55] yaml_2.3.10             doParallel_1.0.17       codetools_0.2-20       
 [58] curl_6.2.2              processx_3.8.6          lattice_0.22-7         
 [61] plyr_1.8.9              withr_3.0.2             KEGGREST_1.42.0        
 [64] evaluate_1.0.3          foreign_0.8-90          BiocFileCache_2.10.2   
 [67] xml2_1.3.8              Biostrings_2.70.3       filelock_1.0.3         
 [70] pillar_1.10.2           whisker_0.4.1           checkmate_2.3.2        
 [73] foreach_1.5.2           generics_0.1.3          rprojroot_2.0.4        
 [76] RCurl_1.98-1.17         hms_1.1.3               munsell_0.5.1          
 [79] glue_1.7.0              tools_4.3.0             data.table_1.17.0      
 [82] locfit_1.5-9.12         fs_1.6.3                XML_3.99-0.18          
 [85] Cairo_1.6-2             colorspace_2.1-0        GenomeInfoDbData_1.2.11
 [88] htmlTable_2.4.3         Formula_1.2-5           cli_3.6.1              
 [91] rappdirs_0.3.3          gtable_0.3.6            sass_0.4.10            
 [94] digest_0.6.34           htmlwidgets_1.6.4       rjson_0.2.23           
 [97] memoise_2.0.1           htmltools_0.5.8.1       lifecycle_1.0.4        
[100] httr_1.4.7              GlobalOptions_0.1.2     statmod_1.5.0          
[103] bit64_4.6.0-1