Is there a tool which will edit the flag for all reads in a BAM file?
In my case: The GEM aligner sets the "paired" flag for all reads in the resulting BAM file.... even if you give it single-ended reads. This causes PICARD, GATK, etc. to throw many Warnings or Exit. Thus, I need a tool that will set the "paired" flag to 0 for all reads mapped by GEM.
BioAwk seems promising, but I can't see how it can set only the "paired" bit to 0 while leaving the other bits untouched.
Here are my GEM commands:
gem-indexer -i ref.fa -o ref.ix -c dna --complement no --threads 1 gem-mapper -I ref.ix.gem -i illumina.fq -q offset-33 -o gem.out -m 2 -e 2 --max-big-indel-length 0 -d 1 --threads 1 gem-2-sam -I ref.ix.gem -i gem.out.map -q offset-33 --threads 1 --expect-single-end-reads -l -o out.sam