<p>Hi,</p>

<p>I have a bam files produced from mapping by LifeScope Tool (mapping of SOLiD reads). I would like to know the length of the reads that were mapped to the reference genome based on the information present in bam files. Is there a tool which can give me the stats of such things from bam files?</p>

<p>Thanks!</p>

<p>This will take the first million reads and give you counts of each read length. To look at more of the bam, get rid of the "head" command:</p>

<pre><code>samtools view file.bam | head -n 1000000 | cut -f 10 | perl -ne 'chomp;print length($_) . "\n"' | sort | uniq -c
</code></pre>
