I chose to fix this myself. Just like you, I did not find any tool that fixes all the Picard complaints.
So what I did is to write a wrapper around the
bwa sampe call and I intercept all the pairs coming out and fix flags and tags on the fly.
The only way you can know whether your read is unmapped or not is to check the corresponding flag bit. Once you caught the info, updates parts of the SAM alignment that need to be updated. And moreover, if you are dealing with paired-end experiments, as you are holding the alignment of the pair at the very same time, you can even update the mate information as well in the mate alignment & vice-versa.
Depending on the number of checks you want to do and your piece of code, it can increase (double sometimes in my case) the computation time, but at the end of the process, you have a clean file.
modified 7.3 years ago
7.3 years ago by
toni • 2.1k