Possible To Convert Bam To Bam?
Is it possible to convert bam to bam? I have bam produced by default BWA; but I may also need bam filtered by tossing out those with mapping quality< 20. We can convert sam to bam with a quality cut-off as 20, but storage of sam file is painful (simply too large). So just wondering if I can convert default bam to quality-control bam, so that I only need to store bam file in my system.
thx
• 3,689 views
•
link
3 answers
samtools view -b -q 20 in.bam > out.bam
This will filter any alignments with a mapping quality < 20 from in.bam to out.bam
• 1 views
•
link
You can do this with [?]samtools[?]:
Samtools view has these options:
-b Output in the BAM format.
-q INT Skip alignments with MAPQ smaller than INT [0]
• 1 views
•
link
samtools view -q 20 -b inputbam > outputq20.bam
• 2 views
•
link
Log in to answer this question.