Removes reads from a BAM file based on criteria.
Given a BAM file, this tool will discard reads that did not meet the selected filtering criteria The output is another BAM file with the reads not matching the criteria removed.
Currently, the available filters are:
Agument | Description |
---|---|
-minlen val | Remove reads that are smaller than {val} |
-maxlen val | Remove reads that are larger than {val} |
-mapped | Keep only mapped reads |
-unmapped | Keep only unmapped reads |
-properpair | Keep only properly paired reads (both mapped, correct orientation, flag set in BAM) |
-noproperpair | Keep only not-properly paired reads |
-mask bitmask | Remove reads that match the mask (e.g. 0x400) |
-uniq {length} | Remove reads that are have the same sequence Note: BAM file should be sorted (up to an optional length) |
-uniq_start | Remove reads that start at the same position Note: BAM file should be sorted (Use only for low-coverage samples) |
-mismatch num | Number of mismatches or indels indel always counts as 1 regardless of length (requires NM tag in reads) |
-nosecondary | Remove reads that have the 0x100 flag set |
-noqcfail | Remove reads that have the 0x200 flag set |
-nopcrdup | Remove reads that have the 0x400 flag set |
-excludebed file.bed {nostrand} | Remove reads that are in any of the regions from the given BED file. If 'nostrand' is given, strand information from the BED file is ignored. |
-includebed file.bed {nostrand} | Remove reads that are NOT any of the regions from the given BED file. If 'nostrand' is given, strand information from the BED file is ignored. Note: If this is a large dataset, use "bamutils extract" instead. |
-includeref refname | Exclude reads NOT mapped to a reference |
-excluderef refname | Exclude reads mapped to a particular reference (e.g. chrM, or _dup chromosomes) |