You probably have a file in SAM format. Convert to BAM (samtools):
samtools view -bS -F 4 data.sam > data.bam
Convert from BAM to BED (bedtools command):
bamToBed -i data.bam > data.bed
BED to Sorted BED (unix system command):
sort -k1,1 data.bed > data.sorted
Sorted BED to BedGraph (bedtools command):
genomeCoverageBed -bga -i data.sorted -g chrom.sizes > data.bedGraph
Convert to bigwig for fast viewing (UCSC utilities):
bedGraphToBigWig data.bedGraph chrom.sizes data.bw
Finally, use a program like IGV to view it. On a Mac, it's as easy as selecting the right genome, then drag and drop the bigwig file into the window. You can now explore your underrepresented features.
Note that the chrom.sizes
file is a tab delimited file with the format: <chromosome name><tab><number of bases in chromosome>
You can skip all the
bed
stuff and just load a sorted and indexedbam
file directly into IGV. It shows a coverage track along with the reads, so it should give you the same result with fewer steps.Here are other ways to do it! http://onetipperday.blogspot.com/2012/07/three-ways-to-convert-bambed-file-to.html