I'd like to remove a tag (not a read) from a BAM file. I would like to remove the OQ tag that keeps original qualities after running BQSR. Any suggestions on how I might do this?
sed 's/\tOQ\:Z\:[^\t]*//' in.sam > out.sam
Hi Pierre! I found your answer when I was searching for a way to make bam files (~250GB) smaller by removing base qualities and tags and other unwanted information (doing copy number analysis, for me base qualities and tags are somehow unwanted information). Currently, I am using bamUtils squeeze (I don't know yet how good this tool is in making the bam file smaller [This is replacing QNAME to an integer, removing the duplicates, removing the OG tag but not the QUAL field!]) and previously I used cgat bam2bam strip-quality deleting only the QUAL field (which was slow [12 hours for a 160 GB] and didn't gain much: 3GB smaller for a 160GB file). I was wondering if deleting whatever comes after the SEQ will work (i.e QUAL and all other tags)? and if yes, what would be the fastest way to apply that? Thanks in advance for sharing your ideas!
cgat bam2bam strip-quality
ask this as a new question please.
Login before adding your answer.
Use of this site constitutes acceptance of our User Agreement and Privacy