4.5 filterBAM

Writing reads that pass filters to BAM file

filterBAM filters BAM files and produces a filtered BAM file along with index. See Filter parameters for all possible filter methods along with their respective default settings. Counts of all removed reads are printed to the terminal as well after filtering.

4.5.1 Parameters

4.5.1.1 Input

--bam Input_bam_file.bam Input bam file

4.5.1.2 Specific Parameters

Parameter Description Default
--outQual min,max Constrain the quality scores to the indicated range (inclusive) when writing alignments. uses full range
--writeBinnedQualities Write Illumina-binned quality scores. write raw quality scores
--acceptedDistance integer_value Specify distance up-to which mates will not be considered orphans. 2000 bp
--keepOrphans Keep orphaned reads. Will filter out orphaned reads
--removeSoftClippedBases Remove all softclipped bases from read. Will not remove softclipped bases
--dryRun Don’t write any output.
--makeSingle mate=1 Set mate mate to singleEnded read and discard the other mate. Default mate is 1.

Note: If both outQual and writeBinnedQualities are given, qualities will be truncated first, then binned, and may thus fall outside the requested range.

4.5.2 Output

*__filtered.bam Filtered BAM file.
*_filtered.bam.bai Index for filtered BAM file.

4.5.3 Usage Example

# Simulate a BAM File with 3 diploid chromosomes and 1 haploid chromosome
atlas simulate --ploidy "2{3},1"

# Keep only the 3 diploid chromosomes and MQ>50
atlas filterBAM --bam ATLAS_simulations.bam --chr "chr1,chr2,chr3" --filterMQ "[50,256]"