![cigar bam file format description cigar bam file format description](https://slidetodoc.com/presentation_image_h/0cb0a7fef2a3884268a1ebfd442f00b9/image-19.jpg)
While they often provide valuable information, secondaryreads must be filtered for some downstream applications.Alternate locations for a mapped read are are flagged as secondary(flag 0x100).If a read's mapping quality is low (especially if it is zero, or mapQ 0 for short) the read maps to multiple locations on the genome (they are multi-hit or multi-mapping reads), and we can't be sure whether the reported location is the correct one.Īligners also differ in whether they report alternate alignments for multi-hit reads. Mapping qualities are a measure of how likely a given sequence alignment to its reported location is correct. Samtools view -c -F 0x4 -f 0x2 yeast_pe.sort.bam chrI:1000-2000 About mapping quality -F 0x XX – only report alignment records where the specified flags XX are all cleared(are all 0).you can provide the flags in decimal, or as here as hexidecimal.-f 0x XX – only report alignment records where the specified flags XX are all set(are all 1).-q N – only report alignment records with mapping quality of at least N ( >= N).The most common samtools view filtering options are: We focus on this filtering capability in this set of exercises. But samtools view also has options that let you do powerful filtering of the output. We have seen how samtools view can be used to binary-format BAM files into text format for viewing. Since BAM files are binary, they can't be viewed directly using standard Unix file viewers such as more, lessand head. Filteralignment records based on BAM flags, mapping quality or location ( samtools view).Index BAM files that have been sorted ( samtools index).Sort BAM files by reference coordinates ( samtools sort).Convert text-format SAM files into binary BAM files ( samtools view) and vice versa.There are many sub-commands in this suite, but the most common and useful are:
![cigar bam file format description cigar bam file format description](https://us.v-cdn.net/5019796/uploads/FileUpload/78/7ead8e153ecde1a7e68e8155e0aa7d.png)
As we have seen, the SAMTools suite allows you to manipulate the SAM/BAM files produced by most aligners.