View Single Post
Old 05-25-2012, 04:37 AM   #2
Senior Member
Location: Berlin

Join Date: Jul 2011
Posts: 156

Define "retain mapping information"; do you need the information provided by the CIGARs? If you don't, such trimming is straightforward with a simple script chopping off the bases and qualities in the BAM (pipe "samtools view -h" into a script which skips over the headers, then for each line cuts down columns 10 and 11 to the desired length, and just replaces the CIGAR field with a *, piped into "samtools view -bS").
If you need to retain the information in the CIGARs properly, it becomes more messy, as you'd want to think about how to handle soft-clippings and indels.

Last edited by arvid; 05-25-2012 at 04:38 AM. Reason: typo
arvid is offline   Reply With Quote