Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Adam2Fastq should output reverse complement when 0x10 flag is set for read #980
The expected output of bam2fastq conversion is to reverse complement the output sequence when the alignment record was marked as reverse complemented with the 0x10 flag.in the SAM/BAM file.
Currently this does not happen, as the same seq string as is found in the BAM file is output in fastq regardless of 0x10 flag. Qualities need to be reversed as well.
Samtools follows this standard and recent discussion with Shop from Simons project brought this issue up as a common mistake in bam2fastq utilities.
@jpdna Looks like the seq and quality scores are reverse complemented/reversed under some conditions - are these not correct?
I did some comparisons with adam and picard's bam2fastq to see the same results, I think one of these tests is checked in
referenced this issue
Mar 26, 2016
@arahuja, thanks - you are correct that in most cases the rev comp is happening as intended, but as described below I think the case of reads with flags set as both reverse and unmapped is currently handled incorrectly in the code and tests.
It happens that the first case I looked at was one where the reverse
I interpret the above to to mean that seeing flags
So, I think that samtools and Picard are correct and the current behavior in ADAM should be changed to match, and the fastq currently generated by ADAM is actually incorrect in these cases and not suitable to be used as input to a new alignment because they will appear to map to the wrong strand.
This sounds like a reasonable read to me. If I had my druthers, SAM would strictly not allow certain fields (e.g.,