Answers.Body: <p>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 &lt;0.</p>
  <p>See <a href="https://www.statmethods.net/graphs/density.html" rel="nofollow noreferrer">this page for more details on density and histograms</a></p>
  <p>Suppose your data is something like this (purely making this up):</p>
  <pre><code>set.seed(555)
  fc = rnorm(1000,-0.5,2)
  averATAC = -0.5*(fc - 0.5)^2 + 0.2*fc + 3  + rnorm(100,25,10)
  </code></pre>
  <p>You fit a density to it and you get the plot:</p>
  <pre><code>par(mfrow=c(1,2))
  plot(averATAC,fc)
  plot(dens<span class="math-container">$y,dens$</span>x,xlab = &quot;density&quot;,ylab=&quot;fc&quot;)
  </code></pre>
  <p><a href="https://i.sstatic.net/VYK9s.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/VYK9s.png" alt="enter image description here" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-28T19:48:39.630Z
Answers.Text: your answers are part of my phd work I mean those example which helps me to express my solution
Answers.UserDisplayName: kcm
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-05T05:30:21.070Z
Answers.Text: how is the percentage being calculated from the density?
Answers.UserDisplayName: kcm
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-08T13:12:19.690Z
Answers.Text: I think it's an overkill, but you can do ```sum(dens$y[dens$x<0])/sum(den$y)```
Answers.UserDisplayName: StupidWolf
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-09T05:53:44.513Z
Answers.Text: "overkill" i will go for it
Answers.UserDisplayName: kcm
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-28T14:44:10.033Z
Answers.LastActivityDate: 2021-02-28T14:44:10.033Z
Answers.UserDisplayName: StupidWolf
Answers.Body: <p>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 &quot;average&quot; is referring to.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-26T07:23:36.137Z
Answers.Text: my query is about the 92.3 % density what does it represent ? The fold change or the average ?
Answers.UserDisplayName: kcm
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-27T15:24:51.930Z
Answers.Text: I see, it's the proportion of fold change falls below 0 on the y axis of the plot on the left
Answers.UserDisplayName: Phoenix Mu
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-28T06:22:12.733Z
Answers.Text: so is that the negative fold change they plotted?
Answers.UserDisplayName: kcm
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-28T14:45:59.413Z
Answers.Text: it is a density plot of fold changes, not the density of the reads.
Answers.UserDisplayName: StupidWolf
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-26T03:01:30.727Z
Answers.LastActivityDate: 2021-02-26T03:01:30.727Z
Answers.UserDisplayName: Phoenix Mu
Body: <p>This paper <a href="https://www.nature.com/articles/s41467-018-03856-y/figures/2" rel="nofollow noreferrer">Fig2b</a></p>
  <blockquote>
  <p>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. <strong>The percentage of
  reduced peaks is shown under the density curve in the right panel.</strong></p>
  </blockquote>
  <p>How is the density calculated or what is being shown there? average ATAC seq signal or Fold change?</p>
  
Tags: <atac-seq>
Title: ATAC seq density calculation
ThreadText: # ATAC seq density calculation
  
  (Asked by: username_0 on 2021-02-25)
  
  This paper [Fig2b](https://www.nature.com/articles/s41467-018-03856-y/figures/2)
  
  > 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?
  
  **Tags:** atac-seq
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2021-02-28. Score: 1 | Accepted answer
  
  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.
  
  See [this page for more details on density and histograms](https://www.statmethods.net/graphs/density.html)
  
  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")
  
  ```
  
  [![enter image description here](https://i.sstatic.net/VYK9s.png)](https://i.sstatic.net/VYK9s.png)
  
  > **Comments:**
  > **username_0**: your answers are part of my phd work I mean those example which helps me to express my solution  
  > **username_0**: how is the percentage being calculated from the density?  
  > **username_1**: I think it's an overkill, but you can do ```sum(dens$y[dens$x<0])/sum(den$y)```  
  > **username_0**: "overkill" i will go for it  
  
  ---
  
  ### Answer by username_2 on 2021-02-26. Score: 0
  
  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.
  
  > **Comments:**
  > **username_0**: my query is about the 92.3 % density what does it represent ? The fold change or the average ?  
  > **username_2**: I see, it's the proportion of fold change falls below 0 on the y axis of the plot on the left  
  > **username_0**: so is that the negative fold change they plotted?  
  > **username_1**: it is a density plot of fold changes, not the density of the reads.  
  
  ---
  
  