A: How can I know the length of mapped reads from bam file? - http://www.biostars.org/p...
Feb 27, 2013
from
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:
samtools view file.bam | head -n 1000000 | cut -f 10 | perl -ne 'chomp;print length($_) . "\n"' | sort | uniq -c
- Chris Miller