CommencerCommencer gratuitement

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.

Cet exercice fait partie du cours

ChIP-seq with Bioconductor in R

Afficher le cours

Instructions

  • 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.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# 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, ___)
Modifier et exécuter le code