Removing the OQ tag from a BAM file
1
1
Entering edit mode
9.5 years ago

Hello,

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?

Thanks,
Mark

picard gatk samtools • 5.3k views
ADD COMMENT
5
Entering edit mode
9.5 years ago
sed 's/\tOQ\:Z\:[^\t]*//' in.sam > out.sam
ADD COMMENT
0
Entering edit mode

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!

ADD REPLY
0
Entering edit mode

ask this as a new question please.

ADD REPLY

Login before adding your answer.

Traffic: 868 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6