Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect values in XA:Z and XB:Z tags with --non_bs_mm option? #262

Closed
lweasel opened this issue May 28, 2019 · 3 comments
Closed

Incorrect values in XA:Z and XB:Z tags with --non_bs_mm option? #262

lweasel opened this issue May 28, 2019 · 3 comments

Comments

@lweasel
Copy link

lweasel commented May 28, 2019

Hi - thank you for the continued development of Bismark!

We think that there may be a bug in the function paired_end_SAM_output() (

Bismark/bismark

Line 8173 in c752170

sub paired_end_SAM_output{
). Starting at line 8614 (

Bismark/bismark

Line 8614 in c752170

my $seq_1_N_count = $number_of_mismatches_1 % 6; # modulo 6 will return the integer rest after the division
) the code is adjusting the Bowtie2 alignment score to calculate the number of non-bisulfite mismatches in the case that the --non_bs_mm option has been specified.

However it appears that these lines are within the code block that is checking for the presence of a deletion or insertion in the second cigar string (i.e. the code block that starts on line 8573,

Bismark/bismark

Line 8573 in c752170

if ($cigar_2 =~ /(D|I)/) {
), rather than after it. Thus it appears that the division of the alignment scores by 6 in order to calculate the number of mismatches only occurs if there is a deletion or insertion in the second cigar string?

We noticed this with a read containing a single non-bisulfite mismatch to the human genome which reported six mismatches in the XA:Z tag.

@FelixKrueger
Copy link
Owner

Dear Owen,

Many thanks for spotting this, you are absolutely right about the scoping. Can you test out the new dev version and let me know if there are still any problems? Best, Felix

@lweasel
Copy link
Author

lweasel commented May 29, 2019

Dear Felix,

Yes the new dev version works perfectly now - thanks!

@FelixKrueger
Copy link
Owner

Brilliant, thanks for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants