library(readr)
library(dplyr)
library(tidyverse)
library(Seurat)
library(Signac)
setwd("/project2/xinhe/huiyihu/fib_peaks/fibroblasts_peaks")
data <- readRDS("./Fibroblast_snRNA_snATAC.Rds")
# set the active assay from RNA to peaks
DefaultAssay(data) <- "peaks"
####### Compute all Peaks that are specific for each cluster #################
##############################################################################
# calculate all peaks that are specific for each cluster
da_peaks <- FindAllMarkers(data,
only.pos = T,
test.use = 'LR',
latent.vars = "nCount_peaks")
# save it as RDs
saveRDS(da_peaks, file = "./differentially_accessible_peaks.Rds")Fibroblasts Peak Analysis
Summary
Number of shared peaks: 3051
Number of peaks specific to Fib_0: 44
Number of peaks specific to Myofib: 201
Number of peaks specific to Fib_SCARA5: 175
Number of peaks specific to Fib_3: 11
Compute all peaks that are specific to each cluster
Result from differential accessibility analysis
- Located at
"/project2/xinhe/huiyihu/fib_peaks/fibroblasts_peaks/differentially_accessible_peaks.Rds"
Apply filter criteria and count peaks
p_val_adj <= 0.1, avg_log2FC >= 0.1
p_val_adj = the p_val adjusted based on Bonferroni correction
#Apply filtering criteria da_filtered <- differentially_accessible_peaks %>% filter(p_val_adj <= 0.1, avg_log2FC >= 0.1) #Count the number of peaks specifically belong to each fibroblast peak_counts <- da_filtered %>% group_by(cluster) %>% summarise(Count = n()) %>% filter(cluster %in% c("Fib_0", "Myofib", "Fib_SCARA5", "Fib_3"))
Peak_counts table and Venn Diagram
- Unit: Number of peaks (Count)
Final Venn Diagram
Showing the number of peaks specific to each cluster and the number of shared peaks