== Create a bowtie index == bowtie-build input.fasta output_index_name == Working with samtools to summarize an alignment == If you have a sorted, indexed bam file: {{{ samtools idxstats bamfile.bam }}} returns a 4 column format of reference feature, length, # of mapped reads, # of unmapped reads (in case of paired end?) To summarize the total, you can use awk to add up the entries in the 3rd column: {{{ samtools idxstats bamfile.bam | awk '{sum += $3}END{print sum}' }}} === Map Quality === A value of 255 indicates that mapping quality is not available. === Tally multimapping reads within a region === The XA tag should have information about alternate hits. {{{ samtools view wt_tc_2.bam chrIV:160995-163154 | cut -f12 | sort | uniq -c }}}