<p>Is there a Picard Tool to filter one or more reads through the following : </p>

<ul>
<li>FLAG (second column) </li>
<li>Mapping Quality (MAPQ 5th Column) </li>
<li>TLEN (9th Column)</li>
</ul>

<p>?? </p>

<p>You can use <a href='https://github.com/pezmaster31/bamtools'>BamTools</a> with its <strong>filter</strong> utility. You need to write a .json file like this one:</p>

<pre><code>{
"isMapped" : "true",
"mapQuality" : "&gt;50",
"isPaired" : "true"
}
</code></pre>

<p>And run command</p>

<pre><code>bamtools filter -in in.bam -out out.bam -script filter.json
</code></pre>

<p>See a tutorial <a href='https://github.com/pezmaster31/bamtools/wiki/Tutorial_Toolkit_BamTools-1.0.pdf'>here</a>.</p>

<p>I don't see a way to extract TLEN with it, though.</p>
