# ATAC seq density calculation

This paper Fig2b

b Changes of chromatin accessibility in AMD (n = 14) relative to normal (n = 11) in all retina samples. Each dot represents one ATAC-Seq peak. Blue line in the left panel indicates average fold changes of peaks with the same ATAC-Seq intensity. The percentage of reduced peaks is shown under the density curve in the right panel.

How is the density calculated or what is being shown there? average ATAC seq signal or Fold change?

They are not referring to density of reads. It is the density of the fold change, the y variable in the plot to left of Fig2b. It tells you the distribution of the foldchange and 92% of the fold change is <0.

Suppose your data is something like this (purely making this up):

set.seed(555)
fc = rnorm(1000,-0.5,2)
averATAC = -0.5*(fc - 0.5)^2 + 0.2*fc + 3  + rnorm(100,25,10)


You fit a density to it and you get the plot:

par(mfrow=c(1,2))
plot(averATAC,fc)
plot(dens$$y,dens$$x,xlab = "density",ylab="fc") • your answers are part of my phd work I mean those example which helps me to express my solution
– kcm
Feb 28, 2021 at 19:48
• how is the percentage being calculated from the density?
– kcm
Mar 5, 2021 at 5:30
• I think it's an overkill, but you can do sum(dens$y[dens$x<0])/sum(den\$y) Mar 8, 2021 at 13:12
• "overkill" i will go for it
– kcm
Mar 9, 2021 at 5:53

Just count the number of reads overlapping an ATAC-seq peak and divide it by the length of the peak gives you the read density. Each dot is a fold change, but to calculate fold change, average density from all the samples are taken, that is what the "average" is referring to.

• my query is about the 92.3 % density what does it represent ? The fold change or the average ?
– kcm
Feb 26, 2021 at 7:23
• I see, it's the proportion of fold change falls below 0 on the y axis of the plot on the left Feb 27, 2021 at 15:24
• so is that the negative fold change they plotted?
– kcm
Feb 28, 2021 at 6:22
• it is a density plot of fold changes, not the density of the reads. Feb 28, 2021 at 14:45