Last updated: 2024-03-04
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 4b83ab1. 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: .Rhistory
Ignored: .Rproj.user/
Ignored: data/Ind1_75DA24h_dedup_peaks.csv
Ignored: data/Ind1_TSS_peaks.RDS
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_fragment_files.txt
Ignored: data/Ind5_fragment_filesN.txt
Ignored: data/Ind5_summary.txt
Ignored: data/Ind6_fragment_files.txt
Ignored: data/Ind6_summary.txt
Ignored: data/aln_run1_results.txt
Ignored: data/anno_ind1_DA24h.RDS
Ignored: data/anno_ind4_V24h.RDS
Ignored: data/first_Peaksummarycounts.csv
Ignored: data/ind1_DA24hpeaks.RDS
Ignored: data/ind4_V24hpeaks.RDS
Ignored: data/initial_complete_stats_run1.txt
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/peakAnnoList_1.RDS
Ignored: data/peakAnnoList_2.RDS
Ignored: data/peakAnnoList_3.RDS
Ignored: data/peakAnnoList_4.RDS
Ignored: data/trimmed_seq_length.csv
Untracked files:
Untracked: code/just_for_Fun.R
Unstaged changes:
Modified: analysis/Fastqc_results.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 | 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")
drug_pal_fact <- 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=3000, downstream=3000, 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 summary of reads after each step:
# library(readr) pulling in orginal files example code
#
# Ind1_summary <- read_delim("~/ATAC_downloads/Ind1/trimmed/Ind1_summedup.txt",
# delim = "\t", escape_double = FALSE,
# col_names = FALSE, trim_ws = TRUE)
# Ind2_summary <- read_delim("~/ATAC_downloads/Ind2/trimmed/Ind2_summedup.txt",
# delim = "\t", escape_double = FALSE,
# col_names = FALSE, trim_ws = TRUE)
# Ind3_summary <- read_delim("~/ATAC_downloads/Ind3/trimmed/Ind3_summedup.txt",
# delim = "\t", escape_double = FALSE,
# col_names = FALSE, trim_ws = TRUE)
# Ind4_summary <- read_delim("~/ATAC_downloads/Ind4/trimmed/Ind4_summedup.txt",
# delim = "\t", escape_double = FALSE,
# col_names = FALSE, trim_ws = TRUE)
# Ind5_summary <- read_delim("~/ATAC_downloads/Ind5/trimmed/Ind5_summedup.txt",
# delim = "\t", escape_double = FALSE,
# col_names = FALSE, trim_ws = TRUE)
# Ind6_summary <- read_delim("~/ATAC_downloads/Ind6/trimmed/Ind6_summedup.txt",
# delim = "\t", escape_double = FALSE,
# col_names = FALSE, trim_ws = TRUE)
# write.csv(Ind6_summary, "data/Ind6_summary.txt")
Ind1_reads_summary <-
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)
# dedup_mapped_reads)
Ind1_reads_summary %>%
kable(., caption= "Reads summary from Ind 1") %>%
kable_paper("striped", full_width = FALSE) %>%
kable_styling(full_width = FALSE,font_size = 18) %>%
scroll_box(width = "100%", height = "400px")
sample | total_reads | total_mapped_reads | nuclear_reads | nuclear_mapped_reads | per_nuclear_mapped | unique_mapped_reads | dedup_reads | dedup_read_pairs |
---|---|---|---|---|---|---|---|---|
75DA24h | 85102446 | 83436153 | 66053400 | 64409401 | 77.19603 | 49798536 | 42171858 | 21085929 |
75DA3h | 96460622 | 94743255 | 58141974 | 56469027 | 59.60216 | 42013916 | 34375528 | 17187764 |
75DX24h | 86568932 | 85201226 | 64404238 | 63062470 | 74.01592 | 50177516 | 39698738 | 19849369 |
75DX3h | 88961680 | 87544345 | 57721936 | 56338902 | 64.35470 | 43476750 | 35305350 | 17652675 |
75E24h | 85515534 | 84156301 | 64314630 | 62981693 | 74.83895 | 50758792 | 38466006 | 19233003 |
75E3h | 86850434 | 85065673 | 46706014 | 44956986 | 52.84974 | 33433984 | 28499906 | 14249953 |
75M24h | 84253310 | 82788715 | 63010726 | 61559907 | 74.35785 | 48792426 | 39199816 | 19599908 |
75M3h | 68695646 | 67291306 | 42935278 | 41548693 | 61.74452 | 31769450 | 27750384 | 13875192 |
75T24h | 79185864 | 77440692 | 53324884 | 51609067 | 66.64334 | 40379014 | 26761992 | 13380996 |
75T3h | 65007048 | 64223127 | 39631422 | 38860422 | 60.50846 | 29963178 | 25078330 | 12539165 |
75V24h | 87628722 | 86228282 | 61813336 | 60441680 | 70.09496 | 48093816 | 35969854 | 17984927 |
75V3h | 67368518 | 66122877 | 32655484 | 31448184 | 47.56022 | 22740426 | 19004626 | 9502313 |
Ind1_reads_summary %>%
pivot_longer(cols = total_reads:dedup_read_pairs, names_to="type", values_to = "reads") %>%
dplyr::filter(type %in% list("total_reads","total_mapped_reads","nuclear_mapped_reads", "unique_mapped_reads","dedup_reads")) %>%
mutate(type=factor(type, levels=c("total_reads", "total_mapped_reads", "nuclear_mapped_reads","unique_mapped_reads","dedup_reads"))) %>%
mutate(trt=gsub("[[:digit:]]", "",sample)) %>%
# mutate(trt=substr(trt,-1,2))
mutate(time = if_else(grepl("24h$", sample) ==TRUE, "24_hours","3_hours")) %>%
mutate(time=factor(time, levels=c("3_hours","24_hours"))) %>%
mutate(trt = case_match(trt,"DAh"~"DNR","DXh"~"DOX","Eh"~"EPI", "Mh" ~ "MTX", "Th" ~ "TRZ", "Vh" ~"VEH",.default = trt)) %>%
ggplot(., aes (x=type, y=reads, group = time)) +
geom_col(position="dodge",aes(fill=time))+
facet_wrap(~trt)+
theme(axis.text.x=element_text(angle=90))+
ggtitle("Ind 1")
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)
# dedup_mapped_reads)
Ind2_reads_summary %>%
kable(., caption= "Reads summary from Ind 2") %>%
kable_paper("striped", full_width = FALSE) %>%
kable_styling(full_width = FALSE,font_size = 18) %>%
scroll_box(width = "100%", height = "400px")
sample | total_reads | total_mapped_reads | nuclear_reads | nuclear_mapped_reads | per_nuclear_mapped | unique_mapped_reads | dedup_reads | dedup_read_pairs |
---|---|---|---|---|---|---|---|---|
87DA24h | 91284490 | 90726302 | 50438182 | 49917009 | 55.01934 | 38845730 | 29862542 | 14931271 |
87DA3h | 99530062 | 98512274 | 69173490 | 68181108 | 69.21077 | 53701246 | 33518302 | 16759151 |
87DX24h | 95926258 | 95529135 | 45925936 | 45576255 | 47.70927 | 35048106 | 28145618 | 14072809 |
87DX3h | 86437590 | 85672915 | 56277016 | 55536889 | 64.82433 | 44108178 | 29633114 | 14816557 |
87E24h | 75753486 | 75405936 | 42828630 | 42514478 | 56.38081 | 33142100 | 26866466 | 13433233 |
87E3h | 93018986 | 92423041 | 62694510 | 62125220 | 67.21832 | 49108624 | 36723324 | 18361662 |
87M24h | 95131906 | 94542825 | 56081116 | 55527509 | 58.73265 | 43614330 | 33827912 | 16913956 |
87M3h | 93095744 | 92544851 | 70021308 | 69490912 | 75.08890 | 57350454 | 40556564 | 20278282 |
87T24h | 84449704 | 83992710 | 38660624 | 38236404 | 45.52348 | 29595164 | 22302276 | 11151138 |
87T3h | 77262934 | 76647754 | 46790664 | 46202260 | 60.27869 | 37014986 | 24758586 | 12379293 |
87V24h | 76257666 | 75404837 | 43814448 | 42990898 | 57.01345 | 34879692 | 20674790 | 10337395 |
87V3h | 78106046 | 77578683 | 53170414 | 52664767 | 67.88562 | 42211678 | 32184480 | 16092240 |
Ind2_reads_summary %>%
pivot_longer(cols = total_reads:dedup_read_pairs, names_to="type", values_to = "reads") %>%
dplyr::filter(type %in% list("total_reads","total_mapped_reads","nuclear_mapped_reads", "unique_mapped_reads","dedup_reads")) %>%
mutate(type=factor(type, levels=c("total_reads", "total_mapped_reads", "nuclear_mapped_reads","unique_mapped_reads","dedup_reads"))) %>%
mutate(trt=gsub("[[:digit:]]", "",sample)) %>%
# mutate(trt=substr(trt,-1,2))
mutate(time = if_else(grepl("24h$", sample) ==TRUE, "24_hours","3_hours")) %>%
mutate(time=factor(time, levels=c("3_hours","24_hours"))) %>%
mutate(trt = case_match(trt,"DAh"~"DNR","DXh"~"DOX","Eh"~"EPI", "Mh" ~ "MTX", "Th" ~ "TRZ", "Vh" ~"VEH",.default = trt)) %>%
ggplot(., aes (x=type, y=reads, group = time)) +
geom_col(position="dodge",aes(fill=time))+
facet_wrap(~trt)+
theme(axis.text.x=element_text(angle=90))+
ggtitle("Ind 2")
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)
# dedup_mapped_reads)
Ind3_reads_summary %>%
kable(., caption= "Reads summary from Ind 3") %>%
kable_paper("striped", full_width = FALSE) %>%
kable_styling(full_width = FALSE,font_size = 18) %>%
scroll_box(width = "100%", height = "400px")
sample | total_reads | total_mapped_reads | nuclear_reads | nuclear_mapped_reads | per_nuclear_mapped | unique_mapped_reads | dedup_reads | dedup_read_pairs |
---|---|---|---|---|---|---|---|---|
77DA24h | 75363518 | 74999111 | 35094224 | 34752650 | 46.33742 | 27025868 | 21869650 | 10934825 |
77DA3h | 142295378 | 141426527 | 62143706 | 61349463 | 43.37904 | 46664938 | 34279586 | 17139793 |
77DX24h | 78097470 | 77592243 | 37675048 | 37212379 | 47.95889 | 29360006 | 19207264 | 9603632 |
77DX3h | 87512178 | 86896129 | 35332636 | 34767930 | 40.01091 | 26347392 | 18957010 | 9478505 |
77E24h | 82977864 | 82385624 | 40566624 | 40017951 | 48.57395 | 31314418 | 18551820 | 9275910 |
77E3h | 100276150 | 99649171 | 44913542 | 44340553 | 44.49666 | 33759792 | 25465236 | 12732618 |
77M24h | 72997484 | 72456264 | 39085452 | 38577089 | 53.24190 | 30258994 | 21749104 | 10874552 |
77M3h | 98862906 | 98372193 | 42466218 | 42029163 | 42.72464 | 32457148 | 24872086 | 12436043 |
77T24h | 81855304 | 81363048 | 31562706 | 31121534 | 38.25021 | 22935466 | 17397726 | 8698863 |
77T3h | 77560582 | 77137107 | 27982800 | 27608032 | 35.79086 | 20240194 | 16008756 | 8004378 |
77V24h | 62649778 | 61652700 | 33205184 | 32226761 | 52.27145 | 25488894 | 7986090 | 3993045 |
77V3h | 89706546 | 89075188 | 35232316 | 34649803 | 38.89950 | 25704912 | 18970988 | 9485494 |
Ind3_reads_summary %>%
pivot_longer(cols = total_reads:dedup_read_pairs, names_to="type", values_to = "reads") %>%
dplyr::filter(type %in% list("total_reads","total_mapped_reads","nuclear_mapped_reads", "unique_mapped_reads","dedup_reads")) %>%
mutate(type=factor(type, levels=c("total_reads", "total_mapped_reads", "nuclear_mapped_reads","unique_mapped_reads","dedup_reads"))) %>%
mutate(trt=gsub("[[:digit:]]", "",sample)) %>%
# mutate(trt=substr(trt,-1,2))
mutate(time = if_else(grepl("24h$", sample) ==TRUE, "24_hours","3_hours")) %>%
mutate(time=factor(time, levels=c("3_hours","24_hours"))) %>%
mutate(trt = case_match(trt,"DAh"~"DNR","DXh"~"DOX","Eh"~"EPI", "Mh" ~ "MTX", "Th" ~ "TRZ", "Vh" ~"VEH",.default = trt)) %>%
ggplot(., aes (x=type, y=reads, group = time)) +
geom_col(position="dodge",aes(fill=time))+
facet_wrap(~trt)+
theme(axis.text.x=element_text(angle=90))+
ggtitle("Ind 3")
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)
# dedup_mapped_reads)
Ind4_reads_summary %>%
kable(., caption= "Reads summary from Ind 4") %>%
kable_paper("striped", full_width = FALSE) %>%
kable_styling(full_width = FALSE,font_size = 18) %>%
scroll_box(width = "100%", height = "400px")
sample | total_reads | total_mapped_reads | nuclear_reads | nuclear_mapped_reads | per_nuclear_mapped | unique_mapped_reads | dedup_reads | dedup_read_pairs |
---|---|---|---|---|---|---|---|---|
79DA24h | 83930268 | 83140985 | 39561574 | 38811928 | 46.68206 | 29459906 | 17862648 | 8931324 |
79DA3h | 114610072 | 112679708 | 74283554 | 72386250 | 64.24071 | 55956416 | 26487126 | 13243563 |
79DX24h | 78395382 | 77692597 | 25391928 | 24733417 | 31.83497 | 17146642 | 11544950 | 5772475 |
79DX3h | 77601292 | 76058132 | 47116936 | 45593581 | 59.94570 | 35460994 | 18908344 | 9454172 |
79E24h | 86039200 | 85324746 | 29965542 | 29300484 | 34.33996 | 21004354 | 12495788 | 6247894 |
79E3h | 86993222 | 85671962 | 46372712 | 45084280 | 52.62431 | 34578548 | 19109612 | 9554806 |
79M24h | 82061002 | 81424543 | 27148372 | 26562054 | 32.62168 | 19085838 | 9894182 | 4947091 |
79M3h | 83929214 | 82368935 | 48985626 | 47454435 | 57.61205 | 36937534 | 16384910 | 8192455 |
79T24h | 90875858 | 89680567 | 31347532 | 30204755 | 33.68038 | 21789834 | 8948490 | 4474245 |
79T3h | 106856444 | 105027081 | 65690664 | 63898507 | 60.84003 | 49669024 | 28930176 | 14465088 |
79V24h | 77013488 | 75962835 | 27439164 | 26415467 | 34.77420 | 18870010 | 10276972 | 5138486 |
79V3h | 74863328 | 73508067 | 52535548 | 51196256 | 69.64713 | 40497298 | 25112288 | 12556144 |
Ind4_reads_summary %>%
pivot_longer(cols = total_reads:dedup_read_pairs, names_to="type", values_to = "reads") %>%
dplyr::filter(type %in% list("total_reads","total_mapped_reads","nuclear_mapped_reads", "unique_mapped_reads","dedup_reads")) %>%
mutate(type=factor(type, levels=c("total_reads", "total_mapped_reads", "nuclear_mapped_reads","unique_mapped_reads","dedup_reads"))) %>%
mutate(trt=gsub("[[:digit:]]", "",sample)) %>%
# mutate(trt=substr(trt,-1,2))
mutate(time = if_else(grepl("24h$", sample) ==TRUE, "24_hours","3_hours")) %>%
mutate(time=factor(time, levels=c("3_hours","24_hours"))) %>%
mutate(trt = case_match(trt,"DAh"~"DNR","DXh"~"DOX","Eh"~"EPI", "Mh" ~ "MTX", "Th" ~ "TRZ", "Vh" ~"VEH",.default = trt)) %>%
ggplot(., aes (x=type, y=reads, group = time)) +
geom_col(position="dodge",aes(fill=time))+
facet_wrap(~trt)+
theme(axis.text.x=element_text(angle=90))+
ggtitle("Ind 4")
note: reprocessed reads for Individual 4 vary from previous output.
This is due a file truncation that was detected in the process. When the
files were reprocessed, the truncated bam file was fixed, resulting in a
larger number of overall reads. Yay, I figured it out!
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)
# dedup_mapped_reads)
Ind5_reads_summary %>%
kable(., caption= "Reads summary from Ind 5") %>%
kable_paper("striped", full_width = FALSE) %>%
kable_styling(full_width = FALSE,font_size = 18) %>%
scroll_box(width = "100%", height = "400px")
sample | total_reads | total_mapped_reads | nuclear_reads | nuclear_mapped_reads | per_nuclear_mapped | unique_mapped_reads | dedup_reads | dedup_read_pairs |
---|---|---|---|---|---|---|---|---|
78DA24h | 93798644 | 93247559 | 40654316 | 40144022 | 43.05102 | 29016844 | 15985676 | 7992838 |
78DA3h | 99686934 | 99001020 | 39593518 | 38953971 | 39.34704 | 27391084 | 19301222 | 9650611 |
78DX24h | 73732812 | 73320774 | 28057954 | 27671754 | 37.74067 | 19662022 | 13718342 | 6859171 |
78DX3h | 100368976 | 99588099 | 38244760 | 37513055 | 37.66821 | 25968162 | 16753844 | 8376922 |
78E24h | 80101516 | 79632167 | 31905942 | 31467541 | 39.51612 | 22102498 | 16872182 | 8436091 |
78E3h | 91523420 | 90956218 | 32894252 | 32371141 | 35.58981 | 22531754 | 15019734 | 7509867 |
78M24h | 94307714 | 93638536 | 48887176 | 48253791 | 51.53198 | 37330604 | 21133380 | 10566690 |
78M3h | 71296912 | 70156341 | 34691864 | 33569035 | 47.84890 | 26212720 | 16100264 | 8050132 |
78T24h | 88253908 | 87620321 | 36281030 | 35687616 | 40.72984 | 25942984 | 14776178 | 7388089 |
78T3h | 76629092 | 76156525 | 27160272 | 26724144 | 35.09108 | 19214446 | 10123244 | 5061622 |
78V24h | 99083200 | 98184830 | 32756682 | 31912089 | 32.50206 | 21660782 | 10088962 | 5044481 |
78V3h | 82686104 | 82045556 | 32865770 | 32260193 | 39.31985 | 22506718 | 11067518 | 5533759 |
Ind5_reads_summary %>%
pivot_longer(cols = total_reads:dedup_read_pairs, names_to="type", values_to = "reads") %>%
dplyr::filter(type %in% list("total_reads","total_mapped_reads","nuclear_mapped_reads", "unique_mapped_reads","dedup_reads")) %>%
mutate(type=factor(type, levels=c("total_reads", "total_mapped_reads", "nuclear_mapped_reads","unique_mapped_reads","dedup_reads"))) %>%
mutate(trt=gsub("[[:digit:]]", "",sample)) %>%
# mutate(trt=substr(trt,-1,2))
mutate(time = if_else(grepl("24h$", sample) ==TRUE, "24_hours","3_hours")) %>%
mutate(time=factor(time, levels=c("3_hours","24_hours"))) %>%
mutate(trt = case_match(trt,"DAh"~"DNR","DXh"~"DOX","Eh"~"EPI", "Mh" ~ "MTX", "Th" ~ "TRZ", "Vh" ~"VEH",.default = trt)) %>%
ggplot(., aes (x=type, y=reads, group = time)) +
geom_col(position="dodge",aes(fill=time))+
facet_wrap(~trt)+
theme(axis.text.x=element_text(angle=90))+
ggtitle("Ind 5")
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)
# dedup_mapped_reads)
Ind6_reads_summary %>%
kable(., caption= "Reads summary from Ind 6") %>%
kable_paper("striped", full_width = FALSE) %>%
kable_styling(full_width = FALSE,font_size = 18) %>%
scroll_box(width = "100%", height = "400px")
sample | total_reads | total_mapped_reads | nuclear_reads | nuclear_mapped_reads | per_nuclear_mapped | unique_mapped_reads | dedup_reads | dedup_read_pairs |
---|---|---|---|---|---|---|---|---|
71DA24h | 82118778 | 81809775 | 43159318 | 42879967 | 52.41423 | 33579444 | 25938306 | 12969153 |
71DA3h | 88190684 | 87826538 | 48938930 | 48604831 | 55.34185 | 37469828 | 29611060 | 14805530 |
71DX24h | 75155380 | 74868610 | 31677782 | 31423548 | 41.97159 | 22967970 | 18070632 | 9035316 |
71DX3h | 90235848 | 89816458 | 42018780 | 41633173 | 46.35361 | 31108924 | 23632420 | 11816210 |
71E24h | 86730082 | 86449747 | 37387316 | 37144236 | 42.96628 | 28138936 | 17335200 | 8667600 |
71E3h | 87292426 | 86821698 | 44283140 | 43845617 | 50.50076 | 32917338 | 25378234 | 12689117 |
71M24h | 82011248 | 81628718 | 45399152 | 45045409 | 55.18329 | 34342106 | 26140848 | 13070424 |
71M3h | 90916110 | 90521870 | 42962278 | 42602678 | 47.06341 | 32093512 | 23624888 | 11812444 |
71T24h | 71401066 | 71211530 | 30697278 | 30530941 | 42.87359 | 22901380 | 17278728 | 8639364 |
71T3h | 71750048 | 71481397 | 34683166 | 34436567 | 48.17557 | 25868334 | 20269094 | 10134547 |
71V24h | 79633316 | 79337448 | 37768500 | 37501106 | 47.26785 | 28483866 | 20922744 | 10461372 |
71V3h | 85216880 | 84814985 | 35805146 | 35439842 | 41.78488 | 25807810 | 19449074 | 9724537 |
Ind6_reads_summary %>%
pivot_longer(cols = total_reads:dedup_read_pairs, names_to="type", values_to = "reads") %>%
dplyr::filter(type %in% list("total_reads","total_mapped_reads","nuclear_mapped_reads", "unique_mapped_reads","dedup_reads")) %>%
mutate(type=factor(type, levels=c("total_reads", "total_mapped_reads", "nuclear_mapped_reads","unique_mapped_reads","dedup_reads"))) %>%
mutate(trt=gsub("[[:digit:]]", "",sample)) %>%
# mutate(trt=substr(trt,-1,2))
mutate(time = if_else(grepl("24h$", sample) ==TRUE, "24_hours","3_hours")) %>%
mutate(time=factor(time, levels=c("3_hours","24_hours"))) %>%
mutate(trt = case_match(trt,"DAh"~"DNR","DXh"~"DOX","Eh"~"EPI", "Mh" ~ "MTX", "Th" ~ "TRZ", "Vh" ~"VEH",.default = trt)) %>%
ggplot(., aes (x=type, y=reads, group = time)) +
geom_col(position="dodge",aes(fill=time))+
facet_wrap(~trt)+
theme(axis.text.x=element_text(angle=90))+
ggtitle("Ind 6")
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_fact)
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_fact)
So, fragment lengths are not so great. Lots of noise.
Ind1_frag_files <- read.csv("data/Ind1_fragment_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_fact)+
coord_cartesian(ylim=c(0,300000))
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_fact)+
coord_cartesian(ylim=c(0,300000))
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_fact)
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_fact)
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_fact)
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_fact)
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_fact)
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_fact)
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_fact)
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_fact)
total_reads_summary <- Ind1_reads_summary %>%
mutate(sample=gsub("75","1_",sample)) %>%
rbind((Ind2_reads_summary %>%
mutate(sample=gsub("87","2_",sample)))) %>%
rbind((Ind3_reads_summary %>%
mutate(sample=gsub("77","3_",sample)))) %>%
rbind((Ind4_reads_summary %>%
mutate(sample=gsub("79","4_",sample)))) %>%
rbind((Ind5_reads_summary %>%
mutate(sample=gsub("78","5_",sample)))) %>%
rbind((Ind6_reads_summary %>%
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")))
total_reads_summary %>%
ggplot(., aes(x=trt, y=total_reads ))+
geom_boxplot(aes(fill=trt))+
geom_point(aes(col=indv, size =3))+
facet_wrap(time~.)+
scale_fill_manual(values=drug_pal_fact)+
scale_color_brewer(palette = "Dark2")+
ggtitle("total number of reads by time and treatment")
Version | Author | Date |
---|---|---|
3538b64 | reneeisnowhere | 2024-03-01 |
total_reads_summary %>%
ggplot(., aes(x=trt, y=nuclear_reads ))+
geom_boxplot(aes(fill=trt))+
geom_point(aes(col=indv, size =3))+
facet_wrap(time~.)+
scale_fill_manual(values=drug_pal_fact)+
scale_color_brewer(palette = "Dark2")+
ggtitle("total number of nuclear reads by time and treatment")
Version | Author | Date |
---|---|---|
3538b64 | reneeisnowhere | 2024-03-01 |
total_reads_summary %>%
ggplot(., aes(x=trt, y=unique_mapped_reads ))+
geom_boxplot(aes(fill=trt))+
geom_point(aes(col=indv, size =3))+
facet_wrap(time~.)+
scale_fill_manual(values=drug_pal_fact)+
scale_color_brewer(palette = "Dark2")+
ggtitle("total number of unique-nuclear reads by time and treatment")
Version | Author | Date |
---|---|---|
3538b64 | reneeisnowhere | 2024-03-01 |
total_reads_summary %>%
ggplot(., aes(x=trt, y=dedup_reads ))+
geom_boxplot(aes(fill=trt))+
geom_point(aes(col=indv, size =3))+
facet_wrap(time~.)+
scale_fill_manual(values=drug_pal_fact)+
scale_color_brewer(palette = "Dark2")+
ggtitle("total unique, deduplicated nuclear mapped reads by time and treatment")
Version | Author | Date |
---|---|---|
3538b64 | reneeisnowhere | 2024-03-01 |
##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_fact)+
scale_color_brewer(palette = "Dark2")+
ggtitle("Peak counts by treatment")+
theme_bw()
# 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")
Version | Author | Date |
---|---|---|
9a1e500 | reneeisnowhere | 2024-03-04 |
# 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... 2024-03-04 9:02:12 PM
Version | Author | Date |
---|---|---|
9a1e500 | reneeisnowhere | 2024-03-04 |
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... 2024-03-04 9:02:13 PM
Version | Author | Date |
---|---|---|
9a1e500 | reneeisnowhere | 2024-03-04 |
## 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")
Version | Author | Date |
---|---|---|
9a1e500 | reneeisnowhere | 2024-03-04 |
# 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), ylab = "Count Frequency")+ ggtitle("3 hour Individual 2" )
>> plotting figure... 2024-03-04 9:02:33 PM
Version | Author | Date |
---|---|---|
9a1e500 | reneeisnowhere | 2024-03-04 |
plotAvgProf(Ind2_TSS_peaks_plot[c(2,4,6,8,10,12)], xlim=c(-3000, 3000),ylab = "Count Frequency")+ ggtitle("24 hour Individual 2" )
>> plotting figure... 2024-03-04 9:02:35 PM
Version | Author | Date |
---|---|---|
9a1e500 | reneeisnowhere | 2024-03-04 |
## 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")
Version | Author | Date |
---|---|---|
9a1e500 | reneeisnowhere | 2024-03-04 |
# 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... 2024-03-04 9:03:07 PM
Version | Author | Date |
---|---|---|
9a1e500 | reneeisnowhere | 2024-03-04 |
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... 2024-03-04 9:03:08 PM
Version | Author | Date |
---|---|---|
9a1e500 | reneeisnowhere | 2024-03-04 |
## 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")
Version | Author | Date |
---|---|---|
9a1e500 | reneeisnowhere | 2024-03-04 |
# 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" )
>> plotting figure... 2024-03-04 9:03:25 PM
Version | Author | Date |
---|---|---|
9a1e500 | reneeisnowhere | 2024-03-04 |
plotAvgProf(Ind4_TSS_peaks_plot[c(2,4,6,8,10,12)], xlim=c(-3000, 3000),ylab = "Count Frequency")+ ggtitle("24 hour Individual 4" )
>> plotting figure... 2024-03-04 9:03:26 PM
Version | Author | Date |
---|---|---|
9a1e500 | reneeisnowhere | 2024-03-04 |
sessionInfo()
R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)
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] org.Hs.eg.db_3.17.0
[2] TxDb.Hsapiens.UCSC.hg38.knownGene_3.17.0
[3] GenomicFeatures_1.52.2
[4] AnnotationDbi_1.62.2
[5] Biobase_2.60.0
[6] GenomicRanges_1.52.1
[7] GenomeInfoDb_1.36.4
[8] IRanges_2.34.1
[9] S4Vectors_0.38.2
[10] BiocGenerics_0.46.0
[11] ChIPseeker_1.36.0
[12] RColorBrewer_1.1-3
[13] kableExtra_1.4.0
[14] lubridate_1.9.3
[15] forcats_1.0.0
[16] stringr_1.5.1
[17] dplyr_1.1.4
[18] purrr_1.0.2
[19] readr_2.1.5
[20] tidyr_1.3.1
[21] tibble_3.2.1
[22] ggplot2_3.4.4
[23] tidyverse_2.0.0
[24] workflowr_1.7.1
loaded via a namespace (and not attached):
[1] splines_4.3.1
[2] later_1.3.2
[3] BiocIO_1.10.0
[4] bitops_1.0-7
[5] ggplotify_0.1.2
[6] filelock_1.0.3
[7] polyclip_1.10-6
[8] XML_3.99-0.16.1
[9] lifecycle_1.0.4
[10] rprojroot_2.0.4
[11] processx_3.8.3
[12] lattice_0.22-5
[13] MASS_7.3-60.0.1
[14] magrittr_2.0.3
[15] sass_0.4.8
[16] rmarkdown_2.25
[17] plotrix_3.8-4
[18] jquerylib_0.1.4
[19] yaml_2.3.8
[20] httpuv_1.6.14
[21] cowplot_1.1.3
[22] DBI_1.2.2
[23] abind_1.4-5
[24] zlibbioc_1.46.0
[25] ggraph_2.1.0
[26] RCurl_1.98-1.14
[27] yulab.utils_0.1.4
[28] tweenr_2.0.2
[29] rappdirs_0.3.3
[30] git2r_0.33.0
[31] GenomeInfoDbData_1.2.10
[32] enrichplot_1.20.3
[33] ggrepel_0.9.5
[34] tidytree_0.4.6
[35] svglite_2.1.3
[36] codetools_0.2-19
[37] DelayedArray_0.26.7
[38] DOSE_3.26.2
[39] xml2_1.3.6
[40] ggforce_0.4.2
[41] tidyselect_1.2.0
[42] aplot_0.2.2
[43] farver_2.1.1
[44] viridis_0.6.5
[45] matrixStats_1.2.0
[46] BiocFileCache_2.8.0
[47] GenomicAlignments_1.36.0
[48] jsonlite_1.8.8
[49] tidygraph_1.3.1
[50] systemfonts_1.0.5
[51] tools_4.3.1
[52] progress_1.2.3
[53] treeio_1.24.3
[54] TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2
[55] Rcpp_1.0.12
[56] glue_1.7.0
[57] gridExtra_2.3
[58] xfun_0.42
[59] qvalue_2.32.0
[60] MatrixGenerics_1.12.3
[61] withr_3.0.0
[62] fastmap_1.1.1
[63] boot_1.3-29
[64] fansi_1.0.6
[65] caTools_1.18.2
[66] callr_3.7.5
[67] digest_0.6.34
[68] timechange_0.3.0
[69] R6_2.5.1
[70] gridGraphics_0.5-1
[71] colorspace_2.1-0
[72] GO.db_3.17.0
[73] gtools_3.9.5
[74] biomaRt_2.56.1
[75] RSQLite_2.3.5
[76] utf8_1.2.4
[77] generics_0.1.3
[78] data.table_1.15.0
[79] rtracklayer_1.60.1
[80] prettyunits_1.2.0
[81] graphlayouts_1.1.0
[82] httr_1.4.7
[83] S4Arrays_1.0.6
[84] scatterpie_0.2.1
[85] whisker_0.4.1
[86] pkgconfig_2.0.3
[87] gtable_0.3.4
[88] blob_1.2.4
[89] XVector_0.40.0
[90] shadowtext_0.1.3
[91] htmltools_0.5.7
[92] fgsea_1.26.0
[93] scales_1.3.0
[94] png_0.1-8
[95] ggfun_0.1.4
[96] knitr_1.45
[97] rstudioapi_0.15.0
[98] tzdb_0.4.0
[99] reshape2_1.4.4
[100] rjson_0.2.21
[101] nlme_3.1-164
[102] curl_5.2.0
[103] cachem_1.0.8
[104] KernSmooth_2.23-22
[105] parallel_4.3.1
[106] HDO.db_0.99.1
[107] restfulr_0.0.15
[108] pillar_1.9.0
[109] grid_4.3.1
[110] vctrs_0.6.5
[111] gplots_3.1.3.1
[112] promises_1.2.1
[113] dbplyr_2.4.0
[114] evaluate_0.23
[115] cli_3.6.2
[116] compiler_4.3.1
[117] Rsamtools_2.16.0
[118] rlang_1.1.3
[119] crayon_1.5.2
[120] labeling_0.4.3
[121] ps_1.7.6
[122] getPass_0.2-4
[123] plyr_1.8.9
[124] fs_1.6.3
[125] stringi_1.8.3
[126] viridisLite_0.4.2
[127] BiocParallel_1.34.2
[128] munsell_0.5.0
[129] Biostrings_2.68.1
[130] lazyeval_0.2.2
[131] GOSemSim_2.26.1
[132] Matrix_1.6-5
[133] hms_1.1.3
[134] patchwork_1.2.0
[135] bit64_4.0.5
[136] KEGGREST_1.40.1
[137] highr_0.10
[138] SummarizedExperiment_1.30.2
[139] igraph_2.0.2
[140] memoise_2.0.1
[141] bslib_0.6.1
[142] ggtree_3.8.2
[143] fastmatch_1.1-4
[144] bit_4.0.5
[145] ape_5.7-1