...
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 |
---|
title | Exercise 3 solutionSolution |
---|
|
Code Block |
---|
language | bash |
---|
title | solution |
---|
| # 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 |
---|
|
You want both the secondary (0x100) and unmapped (0x4) flags to be 0. |
Expand |
---|
title | Exercise 3 solutionSolution |
---|
|
Code Block |
---|
language | bash |
---|
title | solution |
---|
| samtools view -b -F 0x104 -f 0x2 -q 20 -o yeast_pe.sort.filt.bam yeast_pe.sort.bam |
|
...