<p>Hi all</p>

<p>I'm wondering if there is a way to exclude regions in samtools view. </p>

<p>Now I awk and sed lines away in post processing via piping. </p>

<p>Wouldn't it save time and space to just pileup more than one region at once into a file?</p>

<p>Maybe this is a dumb question but I don't have the software now while I'm wondering so I can't experiment.</p>

<p>For example:</p>

<pre><code>samtools view chrY:2709520-3709520, chrY:17443438-27443438 ǀ samtools mpileup...
samtools view chrY:2709520-3709520 AND chrY:17443438-27443438 ǀ samtools mpileup.
samtools view chrY:2709520-3709520: chrY:17443438-27443438 ǀ samtools mpileup...
</code></pre>

<p>...</p>

<p><strong>samtools view</strong> takes an argument to only output the alignments overlapping the regions of a BED file:</p>
<pre><code>-L FILE  output alignments overlapping the input BED FILE [null]
</code></pre>