text: user856: I have following 5 narrow peak files after peak calling.
  K14_peaks.narrowPeak
  K15_peaks.narrowPeak
  K16_peaks.narrowPeak
  K3_peaks.narrowPeak
  K8_peaks.narrowPeak
  
  I need to get the intersection of peaks into a new file (The peaks that represent all these files). I used following code but I got higher number of peaks not a lower number.
  bedtools intersect -a K14_peaks.narrowPeak -b K15_peaks.narrowPeak K16_peaks.narrowPeak K3_peaks.narrowPeak K8_peaks.narrowPeak -wo > intersected.bed
  
  Can someone help me?
  Thank you.
  
  user240: bedtools intersect with multiple files after -b performs pairwise intersections between -a and each file in -b.
  It does not intersect all files simultaneously.
  See here, from the Bedtools documentation. The green section only contains intervals from -a that also intersect at least one interval in any -b file.
  
  What I think you're looking for is bedtools multiinter (documentation here is unfortunately blank).
  bedtools multiinter -i input [input...] will produce a BED file that covers every position listed in your input files, followed by how many and which of your input samples overlap that given position.
  You can use this BED file and create something like an UpSet plot to visualize how many bases/peaks are shared between any combination of your samples.
  
original_text: 856: <p>I have following 5 narrow peak files after peak calling.</p>
  
  <pre><code>K14_peaks.narrowPeak
  K15_peaks.narrowPeak
  K16_peaks.narrowPeak
  K3_peaks.narrowPeak
  K8_peaks.narrowPeak
  </code></pre>
  
  <p>I need to get the intersection of peaks into a new file (The peaks that represent all these files). I used following code but I got higher number of peaks not a lower number.</p>
  
  <pre><code>bedtools intersect -a K14_peaks.narrowPeak -b K15_peaks.narrowPeak K16_peaks.narrowPeak K3_peaks.narrowPeak K8_peaks.narrowPeak -wo &gt; intersected.bed
  </code></pre>
  
  <p>Can someone help me?
  Thank you.</p>
   240: <p><code>bedtools intersect</code> with multiple files after <code>-b</code> performs pairwise intersections between <code>-a</code> and each file in <code>-b</code>.
  It does not intersect all files simultaneously.
  See here, from the <a href="https://bedtools.readthedocs.io/en/latest/content/tools/intersect.html" rel="nofollow noreferrer">Bedtools documentation</a>. The green section only contains intervals from <code>-a</code> that also intersect at least one interval in any <code>-b</code> file.
  <a href="https://i.stack.imgur.com/5Z8CE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5Z8CE.png" alt="Bedtools intersect"></a></p>
  
  <p>What I think you're looking for is <code>bedtools multiinter</code> (documentation <a href="https://bedtools.readthedocs.io/en/latest/content/tools/multiinter.html" rel="nofollow noreferrer">here</a> is unfortunately blank).
  <code>bedtools multiinter -i input [input...]</code> will produce a BED file that covers every position listed in your input files, followed by how many and which of your input samples overlap that given position.</p>
  
  <p>You can use this BED file and create something like an <a href="https://cran.r-project.org/web/packages/UpSetR/vignettes/basic.usage.html" rel="nofollow noreferrer">UpSet plot</a> to visualize how many bases/peaks are shared between any combination of your samples.</p>
  