Get coverage stats for a LOT of reference sequences

Sometimes we need to map reads to a multi-fasta reference with lots of sequences, e.g. to screen for large sets of genes or plasmids. The mapping works fine, but it can be tricksy to get alignment statistics (such as % of reads mapped) broken down by reference sequence, using common tools like Samtools, Bamtools or Bamstats.

Today we came across a tool that can do the job: sam-stats from the ea-utils fastq processing package.

Getting the statistics is easy:

sam-stats -A -B aln.bam > aln-stats.txt

(The ‘A’ option turns on reporting for all ‘chromosomes’, whilst ‘B’ tell the program the file is a BAM)

The details of the output can be found on the sam-stats wiki page. There you can also find more options for statistics, as well as utilities for removing adapter sequences and de-multiplexing fastqs.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s