Skip to content

Instantly share code, notes, and snippets.

@inodb
Created March 13, 2014 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inodb/9532170 to your computer and use it in GitHub Desktop.
Save inodb/9532170 to your computer and use it in GitHub Desktop.
Count the number of reads mapping to contigs of a given length
#!/bin/sh
samtools idxstats map.bam | awk '{split ($0, a, "\t")} {if (a[2]>999) SUM+=a[3]} END {print SUM}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment