Last updated: 2025-05-01

Checks: 7 0

Knit directory: ATAC_learning/

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(20231016) 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 9ce3cdd. 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/ACresp_SNP_table.csv
    Ignored:    data/ARR_SNP_table.csv
    Ignored:    data/All_merged_peaks.tsv
    Ignored:    data/CAD_gwas_dataframe.RDS
    Ignored:    data/CTX_SNP_table.csv
    Ignored:    data/Collapsed_expressed_NG_peak_table.csv
    Ignored:    data/DEG_toplist_sep_n45.RDS
    Ignored:    data/FRiP_first_run.txt
    Ignored:    data/Final_four_data/
    Ignored:    data/Frip_1_reads.csv
    Ignored:    data/Frip_2_reads.csv
    Ignored:    data/Frip_3_reads.csv
    Ignored:    data/Frip_4_reads.csv
    Ignored:    data/Frip_5_reads.csv
    Ignored:    data/Frip_6_reads.csv
    Ignored:    data/GO_KEGG_analysis/
    Ignored:    data/HF_SNP_table.csv
    Ignored:    data/Ind1_75DA24h_dedup_peaks.csv
    Ignored:    data/Ind1_TSS_peaks.RDS
    Ignored:    data/Ind1_firstfragment_files.txt
    Ignored:    data/Ind1_fragment_files.txt
    Ignored:    data/Ind1_peaks_list.RDS
    Ignored:    data/Ind1_summary.txt
    Ignored:    data/Ind2_TSS_peaks.RDS
    Ignored:    data/Ind2_fragment_files.txt
    Ignored:    data/Ind2_peaks_list.RDS
    Ignored:    data/Ind2_summary.txt
    Ignored:    data/Ind3_TSS_peaks.RDS
    Ignored:    data/Ind3_fragment_files.txt
    Ignored:    data/Ind3_peaks_list.RDS
    Ignored:    data/Ind3_summary.txt
    Ignored:    data/Ind4_79B24h_dedup_peaks.csv
    Ignored:    data/Ind4_TSS_peaks.RDS
    Ignored:    data/Ind4_V24h_fraglength.txt
    Ignored:    data/Ind4_fragment_files.txt
    Ignored:    data/Ind4_fragment_filesN.txt
    Ignored:    data/Ind4_peaks_list.RDS
    Ignored:    data/Ind4_summary.txt
    Ignored:    data/Ind5_TSS_peaks.RDS
    Ignored:    data/Ind5_fragment_files.txt
    Ignored:    data/Ind5_fragment_filesN.txt
    Ignored:    data/Ind5_peaks_list.RDS
    Ignored:    data/Ind5_summary.txt
    Ignored:    data/Ind6_TSS_peaks.RDS
    Ignored:    data/Ind6_fragment_files.txt
    Ignored:    data/Ind6_peaks_list.RDS
    Ignored:    data/Ind6_summary.txt
    Ignored:    data/Knowles_4.RDS
    Ignored:    data/Knowles_5.RDS
    Ignored:    data/Knowles_6.RDS
    Ignored:    data/LiSiLTDNRe_TE_df.RDS
    Ignored:    data/MI_gwas.RDS
    Ignored:    data/SNP_GWAS_PEAK_MRC_id
    Ignored:    data/SNP_GWAS_PEAK_MRC_id.csv
    Ignored:    data/SNP_gene_cat_list.tsv
    Ignored:    data/SNP_supp_schneider.RDS
    Ignored:    data/TE_info/
    Ignored:    data/TFmapnames.RDS
    Ignored:    data/all_TSSE_scores.RDS
    Ignored:    data/all_four_filtered_counts.txt
    Ignored:    data/aln_run1_results.txt
    Ignored:    data/anno_ind1_DA24h.RDS
    Ignored:    data/anno_ind4_V24h.RDS
    Ignored:    data/annotated_gwas_SNPS.csv
    Ignored:    data/background_n45_he_peaks.RDS
    Ignored:    data/cardiac_muscle_FRIP.csv
    Ignored:    data/cardiomyocyte_FRIP.csv
    Ignored:    data/col_ng_peak.csv
    Ignored:    data/cormotif_full_4_run.RDS
    Ignored:    data/cormotif_full_4_run_he.RDS
    Ignored:    data/cormotif_full_6_run.RDS
    Ignored:    data/cormotif_full_6_run_he.RDS
    Ignored:    data/cormotif_probability_45_list.csv
    Ignored:    data/cormotif_probability_45_list_he.csv
    Ignored:    data/cormotif_probability_all_6_list.csv
    Ignored:    data/cormotif_probability_all_6_list_he.csv
    Ignored:    data/datasave.RDS
    Ignored:    data/embryo_heart_FRIP.csv
    Ignored:    data/enhancer_list_ENCFF126UHK.bed
    Ignored:    data/enhancerdata/
    Ignored:    data/filt_Peaks_efit2.RDS
    Ignored:    data/filt_Peaks_efit2_bl.RDS
    Ignored:    data/filt_Peaks_efit2_n45.RDS
    Ignored:    data/first_Peaksummarycounts.csv
    Ignored:    data/first_run_frag_counts.txt
    Ignored:    data/full_bedfiles/
    Ignored:    data/gene_ref.csv
    Ignored:    data/gwas_1_dataframe.RDS
    Ignored:    data/gwas_2_dataframe.RDS
    Ignored:    data/gwas_3_dataframe.RDS
    Ignored:    data/gwas_4_dataframe.RDS
    Ignored:    data/gwas_5_dataframe.RDS
    Ignored:    data/high_conf_peak_counts.csv
    Ignored:    data/high_conf_peak_counts.txt
    Ignored:    data/high_conf_peaks_bl_counts.txt
    Ignored:    data/high_conf_peaks_counts.txt
    Ignored:    data/hits_files/
    Ignored:    data/hyper_files/
    Ignored:    data/hypo_files/
    Ignored:    data/ind1_DA24hpeaks.RDS
    Ignored:    data/ind1_TSSE.RDS
    Ignored:    data/ind2_TSSE.RDS
    Ignored:    data/ind3_TSSE.RDS
    Ignored:    data/ind4_TSSE.RDS
    Ignored:    data/ind4_V24hpeaks.RDS
    Ignored:    data/ind5_TSSE.RDS
    Ignored:    data/ind6_TSSE.RDS
    Ignored:    data/initial_complete_stats_run1.txt
    Ignored:    data/left_ventricle_FRIP.csv
    Ignored:    data/median_24_lfc.RDS
    Ignored:    data/median_3_lfc.RDS
    Ignored:    data/mergedPeads.gff
    Ignored:    data/mergedPeaks.gff
    Ignored:    data/motif_list_full
    Ignored:    data/motif_list_n45
    Ignored:    data/motif_list_n45.RDS
    Ignored:    data/multiqc_fastqc_run1.txt
    Ignored:    data/multiqc_fastqc_run2.txt
    Ignored:    data/multiqc_genestat_run1.txt
    Ignored:    data/multiqc_genestat_run2.txt
    Ignored:    data/my_hc_filt_counts.RDS
    Ignored:    data/my_hc_filt_counts_n45.RDS
    Ignored:    data/n45_bedfiles/
    Ignored:    data/n45_files
    Ignored:    data/other_papers/
    Ignored:    data/peakAnnoList_1.RDS
    Ignored:    data/peakAnnoList_2.RDS
    Ignored:    data/peakAnnoList_24_full.RDS
    Ignored:    data/peakAnnoList_24_n45.RDS
    Ignored:    data/peakAnnoList_3.RDS
    Ignored:    data/peakAnnoList_3_full.RDS
    Ignored:    data/peakAnnoList_3_n45.RDS
    Ignored:    data/peakAnnoList_4.RDS
    Ignored:    data/peakAnnoList_5.RDS
    Ignored:    data/peakAnnoList_6.RDS
    Ignored:    data/peakAnnoList_Eight.RDS
    Ignored:    data/peakAnnoList_full_motif.RDS
    Ignored:    data/peakAnnoList_n45_motif.RDS
    Ignored:    data/siglist_full.RDS
    Ignored:    data/siglist_n45.RDS
    Ignored:    data/summarized_peaks_dataframe.txt
    Ignored:    data/summary_peakIDandReHeat.csv
    Ignored:    data/test.list.RDS
    Ignored:    data/testnames.txt
    Ignored:    data/toplist_6.RDS
    Ignored:    data/toplist_full.RDS
    Ignored:    data/toplist_full_DAR_6.RDS
    Ignored:    data/toplist_n45.RDS
    Ignored:    data/trimmed_seq_length.csv
    Ignored:    data/unclassified_full_set_peaks.RDS
    Ignored:    data/unclassified_n45_set_peaks.RDS
    Ignored:    data/xstreme/

Untracked files:
    Untracked:  analysis/Expressed_RNA_associations.Rmd
    Untracked:  analysis/LFC_corr.Rmd
    Untracked:  analysis/SVA.Rmd
    Untracked:  analysis/Tan2020.Rmd
    Untracked:  analysis/my_hc_filt_counts.csv
    Untracked:  code/IGV_snapshot_code.R
    Untracked:  code/LongDARlist.R
    Untracked:  code/just_for_Fun.R
    Untracked:  output/cormotif_probability_45_list.csv
    Untracked:  output/cormotif_probability_all_6_list.csv
    Untracked:  setup.RData

