Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Exercise:  Use samtools view with -F, -f and -q options to create a BAM with unmapped and low quality (< mq 20) reads removed, and only containing mapped, properly paired, high-quality (mapQ 20+) reads. Call the output file yeast_pe.sort.filt.bam.

Expand
titleExercise 3 solutionSolution
Code Block
languagebash
titlesolution
# if needed...
cd $SCRATCH/core_ngs/alignment/samtools
module load samtools

samtools view -b -F 0x04 -f 0x2 -q 20 -o yeast_pe.sort.filt.bam yeast_pe.sort.bam

...

Expand
titleHint

You want both the secondary (0x100) and unmapped (0x4) flags to be 0.

Expand
titleExercise 3 solutionSolution
Code Block
languagebash
titlesolution
samtools view -b -F 0x104 -f 0x2 -q 20 -o yeast_pe.sort.filt.bam yeast_pe.sort.bam

...