Filtering reads
In this exercise, you will further clean-up the data by removing reads with low-quality alignments. To be able to do this you need to load alignment qualities from the BAM file. These are stored in the mapq field.
Este exercício faz parte do curso
ChIP-seq with Bioconductor in R
Instruções do exercício
- Load
reads
with information about the alignment qualities attached to each read. - Identify all alignments with a quality of at least 20.
- Create a boxplot comparing alignment quality distributions between the high and low-quality groups.
- Remove all low-quality alignments.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# Load reads with mapping qualities by requesting the "mapq" entries
reads <- readGAlignments(bam_file, param=ScanBamParam(what=___))
# Identify good quality alignments
high_mapq <- mcols(reads)$mapq >= ___
# Examine mapping quality distribution for high and low quality alignments
___(mcols(reads)$mapq ~ high_mapq, xlab="good quality alignments", ylab="mapping quality")
# Remove low quality alignments
reads_good <- subset(reads, ___)