Unstaged changes:
    Modified:   ATAC_learning.Rproj
    Modified:   analysis/Correlation_of_SNPnPEAK.Rmd
    Modified:   analysis/GO_KEGG_analysis.Rmd
    Modified:   analysis/Odds_ratios_ff.Rmd
    Modified:   analysis/TE_analysis_ff.Rmd
    Modified:   analysis/final_plot_attempt.Rmd
    Modified:   analysis/index.Rmd

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/Peak_calling.Rmd) and HTML (docs/Peak_calling.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 9ce3cdd reneeisnowhere 2025-05-01 updates to webpage
Rmd 84c2d63 reneeisnowhere 2024-11-14 adding in commits
Rmd 9f3ac8f reneeisnowhere 2024-06-25 after updates
html 9b097de reneeisnowhere 2024-03-29 Build site.
Rmd 0b47e3f reneeisnowhere 2024-03-29 updates to code
html 904fdbf reneeisnowhere 2024-03-19 Build site.
Rmd f22ccc1 reneeisnowhere 2024-03-19 adding Frips
Rmd cf2d406 reneeisnowhere 2024-03-19 adding cormotif
html faa6c5b reneeisnowhere 2024-03-11 Build site.
Rmd 6df7f0c reneeisnowhere 2024-03-11 adjusting INd624h tss plot and adding Frip
html 30e5df3 reneeisnowhere 2024-03-08 Build site.
Rmd 141a8a4 reneeisnowhere 2024-03-08 wflow_publish("analysis/Peak_calling.Rmd")
html 2bf37aa reneeisnowhere 2024-03-06 Build site.
Rmd 2ffc80a reneeisnowhere 2024-03-06 updates to peak calling
html 8999d6a reneeisnowhere 2024-03-04 Build site.
Rmd 4b83ab1 reneeisnowhere 2024-03-04 adding in read progression
html 9a1e500 reneeisnowhere 2024-03-04 Build site.
Rmd d61bef5 reneeisnowhere 2024-03-04 updating Peak info
html 8ff3334 reneeisnowhere 2024-03-04 Build site.
Rmd 05933d7 reneeisnowhere 2024-03-04 updates to Ind4 and Ind5 fragment lengths, beginning Peak analysis
html 3538b64 reneeisnowhere 2024-03-01 Build site.
Rmd 3a404bd reneeisnowhere 2024-03-01 adding basic graphs of reads and reordering others
html 0cced72 reneeisnowhere 2024-02-29 Build site.
Rmd 6e496d2 reneeisnowhere 2024-02-29 adding fragment files from all samples
html 4bfdef9 reneeisnowhere 2024-02-27 Build site.
Rmd 0a26679 reneeisnowhere 2024-02-27 adding in the the reads data
html 3d2aa7b reneeisnowhere 2024-02-27 Build site.
Rmd 1a8126f reneeisnowhere 2024-02-27 adding the peak-calling files

library(tidyverse)
# library(ggsignif)
# library(cowplot)
# library(ggpubr)
# library(scales)
# library(sjmisc)
library(kableExtra)
# library(broom)
# library(biomaRt)
library(RColorBrewer)
# library(gprofiler2)
# library(qvalue)
library(ChIPseeker)
# library("TxDb.Hsapiens.UCSC.hg38.knownGene")
# library("org.Hs.eg.db")
library(ATACseqQC)
library(rtracklayer)
library(TxDb.Hsapiens.UCSC.hg38.knownGene)
library(BSgenome.Hsapiens.UCSC.hg38)
library(MotifDb)
library(ChIPpeakAnno)
drug_pal_fac <- c("#8B006D","#DF707E","#F1B72B", "#3386DD","#707031","#41B333")
txdb <- TxDb.Hsapiens.UCSC.hg38.knownGene

loadFile_peakCall <- function(){
 file <- choose.files()
 file <- readPeakFile(file, header = FALSE)
 return(file)
}

prepGRangeObj <- function(seek_object){
 seek_object$Peaks = seek_object$V4
 seek_object$level = seek_object$V5
 seek_object$V4 = seek_object$V5 = NULL
 return(seek_object)
}
TSS = getBioRegion(TxDb=txdb, upstream=2000, downstream=2000, by = "gene", 
                   type = "start_site")

# ind4_V24hpeaks <- readRDS("data/ind4_V24hpeaks.RDS")
# ind1_DA24hpeaks <- readRDS("data/ind1_DA24hpeaks.RDS")
# anno_ind4_V24h <- readRDS("data/anno_ind4_V24h.RDS")
# anno_ind1_DA24h <- readRDS("data/anno_ind1_DA24h.RDS")


Ind1_summary  <- read.csv("data/Ind1_summary.txt", row.names = 1) %>% 
  rename(X1="sample",X2="reads",X3="mapped") 
Ind2_summary  <- read.csv("data/Ind2_summary.txt", row.names = 1)%>% 
  rename(X1="sample",X2="reads",X3="mapped")
Ind3_summary  <- read.csv("data/Ind3_summary.txt", row.names = 1)%>% 
  rename(X1="sample",X2="reads",X3="mapped")
Ind4_summary  <- read.csv("data/Ind4_summary.txt", row.names = 1)%>% 
  rename(X1="sample",X2="reads",X3="mapped")
Ind5_summary  <- read.csv("data/Ind5_summary.txt", row.names = 1)%>% 
  rename(X1="sample",X2="reads",X3="mapped")
Ind6_summary  <- read.csv("data/Ind6_summary.txt", row.names = 1)%>% 
  rename(X1="sample",X2="reads",X3="mapped")

This specific page so far contains the QC analysis after calling peaks using MACS2.

Primary scripts used for ATAC data preprocesing will be linked here in the future:

  •  Currently the steps were are as follows:

    • Basic Fastqc followed by adapter trimming and Fastqc analysis on the leftover fragments.

    • Trimmed reads were aligned to the hg38 human genome.

    • Mitochondrial reads (chrM) were removed

    • samtools was used to removed non-paired, discordantly paired, and multi-mapped reads from the .bam.

    • Markduplicates function from Picard was used to mark optical and PCR duplicates, with samtools used to remove these reads using the flag -F 1024.

    • MACS2 was used to call peaks, with QC of the peak files below.

Initial read summary is found at this LINK

Individual 1 fragment files:

Ind1_frag_files <- read.csv("data/Ind1_fragment_files.txt", row.names = 1)
 
Ind1_firstfrag_files <- read.csv("data/Ind1_firstfragment_files.txt", row.names = 1)
Ind1_frag_files %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>% 
  dplyr::filter(time =="3h") %>%
  ggplot(., aes(y=counts, x=frag_size, group=trt))+
  # geom_line(aes(col=trt, alpha = 0.5, linewidth=1 ))+
  geom_line(aes(col=trt))+
  ggtitle("Individual 1\n3 hour fragment sizes")+
  theme_classic()+
   facet_wrap(~trt)+
  scale_color_manual(values=drug_pal_fac)+
  coord_cartesian(ylim=c(0,300000))
Ind1_firstfrag_files %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>% 
  dplyr::filter(time =="3h") %>%
  ggplot(., aes(y=(counts), x=(frag_size), group=trt))+
  # geom_line(aes(col=trt, alpha = 0.5, linewidth=1 ))+
  geom_line(aes(col=trt))+
  ggtitle("Individual 1\n3 hour fragment sizes BEFORE filtering")+
  theme_classic()+
   facet_wrap(~trt)+
  scale_color_manual(values=drug_pal_fac)+
  coord_cartesian(xlim=c(0,1000))
# 

Ind1_frag_files %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>% 
  dplyr::filter(time =="24h") %>%
  ggplot(., aes(y=(counts), x=frag_size, group=trt))+
  geom_line(aes(col=trt))+
  ggtitle("Individual 1\n24 hour fragment sizes")+
  theme_classic()+
  facet_wrap(~trt)+
  scale_color_manual(values=drug_pal_fac)#+
  # coord_cartesian(ylim=c(0,300000))



Ind1_firstfrag_files %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>% 
  dplyr::filter(time =="24h") %>%
  ggplot(., aes(y=(counts), x=(frag_size), group=trt))+
  # geom_line(aes(col=trt, alpha = 0.5, linewidth=1 ))+
  geom_line(aes(col=trt))+
  ggtitle("Individual 1\n24 hour fragment sizes BEFORE filtering")+
  theme_classic()+
   facet_wrap(~trt)+
  scale_color_manual(values=drug_pal_fac)+
  coord_cartesian(xlim=c(0,1000))
# 

FRiP Individual 1

cardiac_muscle_Frip <- read.csv("data/cardiac_muscle_FRIP.csv", row.names = 1)
cardiomyocyte_Frip <- read.csv("data/cardiomyocyte_FRIP.csv", row.names = 1)
left_ventricle_Frip <- read.csv("data/left_ventricle_FRIP.csv", row.names = 1)
embryo_heart_Frip <- read.csv("data/embryo_heart_FRIP.csv", row.names = 1)
# Ind1_summary  <- read.csv("data/Ind1_summary.txt", row.names = 1) %>% 
  # dplyr::rename("sample"=X1,"reads"=X2,"mapped"=X3)

# Frip_1_reads <- Ind1_frip %>% 
#   rename(X1 ="sample", X2 ="counts_in_peaks") %>% 
#   separate(sample, into= c(NA,NA,NA,NA,NA,NA, NA,NA,NA,NA,"indv","sample")) %>% 
#   full_join(Ind1_reads_summary) %>% 
#   mutate(FRiP_1= counts_in_peaks/dedup_reads*100)
# write.csv(Frip_1_reads,"data/Frip_1_reads.csv")
Frip_1_reads <- read.csv("data/Frip_1_reads.csv", row.names = 1)

all_frip1 <- Frip_1_reads %>% 
 mutate(sample=gsub("75","1_",sample)) %>% 
   mutate(sample = gsub("24h","_24h",sample), 
       sample = gsub("3h","_3h",sample)) %>%
  separate(sample, into = c("indv","trt","time")) %>%
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>%  
  mutate(indv=as.numeric(indv)) %>% 
  left_join(., (cardiac_muscle_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
 left_join(., (left_ventricle_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
    left_join(., (cardiomyocyte_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
   left_join(., (embryo_heart_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
  mutate(FRIP_embryo=embryo_counts/dedup_reads *100) %>% 
  mutate(FRIP_cm=cm_counts/dedup_reads*100) %>% 
mutate(FRIP_lv=lv_counts/dedup_reads*100) %>% 
mutate(FRIP_adult=c_muscle_counts/dedup_reads*100)

# Ind1_reads_frip <- 
# Ind1_summary %>%                          
#  separate(reads,into=c("reads",NA),sep= " ") %>% 
#    mutate(reads=as.numeric(reads)) %>% 
#    separate(mapped, into= c("mapped_reads", NA,NA, "percent_mapped_reads",NA)) %>% 
#    separate(sample, into=c("one","two",NA, "4","sample",NA,"seven","8")) %>% 
#    mutate(mapped_reads=as.numeric(mapped_reads)) %>% 
#    mutate(type = if_else(two=="first", "total",
#                          if_else(two=="noM","nuclear",
#                                  if_else((seven == "fin"& two=="files"), "unique", "dedup"))))%>% 
#    dplyr::select(sample,type,  reads, mapped_reads)%>% 
#    pivot_longer(cols=reads:mapped_reads, names_to = "read_info", values_to = "reads") %>% 
#    unite("type",type:read_info, sep="_") %>% 
#    distinct() %>% 
#    pivot_wider(id_cols = sample, names_from = "type", values_from = "reads") %>% 
#    mutate(per_nuclear_mapped = nuclear_mapped_reads/total_mapped_reads*100) %>% 
#   mutate(dedup_read_pairs=dedup_reads/2) %>% 
#    dplyr::select(sample,total_reads:nuclear_mapped_reads,per_nuclear_mapped,unique_mapped_reads,dedup_reads,dedup_read_pairs) %>% 
#   dplyr::select(sample, dedup_reads) %>% 


Frip_1_reads %>% 
  mutate(sample=gsub("75","1_",sample)) %>% 
   mutate(sample = gsub("24h","_24h",sample), 
       sample = gsub("3h","_3h",sample)) %>%
  separate(sample, into = c("indv","trt","time")) %>% 
  mutate(time=factor(time, levels = c("3h","24h"))) %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>%  
  ggplot(., aes (x=time, y=FRiP_1, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across each sample for individual 1")+
   scale_fill_manual(values=drug_pal_fac)
FRiP_first_run <- read.csv("data/FRiP_first_run.txt", row.names = 1)
FRiP_first_run %>% 
  mutate(sample=gsub("75","1_",sample)) %>% 
  mutate(sample=gsub("87","2_",sample)) %>% 
  mutate(sample=gsub("77","3_",sample)) %>% 
  mutate(sample=gsub("79","4_",sample)) %>% 
  mutate(sample=gsub("78","5_",sample)) %>% 
  mutate(sample=gsub("71","6_",sample)) %>% 
  mutate(sample = gsub("24h","_24h",sample), 
       sample = gsub("3h","_3h",sample)) %>%
  separate(sample, into = c("indv","trt","time")) %>% 
  mutate(time=factor(time, levels = c("3h","24h"))) %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>% 
  ggplot(., aes (x=time, y=FRiP, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across Ind1 sample")+
   scale_fill_manual(values=drug_pal_fac)
all_frip1 %>% ggplot(., aes (x=time, y=FRIP_cm, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across Ind1 using cardiomyocyte DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)
all_frip1 %>% ggplot(., aes (x=time, y=FRIP_lv, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across Ind1 using left ventricle DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)
all_frip1 %>% ggplot(., aes (x=time, y=FRIP_adult, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across Ind1 using adult heart DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)
all_frip1 %>% ggplot(., aes (x=time, y=FRIP_embryo, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across Ind1 using embryonic heart DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)

Horizontal line is at 20%. Individual 4 at 3 hours is not a good score. Encode recommends >30% (dotted line).

Individual 2 fragment files:

Ind2_frag_files <- read.csv("data/Ind2_fragment_files.txt", row.names = 1)
Ind2_frag_files %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>% 
  dplyr::filter(time =="3h") %>%
  ggplot(., aes(y=counts, x=frag_size, group=trt))+
  # geom_line(aes(col=trt, alpha = 0.5, linewidth=1 ))+
  geom_line(aes(col=trt))+
  ggtitle("Individual 2\n3 hour fragment sizes")+
  theme_classic()+
   facet_wrap(~trt)+
  scale_color_manual(values=drug_pal_fac)
Ind2_frag_files %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>% 
  dplyr::filter(time =="24h") %>%
  ggplot(., aes(y=counts, x=frag_size, group=trt))+
  geom_line(aes(col=trt))+
  ggtitle("Individual 2\n24 hour fragment sizes")+
  theme_classic()+
  facet_wrap(~trt)+
  scale_color_manual(values=drug_pal_fac)

FRiP Individual 2

# Ind2_summary  <- read.csv("data/Ind2_summary.txt", row.names = 1) %>% 
#   dplyr::rename("sample"=X1,"reads"=X2,"mapped"=X3)
# 
# Ind2_reads_summary <- 
# Ind2_summary %>%                          
#  separate(reads,into=c("reads",NA),sep= " ") %>% 
#    mutate(reads=as.numeric(reads)) %>% 
#    separate(mapped, into= c("mapped_reads", NA,NA, "percent_mapped_reads",NA)) %>% 
#    separate(sample, into=c("one","two",NA, "4","sample",NA,"seven","8")) %>% 
#    mutate(mapped_reads=as.numeric(mapped_reads)) %>% 
#    mutate(type = if_else(two=="first", "total",
#                          if_else(two=="noM","nuclear",
#                                  if_else((seven == "fin"& two=="files"), "unique", "dedup"))))%>% 
#    dplyr::select(sample,type,  reads, mapped_reads)%>% 
#    pivot_longer(cols=reads:mapped_reads, names_to = "read_info", values_to = "reads") %>% 
#    unite("type",type:read_info, sep="_") %>% 
#    distinct() %>% 
#    pivot_wider(id_cols = sample, names_from = "type", values_from = "reads") %>% 
#    mutate(per_nuclear_mapped = nuclear_mapped_reads/total_mapped_reads*100) %>% 
#   mutate(dedup_read_pairs=dedup_reads/2) %>% 
#    dplyr::select(sample,total_reads:nuclear_mapped_reads,per_nuclear_mapped,unique_mapped_reads,dedup_reads,dedup_read_pairs) %>% 
#   dplyr::select(sample, dedup_reads) 
# Ind2_frip <- read_delim("~/ATAC_downloads/Ind1/trimmed/Ind2_frip.txt", 
#     delim = "\t", escape_double = FALSE, 
#     col_names = FALSE, trim_ws = TRUE)
# 
# Frip_2_reads <- Ind2_frip %>%
#   rename(X1 ="sample", X2 ="counts_in_peaks") %>%
#   separate(sample, into= c(NA,NA,NA,NA,NA,NA, NA,NA,NA,NA,"indv","sample")) %>%
#   full_join(Ind2_reads_summary) %>%
#   mutate(FRiP_2= counts_in_peaks/dedup_reads*100)
# write.csv(Frip_2_reads,"data/Frip_2_reads.csv")
Frip_2_reads <- read.csv("data/Frip_2_reads.csv", row.names = 1)

all_frip2 <- Frip_2_reads %>% 
  mutate(sample=gsub("87","2_",sample)) %>% 
   mutate(sample = gsub("24h","_24h",sample), 
       sample = gsub("3h","_3h",sample)) %>%
  separate(sample, into = c("indv","trt","time")) %>% 
  mutate(time=factor(time, levels = c("3h","24h"))) %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>%  
  mutate(indv=as.numeric(indv)) %>% 
  left_join(., (cardiac_muscle_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
 left_join(., (left_ventricle_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
    left_join(., (cardiomyocyte_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
  left_join(., (embryo_heart_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
  mutate(FRIP_embryo=embryo_counts/dedup_reads *100) %>% 
  mutate(FRIP_cm=cm_counts/dedup_reads*100) %>% 
mutate(FRIP_lv=lv_counts/dedup_reads*100) %>% 
mutate(FRIP_adult=c_muscle_counts/dedup_reads*100)

Frip_2_reads %>% 
 mutate(sample=gsub("87","2_",sample)) %>% 
   mutate(sample = gsub("24h","_24h",sample), 
       sample = gsub("3h","_3h",sample)) %>%
  separate(sample, into = c("indv","trt","time")) %>% 
  mutate(time=factor(time, levels = c("3h","24h"))) %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>%  
  ggplot(., aes (x=time, y=FRiP_2, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across each sample for individual 2")+
   scale_fill_manual(values=drug_pal_fac)
all_frip2 %>% ggplot(., aes (x=time, y=FRIP_cm, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across Ind2 using cardiomyocyte DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)
all_frip2 %>% ggplot(., aes (x=time, y=FRIP_lv, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across Ind2  using left ventricle DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)
all_frip2 %>% ggplot(., aes (x=time, y=FRIP_adult, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across Ind2  using adult heart DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)
all_frip2 %>% ggplot(., aes (x=time, y=FRIP_embryo, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across Ind2 using embryonic heart DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)

Individual 3 fragment files:

Ind3_frag_files <- read.csv("data/Ind3_fragment_files.txt", row.names = 1)
Ind3_frag_files %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>% 
  dplyr::filter(time =="3h") %>%
  ggplot(., aes(y=counts, x=frag_size, group=trt))+
  # geom_line(aes(col=trt, alpha = 0.5, linewidth=1 ))+
  geom_line(aes(col=trt))+
  ggtitle("Individual 3\n3 hour fragment sizes")+
  theme_classic()+
   facet_wrap(~trt)+
  scale_color_manual(values=drug_pal_fac)
Ind3_frag_files %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>% 
  dplyr::filter(time =="24h") %>%
  ggplot(., aes(y=counts, x=frag_size, group=trt))+
  geom_line(aes(col=trt))+
  ggtitle("Individual 3\n24 hour fragment sizes")+
  theme_classic()+
  facet_wrap(~trt)+
  scale_color_manual(values=drug_pal_fac)

FRiP Individual 3

# Ind3_summary  <- read.csv("data/Ind3_summary.txt", row.names = 1) %>% 
#   dplyr::rename("sample"=X1,"reads"=X2,"mapped"=X3)
# 
# Ind3_reads_summary <- 
# Ind3_summary %>%                          
#  separate(reads,into=c("reads",NA),sep= " ") %>% 
#    mutate(reads=as.numeric(reads)) %>% 
#    separate(mapped, into= c("mapped_reads", NA,NA, "percent_mapped_reads",NA)) %>% 
#    separate(sample, into=c("one","two",NA, "4","sample",NA,"seven","8")) %>% 
#    mutate(mapped_reads=as.numeric(mapped_reads)) %>% 
#    mutate(type = if_else(two=="first", "total",
#                          if_else(two=="noM","nuclear",
#                                  if_else((seven == "fin"& two=="files"), "unique", "dedup"))))%>% 
#    dplyr::select(sample,type,  reads, mapped_reads)%>% 
#    pivot_longer(cols=reads:mapped_reads, names_to = "read_info", values_to = "reads") %>% 
#    unite("type",type:read_info, sep="_") %>% 
#    distinct() %>% 
#    pivot_wider(id_cols = sample, names_from = "type", values_from = "reads") %>% 
#    mutate(per_nuclear_mapped = nuclear_mapped_reads/total_mapped_reads*100) %>% 
#   mutate(dedup_read_pairs=dedup_reads/2) %>% 
#    dplyr::select(sample,total_reads:nuclear_mapped_reads,per_nuclear_mapped,unique_mapped_reads,dedup_reads,dedup_read_pairs) %>% 
#   dplyr::select(sample, dedup_reads) 
# Ind3_frip <- read_delim("~/ATAC_downloads/Ind1/trimmed/Ind3_frip.txt", 
#     delim = "\t", escape_double = FALSE, 
#     col_names = FALSE, trim_ws = TRUE)
# 
# Frip_3_reads <- Ind3_frip %>%
#   rename(X1 ="sample", X2 ="counts_in_peaks") %>%
#   separate(sample, into= c(NA,NA,NA,NA,NA,NA, NA,NA,NA,NA,"indv","sample")) %>%
#   full_join(Ind3_reads_summary) %>%
#   mutate(FRiP_3= counts_in_peaks/dedup_reads*100)
# write.csv(Frip_3_reads,"data/Frip_3_reads.csv")
Frip_3_reads <- read.csv("data/Frip_3_reads.csv", row.names = 1)

all_frip3 <- Frip_3_reads %>% 
  mutate(sample=gsub("77","3_",sample)) %>% 
   mutate(sample = gsub("24h","_24h",sample), 
       sample = gsub("3h","_3h",sample)) %>%
  separate(sample, into = c("indv","trt","time")) %>% 
  mutate(time=factor(time, levels = c("3h","24h"))) %>% 
 mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>%  
  mutate(indv=as.numeric(indv)) %>% 
  left_join(., (cardiac_muscle_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
 left_join(., (left_ventricle_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
    left_join(., (cardiomyocyte_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
  left_join(., (embryo_heart_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
  mutate(FRIP_embryo=embryo_counts/dedup_reads *100) %>% 
  mutate(FRIP_cm=cm_counts/dedup_reads*100) %>% 
mutate(FRIP_lv=lv_counts/dedup_reads*100) %>% 
mutate(FRIP_adult=c_muscle_counts/dedup_reads*100)






Frip_3_reads %>% 
  mutate(sample=gsub("77","3_",sample)) %>% 
   mutate(sample = gsub("24h","_24h",sample), 
       sample = gsub("3h","_3h",sample)) %>%
  separate(sample, into = c("indv","trt","time")) %>% 
  mutate(time=factor(time, levels = c("3h","24h"))) %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>%  
  ggplot(., aes (x=time, y=FRiP_3, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across each sample for individual 3")+
   scale_fill_manual(values=drug_pal_fac)
all_frip3 %>% ggplot(., aes (x=time, y=FRIP_cm, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across Ind3 using cardiomyocyte DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)
all_frip3 %>% ggplot(., aes (x=time, y=FRIP_lv, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across Ind3 using left ventricle DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)
all_frip3 %>% ggplot(., aes (x=time, y=FRIP_adult, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across Ind3 using adult heart DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)
all_frip3 %>% ggplot(., aes (x=time, y=FRIP_embryo, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across Ind3 using embryonic heart DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)

Individual 4 fragment files:

Ind4_frag_files <- read.csv("data/Ind4_fragment_files.txt", row.names = 1)
Ind4_frag_files %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>% 
  dplyr::filter(time =="3h") %>%
  ggplot(., aes(y=counts, x=frag_size, group=trt))+
  geom_line(aes(col=trt ))+
  ggtitle("Individual 4\n3 hour fragment sizes")+
  theme_classic()+
   facet_wrap(~trt)+
  scale_color_manual(values=drug_pal_fac)
Ind4_frag_files %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>% 
  dplyr::filter(time =="24h") %>%
  ggplot(., aes(y=counts, x=frag_size, group=trt))+
  geom_line(aes(col=trt ))+
  ggtitle("Individual 4\n24 hour fragment sizes")+
  theme_classic()+
   facet_wrap(~trt)+
  scale_color_manual(values=drug_pal_fac)

FRiP Individual 4

# Ind4_summary  <- read.csv("data/Ind4_summary.txt", row.names = 1) %>% 
#   dplyr::rename("sample"=X1,"reads"=X2,"mapped"=X3)
# 
# Ind4_reads_summary <- 
# Ind4_summary %>%                          
#  separate(reads,into=c("reads",NA),sep= " ") %>% 
#    mutate(reads=as.numeric(reads)) %>% 
#    separate(mapped, into= c("mapped_reads", NA,NA, "percent_mapped_reads",NA)) %>% 
#    separate(sample, into=c("one","two",NA, "4","sample",NA,"seven","8")) %>% 
#    mutate(mapped_reads=as.numeric(mapped_reads)) %>% 
#    mutate(type = if_else(two=="first", "total",
#                          if_else(two=="noM","nuclear",
#                                  if_else((seven == "fin"& two=="files"), "unique", "dedup"))))%>% 
#    dplyr::select(sample,type,  reads, mapped_reads)%>% 
#    pivot_longer(cols=reads:mapped_reads, names_to = "read_info", values_to = "reads") %>% 
#    unite("type",type:read_info, sep="_") %>% 
#    distinct() %>% 
#    pivot_wider(id_cols = sample, names_from = "type", values_from = "reads") %>% 
#    mutate(per_nuclear_mapped = nuclear_mapped_reads/total_mapped_reads*100) %>% 
#   mutate(dedup_read_pairs=dedup_reads/2) %>% 
#    dplyr::select(sample,total_reads:nuclear_mapped_reads,per_nuclear_mapped,unique_mapped_reads,dedup_reads,dedup_read_pairs) %>% 
#   dplyr::select(sample, dedup_reads) 
# Ind4_frip <- read_delim("~/ATAC_downloads/Ind1/trimmed/Ind4_frip.txt", 
#     delim = "\t", escape_double = FALSE, 
#     col_names = FALSE, trim_ws = TRUE)
# 
# Frip_4_reads <- Ind4_frip %>%
#   rename(X1 ="sample", X2 ="counts_in_peaks") %>%
#   separate(sample, into= c(NA,NA,NA,NA,NA,NA, NA,NA,NA,NA,"indv","sample")) %>%
#   full_join(Ind4_reads_summary) %>%
#   mutate(FRiP_4= counts_in_peaks/dedup_reads*100)
# write.csv(Frip_4_reads,"data/Frip_4_reads.csv")
Frip_4_reads <- read.csv("data/Frip_4_reads.csv", row.names = 1)

all_frip4 <- Frip_4_reads %>% 
  mutate(sample=gsub("79","4_",sample)) %>% 
   mutate(sample = gsub("24h","_24h",sample), 
       sample = gsub("3h","_3h",sample)) %>%
  separate(sample, into = c("indv","trt","time")) %>% 
  mutate(time=factor(time, levels = c("3h","24h"))) %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>%   
  mutate(indv=as.numeric(indv)) %>% 
  left_join(., (cardiac_muscle_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
 left_join(., (left_ventricle_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
    left_join(., (cardiomyocyte_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
  left_join(., (embryo_heart_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
  mutate(FRIP_embryo=embryo_counts/dedup_reads *100) %>% 
  mutate(FRIP_cm=cm_counts/dedup_reads*100) %>% 
mutate(FRIP_lv=lv_counts/dedup_reads*100) %>% 
mutate(FRIP_adult=c_muscle_counts/dedup_reads*100)
Frip_4_reads %>% 
  mutate(sample=gsub("79","4_",sample)) %>% 
   mutate(sample = gsub("24h","_24h",sample), 
       sample = gsub("3h","_3h",sample)) %>%
  separate(sample, into = c("indv","trt","time")) %>% 
  mutate(time=factor(time, levels = c("3h","24h"))) %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>%  
  ggplot(., aes (x=time, y=FRiP_4, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across each sample for individual 4")+
   scale_fill_manual(values=drug_pal_fac)
all_frip4 %>% ggplot(., aes (x=time, y=FRIP_cm, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across Ind4 using cardiomyocyte DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)
all_frip4 %>% ggplot(., aes (x=time, y=FRIP_lv, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score  across Ind4 using left ventricle DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)
all_frip4 %>% ggplot(., aes (x=time, y=FRIP_adult, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score  across Ind4 using adult heart DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)
all_frip4 %>% ggplot(., aes (x=time, y=FRIP_embryo, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across Ind4 using embryonic heart DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)

Individual 5 fragment files:

Ind5_frag_files <- read.csv("data/Ind5_fragment_files.txt", row.names = 1)
Ind5_frag_files %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>% 
  dplyr::filter(time =="3h") %>%
  ggplot(., aes(y=counts, x=frag_size, group=trt))+
  # geom_line(aes(col=trt, alpha = 0.5, linewidth=1 ))+
  geom_line(aes(col=trt))+
  ggtitle("Individual 5\n3 hour fragment sizes")+
  theme_classic()+
   facet_wrap(~trt)+
  scale_color_manual(values=drug_pal_fac)
Ind5_frag_files %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>% 
  dplyr::filter(time =="24h") %>%
  ggplot(., aes(y=counts, x=frag_size, group=trt))+
  geom_line(aes(col=trt))+
  ggtitle("Individual 5\n24 hour fragment sizes")+
  theme_classic()+
  facet_wrap(~trt)+
  scale_color_manual(values=drug_pal_fac)

FRiP Individual 5

# 
# Ind5_summary  <- read.csv("data/Ind5_summary.txt", row.names = 1) %>%
#   dplyr::rename("sample"=X1,"reads"=X2,"mapped"=X3)
# 
# Ind5_reads_summary <-
# Ind5_summary %>%
#  separate(reads,into=c("reads",NA),sep= " ") %>%
#    mutate(reads=as.numeric(reads)) %>%
#    separate(mapped, into= c("mapped_reads", NA,NA, "percent_mapped_reads",NA)) %>%
#    separate(sample, into=c("one","two",NA, "4","sample",NA,"seven","8")) %>%
#    mutate(mapped_reads=as.numeric(mapped_reads)) %>%
#    mutate(type = if_else(two=="first", "total",
#                          if_else(two=="noM","nuclear",
#                                  if_else((seven == "fin"& two=="files"), "unique", "dedup"))))%>%
#    dplyr::select(sample,type,  reads, mapped_reads)%>%
#    pivot_longer(cols=reads:mapped_reads, names_to = "read_info", values_to = "reads") %>%
#    unite("type",type:read_info, sep="_") %>%
#    distinct() %>%
#    pivot_wider(id_cols = sample, names_from = "type", values_from = "reads") %>%
#    mutate(per_nuclear_mapped = nuclear_mapped_reads/total_mapped_reads*100) %>%
#   mutate(dedup_read_pairs=dedup_reads/2) %>%
#    dplyr::select(sample,total_reads:nuclear_mapped_reads,per_nuclear_mapped,unique_mapped_reads,dedup_reads,dedup_read_pairs) %>%
#   dplyr::select(sample, dedup_reads)
# Ind5_frip <- read_delim("~/ATAC_downloads/Ind1/trimmed/Ind5_frip.txt",
#     delim = "\t", escape_double = FALSE,
#     col_names = FALSE, trim_ws = TRUE)
# 
# Frip_5_reads <- Ind5_frip %>%
#   rename(X1 ="sample", X2 ="counts_in_peaks") %>%
#   separate(sample, into= c(NA,NA,NA,NA,NA,NA, NA,NA,NA,NA,"indv","sample")) %>%
#   full_join(Ind5_reads_summary) %>%
#   mutate(FRiP_5= counts_in_peaks/dedup_reads*100)
# write.csv(Frip_5_reads,"data/Frip_5_reads.csv")
Frip_5_reads <- read.csv("data/Frip_5_reads.csv", row.names = 1)

all_frip5 <- Frip_5_reads %>% 
  mutate(sample=gsub("78","5_",sample)) %>% 
   mutate(sample = gsub("24h","_24h",sample), 
       sample = gsub("3h","_3h",sample)) %>%
  separate(sample, into = c("indv","trt","time")) %>% 
  mutate(time=factor(time, levels = c("3h","24h"))) %>% 
 mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>%   
  mutate(indv=as.numeric(indv)) %>% 
  left_join(., (cardiac_muscle_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
 left_join(., (left_ventricle_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
    left_join(., (cardiomyocyte_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
  left_join(., (embryo_heart_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
  mutate(FRIP_embryo=embryo_counts/dedup_reads *100) %>% 
  mutate(FRIP_cm=cm_counts/dedup_reads*100) %>% 
mutate(FRIP_lv=lv_counts/dedup_reads*100) %>% 
mutate(FRIP_adult=c_muscle_counts/dedup_reads*100)
 
 
Frip_5_reads %>% 
  mutate(sample=gsub("78","5_",sample)) %>% 
   mutate(sample = gsub("24h","_24h",sample), 
       sample = gsub("3h","_3h",sample)) %>%
  separate(sample, into = c("indv","trt","time")) %>% 
  mutate(time=factor(time, levels = c("3h","24h"))) %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>%  
  ggplot(., aes (x=time, y=FRiP_5, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score a across Ind5 for individual 5")+
   scale_fill_manual(values=drug_pal_fac)
all_frip5 %>% ggplot(., aes (x=time, y=FRIP_cm, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score  across Ind5 using cardiomyocyte DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)
all_frip5 %>% ggplot(., aes (x=time, y=FRIP_lv, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score  across Ind5 using left ventricle DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)
all_frip5 %>% ggplot(., aes (x=time, y=FRIP_adult, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across each sample using adult heart DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)
all_frip5 %>% ggplot(., aes (x=time, y=FRIP_embryo, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across Ind5 using embryonic heart DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)

Individual 6 fragment files:

Ind6_frag_files <- read.csv("data/Ind6_fragment_files.txt", row.names = 1)
Ind6_frag_files %>% 
  dplyr::filter(time =="3h") %>%
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>% 
  ggplot(., aes(y=counts, x=frag_size, group=trt))+
  # geom_line(aes(col=trt, alpha = 0.5, linewidth=1 ))+
  geom_line(aes(col=trt))+
  ggtitle("Individual 6\n3 hour fragment sizes")+
  theme_classic()+
   facet_wrap(~trt)+
  scale_color_manual(values=drug_pal_fac)
Ind6_frag_files %>% 
  dplyr::filter(time =="24h") %>%
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>% 
  ggplot(., aes(y=counts, x=frag_size, group=trt))+
  geom_line(aes(col=trt))+
  ggtitle("Individual 6\n24 hour fragment sizes")+
  theme_classic()+
  facet_wrap(~trt)+
  scale_color_manual(values=drug_pal_fac)

FRiP Individual 6

# 
# Ind6_summary  <- read.csv("data/Ind6_summary.txt", row.names = 1) %>%
#   dplyr::rename("sample"=X1,"reads"=X2,"mapped"=X3)
# 
# Ind6_reads_summary <-
# Ind6_summary %>%
#  separate(reads,into=c("reads",NA),sep= " ") %>%
#    mutate(reads=as.numeric(reads)) %>%
#    separate(mapped, into= c("mapped_reads", NA,NA, "percent_mapped_reads",NA)) %>%
#    separate(sample, into=c("one","two",NA, "4","sample",NA,"seven","8")) %>%
#    mutate(mapped_reads=as.numeric(mapped_reads)) %>%
#    mutate(type = if_else(two=="first", "total",
#                          if_else(two=="noM","nuclear",
#                                  if_else((seven == "fin"& two=="files"), "unique", "dedup"))))%>%
#    dplyr::select(sample,type,  reads, mapped_reads)%>%
#    pivot_longer(cols=reads:mapped_reads, names_to = "read_info", values_to = "reads") %>%
#    unite("type",type:read_info, sep="_") %>%
#    distinct() %>%
#    pivot_wider(id_cols = sample, names_from = "type", values_from = "reads") %>%
#    mutate(per_nuclear_mapped = nuclear_mapped_reads/total_mapped_reads*100) %>%
#   mutate(dedup_read_pairs=dedup_reads/2) %>%
#    dplyr::select(sample,total_reads:nuclear_mapped_reads,per_nuclear_mapped,unique_mapped_reads,dedup_reads,dedup_read_pairs) %>%
#   dplyr::select(sample, dedup_reads)
# 
# Ind6_frip <- read_delim("~/ATAC_downloads/Ind1/trimmed/Ind6_frip.txt",
#     delim = "\t", escape_double = FALSE,
#     col_names = FALSE, trim_ws = TRUE)
# 
# Frip_6_reads <- Ind6_frip %>%
#   rename(X1 ="sample", X2 ="counts_in_peaks") %>%
#   separate(sample, into= c(NA,NA,NA,NA,NA,NA, NA,NA,NA,NA,"indv","sample")) %>%
#   full_join(Ind6_reads_summary) %>%
#   mutate(FRiP_6= counts_in_peaks/dedup_reads*100)
# write.csv(Frip_6_reads,"data/Frip_6_reads.csv")

Frip_6_reads <- read.csv("data/Frip_6_reads.csv", row.names = 1)

all_frip6 <- Frip_6_reads %>% 
  mutate(sample=gsub("71","6_",sample)) %>% 
   mutate(sample = gsub("24h","_24h",sample), 
       sample = gsub("3h","_3h",sample)) %>%
  separate(sample, into = c("indv","trt","time")) %>% 
  mutate(time=factor(time, levels = c("3h","24h"))) %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>% 
  mutate(indv=as.numeric(indv)) %>% 
  left_join(., (cardiac_muscle_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
 left_join(., (left_ventricle_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
    left_join(., (cardiomyocyte_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
  left_join(., (embryo_heart_Frip %>% mutate(trt=factor(trt, levels=c("DOX","EPI","DNR","MTX","TRZ","VEH"))))) %>% 
  mutate(FRIP_embryo=embryo_counts/dedup_reads *100) %>% 
  mutate(FRIP_cm=cm_counts/dedup_reads*100) %>% 
mutate(FRIP_lv=lv_counts/dedup_reads*100) %>% 
mutate(FRIP_adult=c_muscle_counts/dedup_reads*100)
 

Frip_6_reads %>% 
  mutate(sample=gsub("71","6_",sample)) %>% 
   mutate(sample = gsub("24h","_24h",sample), 
       sample = gsub("3h","_3h",sample)) %>%
  separate(sample, into = c("indv","trt","time")) %>% 
  mutate(time=factor(time, levels = c("3h","24h"))) %>% 
  mutate(trt=factor(trt, levels=c("DX","E","DA","M","T","V"), labels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>%  
  ggplot(., aes (x=time, y=FRiP_6, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across each sample for individual 6")+
   scale_fill_manual(values=drug_pal_fac)
all_frip6 %>% ggplot(., aes (x=time, y=FRIP_cm, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score  across Ind6 using cardiomyocyte DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)
all_frip6 %>% ggplot(., aes (x=time, y=FRIP_lv, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across Ind6 using left ventricle DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)
all_frip6 %>% ggplot(., aes (x=time, y=FRIP_adult, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across Ind6 using adult heart DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)
all_frip6 %>% ggplot(., aes (x=time, y=FRIP_embryo, group=trt))+
  geom_col(position= "dodge",aes(fill=trt))+
  geom_hline(yintercept = 20)+
  geom_hline(yintercept = 30,linetype=3)+
  facet_wrap(~indv)+
  theme_classic()+
  ggtitle("FRiP Score across Ind6 using embryonic heart DNAse peaks")+
   scale_fill_manual(values=drug_pal_fac)

Peak data

##collecting summary files

# Ind1_peaksummary <- read_table("~/ATAC_downloads/Ind1/trimmed/macs_output/Ind1_peaksummary.txt",
#     col_names = FALSE) %>%
#   rename(X1 ="counts", X2= "sample")
# Ind2_peaksummary <- read_table("~/ATAC_downloads/Ind2/trimmed/macs_output/Ind2_peaksummary.txt",
#     col_names = FALSE)%>%
#   rename(X1 ="counts", X2= "sample")
# Ind3_peaksummary <- read_table("~/ATAC_downloads/Ind3/trimmed/macs_output/Ind3_peaksummary.txt",
#     col_names = FALSE)%>%
#   rename(X1 ="counts", X2= "sample")
# Ind4_peaksummary <- read_table("~/ATAC_downloads/Ind4/trimmed/macs_output/Ind4_peaksummary.txt",
#     col_names = FALSE)%>%
#   rename(X1 ="counts", X2= "sample")
# Ind5_peaksummary <- read_table("~/ATAC_downloads/Ind5/trimmed/macs_output/Ind5_peaksummary.txt",
#     col_names = FALSE)%>%
#   rename(X1 ="counts", X2= "sample")
# Ind6_peaksummary <- read_table("~/ATAC_downloads/Ind6/trimmed/macs_output/Ind6_peaksummary.txt",
#     col_names = FALSE)%>%
#   rename(X1 ="counts", X2= "sample")
# Peaksummary <- rbind(Ind1_peaksummary,Ind2_peaksummary,Ind3_peaksummary,Ind4_peaksummary,Ind5_peaksummary,Ind6_peaksummary)
# # 
# write.csv(Peaksummary, "data/first_Peaksummarycounts.csv")
Peaksummary <- read.csv("data/first_Peaksummarycounts.csv",row.names=1)
Peaksummary %>% 
  dplyr::filter(sample != "total") %>% 
   separate(sample, into=c(NA,"indv","sample",NA,NA,NA)) %>% 
  mutate(trt=gsub("[[:digit:]]", "",sample)) %>% 
  # mutate(trt=substr(trt,-1,2))
  mutate(time = if_else(grepl("24h$", sample) ==TRUE, "24_hours","3_hours")) %>% 
  mutate(trt = case_match(trt,"DAh"~"DNR","DXh"~"DOX","Eh"~"EPI", "Mh" ~ "MTX", "Th" ~ "TRZ", "Vh" ~"VEH",.default = trt)) %>% 
  mutate(indv = factor(indv, levels = c("Ind1", "Ind2", "Ind3", "Ind4", "Ind5", "Ind6"))) %>%
  mutate(time = factor(time, levels = c("3_hours", "24_hours"), labels= c("3 hours","24 hours"))) %>% 
  mutate(trt = factor(trt, levels =  c("DOX","EPI", "DNR", "MTX", "TRZ", "VEH")))%>% 
  ggplot(., aes(x =trt, y=counts,group=trt))+
  geom_boxplot(aes(fill= trt))+
  geom_point(aes(col=indv, size =3))+
  facet_wrap(~time)+
   scale_fill_manual(values=drug_pal_fac)+
  scale_color_brewer(palette = "Dark2")+
  ggtitle("Peak counts by treatment")+
  theme_bw()

Ind1 Peaks

# plotAnnoBar(anno_ind4_V24h, main = "Genomic Feature Distribution")+ ggtitle("Ind4 VEH 24 hour")
# plotAnnoBar(anno_ind1_DA24h, main = "Genomic Feature Distribution")+ ggtitle("Ind1 DNR 24 hour")

# ind4_V24hpeaks_gr <- prepGRangeObj(ind4_V24hpeaks)
# ind1_DA24hpeaks_gr <- prepGRangeObj((ind1_DA24hpeaks))
# Epi_list <- GRangesList(ind1_DA24hpeaks_gr, ind4_V24hpeaks_gr)
# # ##plotting the TSS average window (making an overlap of each using Epi_list as list holder)
# Epi_list_tagMatrix = lapply(Epi_list, getTagMatrix, windows = TSS)
# plotAvgProf(Epi_list_tagMatrix, xlim=c(-3000, 3000), ylab = "Count Frequency")
#plotPeakProf(Epi_list_tagMatrix, facet = "none", conf = 0.95)

## What I did here:  I called all my narrowpeak files
# peakfiles1 <- choose.files()

##these were practice for getting file names and shortening for the for loop below
# testname <- basename(peakfiles1[1])
# str_split_i(testname, "_",3)

##This loop first established a list then (because I already knew the list had 12 files)
## I then imported each of these onto that list.  Once I had the list, I stored it as
## an R object, 
# Ind1_peaks <- list()
# for (file in 1:12){
#     testname <- basename(peakfiles1[file])
#   banana_peel <- str_split_i(testname, "_",3)
#  Ind1_peaks[[banana_peel]] <- readPeakFile(peakfiles1[file])
# }
# saveRDS(Ind1_peaks, "data/Ind1_peaks_list.RDS")
# I then called annotatePeak on that list object, and stored that as a R object for later retrieval.)
# peakAnnoList_1 <- lapply(Ind1_peaks, annotatePeak, tssRegion =c(-2000,2000), TxDb= txdb)
# saveRDS(peakAnnoList_1, "data/peakAnnoList_1.RDS")

peakAnnoList_1 <- readRDS("data/peakAnnoList_1.RDS")
plotAnnoBar(peakAnnoList_1, main = "Genomic Feature Distribution")
# saveRDS(Epi_list_tagMatrix, "data/Ind1_TSS_peaks.RDS")

Ind1_TSS_peaks_plot <- readRDS("data/Ind1_TSS_peaks.RDS")

# Epi_list_tagMatrix = lapply(Ind1_peaks, getTagMatrix, windows = TSS)

plotAvgProf(Ind1_TSS_peaks_plot[c(1,3,5,7,9,11)], xlim=c(-3000, 3000), ylab = "Count Frequency")+ ggtitle("3 hour Individual 1" )
>> plotting figure...            2025-05-01 12:51:38 PM 
# + coord_cartesian(xlim = c(-100,500))

plotAvgProf(Ind1_TSS_peaks_plot[c(2,4,6,8,10,12)], xlim=c(-3000, 3000),ylab = "Count Frequency")+ ggtitle("24 hour Individual 1" )
>> plotting figure...            2025-05-01 12:51:39 PM 
# + coord_cartesian(xlim = c(-100,500))

Ind2 Peaks

## What I did here:  I called all my narrowpeak files

# peakfiles2 <- choose.files()

##This loop first established a list then (because I already knew the list had 12 files)
## I then imported each of these onto that list.  Once I had the list, I stored it as
## an R object, 
# Ind2_peaks <- list()
# for (file in 1:12){
#     testname <- basename(peakfiles2[file])
#   banana_peel <- str_split_i(testname, "_",3)
#  Ind2_peaks[[banana_peel]] <- readPeakFile(peakfiles2[file])
# }
# saveRDS(Ind2_peaks, "data/Ind2_peaks_list.RDS")
# I then called annotatePeak on that list object, and stored that as a R object for later retrieval.)

Ind2_peaks <- readRDS("data/Ind2_peaks_list.RDS")
# peakAnnoList_2 <- lapply(Ind2_peaks, annotatePeak, tssRegion =c(-2000,2000), TxDb= txdb)
# saveRDS(peakAnnoList_2, "data/peakAnnoList_2.RDS")

peakAnnoList_2 <- readRDS("data/peakAnnoList_2.RDS")
plotAnnoBar(peakAnnoList_2, main = "Genomic Feature Distribution, Individual 2")
# Epi_list_tagMatrix = lapply(Ind2_peaks, getTagMatrix, windows = TSS)
# saveRDS(Epi_list_tagMatrix, "data/Ind2_TSS_peaks.RDS")

Ind2_TSS_peaks_plot <- readRDS("data/Ind2_TSS_peaks.RDS")



plotAvgProf(Ind2_TSS_peaks_plot[c(1,3,5,7,9,11)], xlim=c(-3000, 3000), conf = 0.01, ylab = "Count Frequency")+ ggtitle("3 hour Individual 2" )
>> plotting figure...            2025-05-01 12:51:55 PM 
>> Running bootstrapping for tag matrix...       2025-05-01 12:55:17 PM 
>> Running bootstrapping for tag matrix...       2025-05-01 12:58:32 PM 
>> Running bootstrapping for tag matrix...       2025-05-01 1:02:38 PM 
>> Running bootstrapping for tag matrix...       2025-05-01 1:07:33 PM 
>> Running bootstrapping for tag matrix...       2025-05-01 1:12:03 PM 
>> Running bootstrapping for tag matrix...       2025-05-01 1:16:21 PM 
# + coord_cartesian(xlim = c(-100,1000))

plotAvgProf(Ind2_TSS_peaks_plot[c(2,4,6,8,10,12)], xlim=c(-3000, 3000),ylab = "Count Frequency")+ ggtitle("24 hour Individual 2" )#+ coord_cartesian(xlim = c(-100,500))
>> plotting figure...            2025-05-01 1:16:22 PM 

Ind3 Peaks

## What I did here:  I called all my narrowpeak files

# peakfiles3 <- choose.files()

##This loop first established a list then (because I already knew the list had 12 files)
## I then imported each of these onto that list.  Once I had the list, I stored it as
## an R object, 
# Ind3_peaks <- list()
# for (file in 1:12){
#     testname <- basename(peakfiles3[file])
#   banana_peel <- str_split_i(testname, "_",3)
#  Ind3_peaks[[banana_peel]] <- readPeakFile(peakfiles3[file])
# }
# saveRDS(Ind3_peaks, "data/Ind3_peaks_list.RDS")
# I then called annotatePeak on that list object, and stored that as a R object for later retrieval.)

Ind3_peaks <- readRDS("data/Ind3_peaks_list.RDS")
# peakAnnoList_3 <- lapply(Ind3_peaks, annotatePeak, tssRegion =c(-2000,2000), TxDb= txdb)
# saveRDS(peakAnnoList_3, "data/peakAnnoList_3.RDS")

peakAnnoList_3 <- readRDS("data/peakAnnoList_3.RDS")
plotAnnoBar(peakAnnoList_3, main = "Genomic Feature Distribution, Individual 3")
# Epi_list_tagMatrix = lapply(Ind3_peaks, getTagMatrix, windows = TSS)
# saveRDS(Epi_list_tagMatrix, "data/Ind3_TSS_peaks.RDS")

Ind3_TSS_peaks_plot <- readRDS("data/Ind3_TSS_peaks.RDS")



plotAvgProf(Ind3_TSS_peaks_plot[c(1,3,5,7,9,11)], xlim=c(-3000, 3000), ylab = "Count Frequency")+ ggtitle("3 hour Individual 3" )
>> plotting figure...            2025-05-01 1:16:36 PM 
plotAvgProf(Ind3_TSS_peaks_plot[c(2,4,6,8,10,12)], xlim=c(-3000, 3000),ylab = "Count Frequency")+ ggtitle("24 hour Individual 3" )
>> plotting figure...            2025-05-01 1:16:38 PM 

Ind4 Peaks

## What I did here:  I called all my narrowpeak files

# peakfiles4 <- choose.files()
# 
# ##This loop first established a list then (because I already knew the list had 12 files)
# ## I then imported each of these onto that list.  Once I had the list, I stored it as
# ## an R object, 
# Ind4_peaks <- list()
# for (file in 1:12){
#     testname <- basename(peakfiles4[file])
#   banana_peel <- str_split_i(testname, "_",3)
#  Ind4_peaks[[banana_peel]] <- readPeakFile(peakfiles4[file])
# }
# saveRDS(Ind4_peaks, "data/Ind4_peaks_list.RDS")
# I then called annotatePeak on that list object, and stored that as a R object for later retrieval.)

Ind4_peaks <- readRDS("data/Ind4_peaks_list.RDS")
# peakAnnoList_4 <- lapply(Ind4_peaks, annotatePeak, tssRegion =c(-2000,2000), TxDb= txdb)
# saveRDS(peakAnnoList_4, "data/peakAnnoList_4.RDS")

peakAnnoList_4 <- readRDS("data/peakAnnoList_4.RDS")
plotAnnoBar(peakAnnoList_4, main = "Genomic Feature Distribution, Individual 4")

# Epi_list_tagMatrix = lapply(Ind4_peaks, getTagMatrix, windows = TSS)
# saveRDS(Epi_list_tagMatrix, "data/Ind4_TSS_peaks.RDS")

Ind4_TSS_peaks_plot <- readRDS("data/Ind4_TSS_peaks.RDS")



plotAvgProf(Ind4_TSS_peaks_plot[c(1,3,5,7,9,11)], xlim=c(-3000, 3000), ylab = "Count Frequency")+ ggtitle("3 hour Individual 4" )

plotAvgProf(Ind4_TSS_peaks_plot[c(2,4,6,8,10,12)], xlim=c(-3000, 3000),ylab = "Count Frequency")+ ggtitle("24 hour Individual 4" )

Ind5 Peaks

## What I did here:  I called all my narrowpeak files

# peakfiles4 <- choose.files()
# # 
# # ##This loop first established a list then (because I already knew the list had 12 files)
# # ## I then imported each of these onto that list.  Once I had the list, I stored it as
# ## an R object,
# Ind4_peaks <- list()
# for (file in 1:12){
#     testname <- basename(peakfiles4[file])
#   banana_peel <- str_split_i(testname, "_",3)
#  Ind4_peaks[[banana_peel]] <- readPeakFile(peakfiles4[file])
# }
# saveRDS(Ind4_peaks, "data/Ind4_peaks_list.RDS")
# I then called annotatePeak on that list object, and stored that as a R object for later retrieval.)

Ind5_peaks <- readRDS("data/Ind5_peaks_list.RDS")
# peakAnnoList_5 <- lapply(Ind5_peaks, annotatePeak, tssRegion =c(-2000,2000), TxDb= txdb)
# saveRDS(peakAnnoList_5, "data/peakAnnoList_5.RDS")

peakAnnoList_5 <- readRDS("data/peakAnnoList_5.RDS")
plotAnnoBar(peakAnnoList_5, main = "Genomic Feature Distribution, Individual 4")

# Epi_list_tagMatrix = lapply(Ind5_peaks, getTagMatrix, windows = TSS)
# saveRDS(Epi_list_tagMatrix, "data/Ind5_TSS_peaks.RDS")

Ind5_TSS_peaks_plot <- readRDS("data/Ind5_TSS_peaks.RDS")



plotAvgProf(Ind5_TSS_peaks_plot[c(1,3,5,7,9,11)], xlim=c(-3000, 3000), ylab = "Count Frequency")+ ggtitle("3 hour Individual 5" )

plotAvgProf(Ind5_TSS_peaks_plot[c(2,4,6,8,10,12)], xlim=c(-3000, 3000),ylab = "Count Frequency")+ ggtitle("24 hour Individual 5" )

Ind6 Peaks

## What I did here:  I called all my narrowpeak files

# peakfiles6 <- choose.files()
# 
# ##This loop first established a list then (because I already knew the list had 12 files)
# ## I then imported each of these onto that list.  Once I had the list, I stored it as
# ## an R object, 
# Ind6_peaks <- list()
# for (file in 1:12){
#     testname <- basename(peakfiles6[file])
#   banana_peel <- str_split_i(testname, "_",3)
#  Ind6_peaks[[banana_peel]] <- readPeakFile(peakfiles6[file])
# }
# saveRDS(Ind6_peaks, "data/Ind6_peaks_list.RDS")
# I then called annotatePeak on that list object, and stored that as a R object for later retrieval.)

Ind6_peaks <- readRDS("data/Ind6_peaks_list.RDS")
# peakAnnoList_6 <- lapply(Ind6_peaks, annotatePeak, tssRegion =c(-2000,2000), TxDb= txdb)
# saveRDS(peakAnnoList_6, "data/peakAnnoList_6.RDS")

peakAnnoList_6 <- readRDS("data/peakAnnoList_6.RDS")
plotAnnoBar(peakAnnoList_6, main = "Genomic Feature Distribution, Individual 6")+ggtitle ("Genomic Feature Distribution, Individual 6")
##Epi_list_tagMatrix title was just because I was too lazy to change the name
# Epi_list_tagMatrix = lapply(Ind6_peaks, getTagMatrix, windows = TSS)
# saveRDS(Epi_list_tagMatrix, "data/Ind6_TSS_peaks.RDS")

Ind6_TSS_peaks_plot <- readRDS("data/Ind6_TSS_peaks.RDS")



plotAvgProf(Ind6_TSS_peaks_plot[c(1,3,5,7,9,11)], xlim=c(-3000, 3000), ylab = "Count Frequency")+ ggtitle("3 hour Individual 6" )
>> plotting figure...            2025-05-01 1:16:54 PM 
plotAvgProf(Ind6_TSS_peaks_plot[c(2,4,6,8,10,12)], xlim=c(-3000, 3000),ylab = "Count Frequency")+ ggtitle("24 hour Individual 6" )
>> plotting figure...            2025-05-01 1:16:56 PM 
possibleTag <- list("integer"=c("AM", "AS", "CM", "CP", "FI", "H0", "H1", "H2", 
                                "HI", "IH", "MQ", "NH", "NM", "OP", "PQ", "SM",
                                "TC", "UQ"), 
                 "character"=c("BC", "BQ", "BZ", "CB", "CC", "CO", "CQ", "CR",
                               "CS", "CT", "CY", "E2", "FS", "LB", "MC", "MD",
                               "MI", "OA", "OC", "OQ", "OX", "PG", "PT", "PU",
                               "Q2", "QT", "QX", "R2", "RG", "RX", "SA", "TS",
                               "U2"))
library(Rsamtools)
bamTop100 <- scanBam(BamFile(bamfile, yieldSize = 100),
                     param = ScanBamParam(tag=unlist(possibleTag)))[[1]]$tag
tags <- names(bamTop100)[lengths(bamTop100)>0]
tags

outPath <- "splited"
dir.create(outPath)
library(TxDb.Hsapiens.UCSC.hg38.knownGene)
seqlev <- "chr1" 
seqinformation <- seqinfo(TxDb.Hsapiens.UCSC.hg38.knownGene)


# which <- as(seqinformation[seqlev], "GRanges")
gal <-  readBamFile(bamFile=bamfile, tag=character(0),
which=GRanges("chr1", IRanges(1, 1e6)),
asMates=TRUE)
shiftedBamfile <- file.path(outPath, "shifted.bam")
gal1 <- shiftGAlignmentsList(gal, outbam=shiftedBamfile)

txs <- transcripts(TxDb.Hsapiens.UCSC.hg38.knownGene)
tsse <- TSSEscore(gal, txs)
tsse$TSSEscore
tsse
summary(tsse$values)

TSSE

allTSSE <- readRDS( "data/all_TSSE_scores.RDS")
allTSSE %>% as.data.frame() %>% 
  rownames_to_column("sample") %>% 
  separate(sample, into = c("indv","trt","time"), sep= "_") %>%
  mutate(trt= factor(trt, levels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>% 
  mutate(time = factor(time, levels = c("3","24"),labels = c("3 hours","24 hours"))) %>% 
  ggplot(., aes(x= time, y= V1, group = indv))+

   # geom_col(position= "dodge",aes(fill=trt)) %>%
  geom_jitter(aes(col = trt, size = 1.5, alpha = 0.5) ,  position=position_jitter(0.25))+
  geom_hline(yintercept=5, linetype = 3)+
    geom_hline(yintercept=7)+
  facet_wrap(~indv)+
   theme_bw()+
  ggtitle("TSS enrichment scores")+
   scale_color_manual(values=drug_pal_fac)
allTSSE %>% as.data.frame() %>% 
  rownames_to_column("sample") %>% 
  separate(sample, into = c("indv","trt","time"), sep= "_") %>%
  dplyr::filter(indv!="4") %>% 
  dplyr::filter(indv!="5") %>% 
  mutate(trt= factor(trt, levels = c("DOX","EPI","DNR","MTX","TRZ","VEH"))) %>% 
  mutate(time = factor(time, levels = c("3","24"),labels = c("3 hours","24 hours"))) %>% 
  ggplot(., aes(x= time, y= V1, group = indv))+

   # geom_col(position= "dodge",aes(fill=trt)) %>%
  geom_jitter(aes(col = trt, size = 1.5, alpha = 0.5) ,  position=position_jitter(0.25))+
  geom_hline(yintercept=5, linetype = 3)+
    geom_hline(yintercept=7)+
  facet_wrap(~indv)+
   theme_bw()+
  ggtitle("TSS enrichment scores")+
   scale_color_manual(values=drug_pal_fac)

Heatmap of log2 cpm in peaks using MergedPeakfile

### bring in the Feature counted files
# Ind1_counts <- read.delim("~/ATAC_downloads/Ind1_files.txt", comment.char="#")
# Ind2_counts <- read.delim("~/ATAC_downloads/Ind2_files.txt", comment.char="#")
# Ind3_counts <- read.delim("~/ATAC_downloads/Ind3_files.txt", comment.char="#")
# Ind4_counts <- read.delim("~/ATAC_downloads/Ind4_files.txt", comment.char="#")
# Ind5_counts <- read.delim("~/ATAC_downloads/Ind5_files.txt", comment.char="#")
# Ind6_counts <- read.delim("~/ATAC_downloads/Ind6_files.txt", comment.char="#")
# 
# first_run_frag_counts <- Ind1_counts %>% 
#   full_join(Ind2_counts) %>% 
# full_join(Ind3_counts) %>% 
# full_join(Ind4_counts) %>% 
# full_join(Ind5_counts) %>% 
# full_join(Ind6_counts) 
# 
# names(first_run_frag_counts) = gsub(pattern = "_S.*", replacement = "", x = names(first_run_frag_counts))
# 
# names(first_run_frag_counts)=gsub(pattern = "^ind6.trimmed.filt_files.trimmed_", replacement = "", x = names(first_run_frag_counts))
# 
# write.csv(first_run_frag_counts,"data/first_run_frag_counts.txt")
first_run_frag_counts <- read.csv("data/first_run_frag_counts.txt", row.names = 1) 

Frag_cor <- first_run_frag_counts %>% 
  dplyr::select(Ind1_75DA24h:Ind6_71V3h) %>% 
  cor()
  
# pheatmap::pheatmap(Frag_cor , cluster_rows = TRUE, cluster_cols = TRUE)



filmat_groupmat_col <- data.frame(timeset = colnames(Frag_cor))

counts_corr_mat <-filmat_groupmat_col %>% 
  mutate(timeset=gsub("75","1_",timeset)) %>% 
  mutate(timeset=gsub("87","2_",timeset)) %>% 
  mutate(timeset=gsub("77","3_",timeset)) %>% 
  mutate(timeset=gsub("79","4_",timeset)) %>% 
  mutate(timeset=gsub("78","5_",timeset)) %>%
  mutate(timeset=gsub("71","6_",timeset)) %>% 
  mutate(timeset = gsub("24h","_24h",timeset), 
       timeset = gsub("3h","_3h",timeset)) %>%
  separate(timeset, into = c(NA,"indv","trt","time"), sep= "_") %>% 
  
  mutate(trt= case_match(trt, 'DX' ~'DOX', 'E'~'EPI', 'DA'~'DNR', 'M'~'MTX', 'T'~'TRZ', 'V'~'VEH',.default = trt)) %>% 
  mutate(class = if_else(trt == "DNR", "AC", if_else(
    trt == "DOX", "AC", if_else(trt == "EPI", "AC", "nAC")
  ))) %>%
  mutate(TOP2i = if_else(trt == "DNR", "yes", if_else(
    trt == "DOX", "yes", if_else(trt == "EPI", "yes", if_else(trt == "MTX", "yes", "no"))
  ))) 
                         
 mat_colors <- list( 
   trt= c("#F1B72B","#8B006D","#DF707E","#3386DD","#707031","#41B333"),
   indv=c("#1B9E77", "#D95F02" ,"#7570B3", "#E7298A" ,"#66A61E", "#E6AB02"),
   time=c("pink", "chocolate4"),
   class=c("yellow1","darkorange1"), 
   TOP2i =c("darkgreen","lightgreen"))                        
                         
names(mat_colors$trt)   <- unique(counts_corr_mat$trt)                      
names(mat_colors$indv) <- unique(counts_corr_mat$indv)
names(mat_colors$time) <- unique(counts_corr_mat$time)
names(mat_colors$class) <- unique(counts_corr_mat$class)
names(mat_colors$TOP2i) <- unique(counts_corr_mat$TOP2i)


ComplexHeatmap::pheatmap(Frag_cor,
                         # column_title=(paste0("RNA-seq log"[2]~"cpm correlation")),
        annotation_col = counts_corr_mat,
        annotation_colors = mat_colors,
        heatmap_legend_param = mat_colors,
        fontsize=10,
        fontsize_row = 8,
        angle_col="90",
        treeheight_row=25,
        fontsize_col = 8,
        treeheight_col = 20)
all_frip1 %>% dplyr::rename("FRiP_score"="FRiP_1") %>% 
  rbind(all_frip2%>% dplyr::rename("FRiP_score"="FRiP_2")) %>% 
  rbind(all_frip3%>% dplyr::rename("FRiP_score"="FRiP_3")) %>%
  rbind(all_frip6%>% dplyr::rename("FRiP_score"="FRiP_6")) %>% 
    mutate(time=factor(time, levels= c("3h","24h"), labels = c("3 hours","24 hours")), indv=factor(indv, levels = c("1","2","3","6"))) %>% 
  ggplot(., aes(x = trt, y=FRIP_adult))+
  geom_boxplot(aes(fill=trt))+
   geom_point(aes(col=indv, size =3))+
  # geom_hline(yintercept = 20)+
  facet_wrap(time~.)+
   scale_fill_manual(values=drug_pal_fac)+
  scale_color_brewer(palette = "Dark2")+
  ggtitle("reads in adult heart DNAse peaks")+
  theme_bw()
all_frip1 %>% dplyr::rename("FRiP_score"="FRiP_1") %>% 
  rbind(all_frip2%>% dplyr::rename("FRiP_score"="FRiP_2")) %>% 
  rbind(all_frip3%>% dplyr::rename("FRiP_score"="FRiP_3")) %>%
  rbind(all_frip6%>% dplyr::rename("FRiP_score"="FRiP_6")) %>% 
    mutate(time=factor(time, levels= c("3h","24h"), labels = c("3 hours","24 hours")), indv=factor(indv, levels = c("1","2","3","6"))) %>% 
  ggplot(., aes(x = trt, y=FRiP_score))+
  geom_boxplot(aes(fill=trt))+
   geom_point(aes(col=indv, size =3))+
  # geom_hline(yintercept = 20)+
  facet_wrap(time~.)+
   scale_fill_manual(values=drug_pal_fac)+
  scale_color_brewer(palette = "Dark2")+
  ggtitle("Fraction of all reads in peaks")+
  theme_bw()

sessionInfo()
R version 4.4.2 (2024-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64
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    stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
 [1] ChIPpeakAnno_3.40.0                     
 [2] MotifDb_1.48.0                          
 [3] BSgenome.Hsapiens.UCSC.hg38_1.4.5       
 [4] BSgenome_1.74.0                         
 [5] BiocIO_1.16.0                           
 [6] Biostrings_2.74.1                       
 [7] XVector_0.46.0                          
 [8] TxDb.Hsapiens.UCSC.hg38.knownGene_3.20.0
 [9] GenomicFeatures_1.58.0                  
[10] AnnotationDbi_1.68.0                    
[11] Biobase_2.66.0                          
[12] rtracklayer_1.66.0                      
[13] GenomicRanges_1.58.0                    
[14] GenomeInfoDb_1.42.3                     
[15] IRanges_2.40.1                          
[16] ATACseqQC_1.30.0                        
[17] S4Vectors_0.44.0                        
[18] BiocGenerics_0.52.0                     
[19] ChIPseeker_1.42.1                       
[20] RColorBrewer_1.1-3                      
[21] kableExtra_1.4.0                        
[22] lubridate_1.9.4                         
[23] forcats_1.0.0                           
[24] stringr_1.5.1                           
[25] dplyr_1.1.4                             
[26] purrr_1.0.4                             
[27] readr_2.1.5                             
[28] tidyr_1.3.1                             
[29] tibble_3.2.1                            
[30] ggplot2_3.5.1                           
[31] tidyverse_2.0.0                         
[32] workflowr_1.7.1                         

loaded via a namespace (and not attached):
  [1] fs_1.6.5                               
  [2] ProtGenerics_1.38.0                    
  [3] matrixStats_1.5.0                      
  [4] bitops_1.0-9                           
  [5] DirichletMultinomial_1.48.0            
  [6] enrichplot_1.26.6                      
  [7] TFBSTools_1.44.0                       
  [8] doParallel_1.0.17                      
  [9] httr_1.4.7                             
 [10] InteractionSet_1.34.0                  
 [11] tools_4.4.2                            
 [12] R6_2.6.1                               
 [13] HDF5Array_1.34.0                       
 [14] lazyeval_0.2.2                         
 [15] GetoptLong_1.0.5                       
 [16] rhdf5filters_1.18.1                    
 [17] withr_3.0.2                            
 [18] prettyunits_1.2.0                      
 [19] VennDiagram_1.7.3                      
 [20] cli_3.6.4                              
 [21] formatR_1.14                           
 [22] labeling_0.4.3                         
 [23] sass_0.4.9                             
 [24] randomForest_4.7-1.2                   
 [25] Rsamtools_2.22.0                       
 [26] systemfonts_1.2.1                      
 [27] yulab.utils_0.2.0                      
 [28] DOSE_4.0.0                             
 [29] svglite_2.1.3                          
 [30] R.utils_2.13.0                         
 [31] plotrix_3.8-4                          
 [32] limma_3.62.2                           
 [33] rstudioapi_0.17.1                      
 [34] RSQLite_2.3.9                          
 [35] shape_1.4.6.1                          
 [36] generics_0.1.3                         
 [37] gridGraphics_0.5-1                     
 [38] TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2
 [39] gtools_3.9.5                           
 [40] GO.db_3.20.0                           
 [41] Matrix_1.7-3                           
 [42] futile.logger_1.4.3                    
 [43] abind_1.4-8                            
 [44] R.methodsS3_1.8.2                      
 [45] lifecycle_1.0.4                        
 [46] whisker_0.4.1                          
 [47] yaml_2.3.10                            
 [48] edgeR_4.4.2                            
 [49] SummarizedExperiment_1.36.0            
 [50] gplots_3.2.0                           
 [51] rhdf5_2.50.2                           
 [52] qvalue_2.38.0                          
 [53] SparseArray_1.6.2                      
 [54] BiocFileCache_2.14.0                   
 [55] grid_4.4.2                             
 [56] blob_1.2.4                             
 [57] promises_1.3.2                         
 [58] crayon_1.5.3                           
 [59] pwalign_1.2.0                          
 [60] ggtangle_0.0.6                         
 [61] lattice_0.22-6                         
 [62] cowplot_1.1.3                          
 [63] annotate_1.84.0                        
 [64] KEGGREST_1.46.0                        
 [65] magick_2.8.5                           
 [66] GenomicScores_2.18.1                   
 [67] ComplexHeatmap_2.22.0                  
 [68] pillar_1.10.1                          
 [69] knitr_1.49                             
 [70] fgsea_1.32.2                           
 [71] rjson_0.2.23                           
 [72] boot_1.3-31                            
 [73] codetools_0.2-20                       
 [74] fastmatch_1.1-6                        
 [75] glue_1.8.0                             
 [76] getPass_0.2-4                          
 [77] ggfun_0.1.8                            
 [78] data.table_1.17.0                      
 [79] vctrs_0.6.5                            
 [80] png_0.1-8                              
 [81] treeio_1.30.0                          
 [82] poweRlaw_1.0.0                         
 [83] gtable_0.3.6                           
 [84] cachem_1.1.0                           
 [85] xfun_0.51                              
 [86] S4Arrays_1.6.0                         
 [87] preseqR_4.0.0                          
 [88] survival_3.8-3                         
 [89] iterators_1.0.14                       
 [90] statmod_1.5.0                          
 [91] nlme_3.1-167                           
 [92] ggtree_3.14.0                          
 [93] bit64_4.6.0-1                          
 [94] progress_1.2.3                         
 [95] filelock_1.0.3                         
 [96] rprojroot_2.0.4                        
 [97] bslib_0.9.0                            
 [98] KernSmooth_2.23-26                     
 [99] splitstackshape_1.4.8                  
[100] seqLogo_1.72.0                         
[101] colorspace_2.1-1                       
[102] DBI_1.2.3                              
[103] ade4_1.7-23                            
[104] motifStack_1.50.0                      
[105] tidyselect_1.2.1                       
[106] processx_3.8.6                         
[107] bit_4.6.0                              
[108] compiler_4.4.2                         
[109] curl_6.2.1                             
[110] git2r_0.35.0                           
[111] httr2_1.1.1                            
[112] graph_1.84.1                           
[113] xml2_1.3.7                             
[114] DelayedArray_0.32.0                    
[115] scales_1.3.0                           
[116] caTools_1.18.3                         
[117] RBGL_1.82.0                            
[118] callr_3.7.6                            
[119] rappdirs_0.3.3                         
[120] digest_0.6.37                          
[121] rmarkdown_2.29                         
[122] htmltools_0.5.8.1                      
[123] pkgconfig_2.0.3                        
[124] MatrixGenerics_1.18.1                  
[125] dbplyr_2.5.0                           
[126] regioneR_1.38.0                        
[127] fastmap_1.2.0                          
[128] ensembldb_2.30.0                       
[129] GlobalOptions_0.1.2                    
[130] htmlwidgets_1.6.4                      
[131] rlang_1.1.5                            
[132] UCSC.utils_1.2.0                       
[133] farver_2.1.2                           
[134] jquerylib_0.1.4                        
[135] jsonlite_1.9.1                         
[136] BiocParallel_1.40.0                    
[137] GOSemSim_2.32.0                        
[138] R.oo_1.27.0                            
[139] RCurl_1.98-1.16                        
[140] magrittr_2.0.3                         
[141] polynom_1.4-1                          
[142] GenomeInfoDbData_1.2.13                
[143] ggplotify_0.1.2                        
[144] patchwork_1.3.0                        
[145] Rhdf5lib_1.28.0                        
[146] munsell_0.5.1                          
[147] Rcpp_1.0.14                            
[148] ape_5.8-1                              
[149] stringi_1.8.4                          
[150] zlibbioc_1.52.0                        
[151] MASS_7.3-65                            
[152] AnnotationHub_3.14.0                   
[153] plyr_1.8.9                             
[154] parallel_4.4.2                         
[155] ggrepel_0.9.6                          
[156] CNEr_1.42.0                            
[157] splines_4.4.2                          
[158] multtest_2.62.0                        
[159] circlize_0.4.16                        
[160] hms_1.1.3                              
[161] locfit_1.5-9.12                        
[162] ps_1.9.0                               
[163] igraph_2.1.4                           
[164] reshape2_1.4.4                         
[165] biomaRt_2.62.1                         
[166] TFMPvalue_0.0.9                        
[167] futile.options_1.0.1                   
[168] BiocVersion_3.20.0                     
[169] XML_3.99-0.18                          
[170] evaluate_1.0.3                         
[171] universalmotif_1.24.2                  
[172] lambda.r_1.2.4                         
[173] BiocManager_1.30.25                    
[174] foreach_1.5.2                          
[175] tzdb_0.4.0                             
[176] httpuv_1.6.15                          
[177] clue_0.3-66                            
[178] xtable_1.8-4                           
[179] restfulr_0.0.15                        
[180] AnnotationFilter_1.30.0                
[181] tidytree_0.4.6                         
[182] later_1.4.1                            
[183] viridisLite_0.4.2                      
[184] aplot_0.2.5                            
[185] memoise_2.0.1                          
[186] GenomicAlignments_1.42.0               
[187] cluster_2.1.8.1                        
[188] timechange_0.3.0