Skip to content

Commit

Permalink
Fixed essential bug for ambiguous alignments in Bowtie2 mode (>= rath…
Browse files Browse the repository at this point in the history
…er than >...)
  • Loading branch information
FelixKrueger committed Jul 19, 2016
1 parent 1ab0457 commit a831ce7
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 8 deletions.
50 changes: 50 additions & 0 deletions RELEASE_NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
RELEASE NOTES FOR Bismark v0.16.2 (19 07 2016)
-------------------------------------------------

Bismark
=======

Fixed a bug for Bowtie 2 alignments where reads that should be considered ambiguous were incorrectly
assigned to the first alignment thread. This error had crept in during the 'changing the behavior of
corner cases' in v0.16.0). Thanks to John Gaspar for spotting this!

Changed the Shebang in all scripts of the Bismark suite to "#!/usr/bin/env perl" instead of
"#!/usr/bin/perl".

deduplicate_bismark
===================

Does now bail with a useful error message when the input files are empty.


bismark_genome_preparation
==========================

Added new option --genomic_composition so that the genomic composition can be calculated and written right
at the genome preparation stage rather than by using bam2nuc.


bam2nuc
=======

Now also calculates a fold coverage for the various (di-)nucleotides. The changes in the nucleotide_stats
text file are also picked up and plotted by bismark2report.

Added a new option --genomic_composition_only to just process the genomic sequence without requiring
any data files.


bismark2summary
===============

Added option -o/--basename <filename> to specify a certain filename. If not specified the name will
remain 'bismark_summary_report.txt/html'.

Added documentation and the options --help and --version to be consistent with the rest of Bismark.

Added option --title <string> to give the HTML report a different title





RELEASE NOTES FOR Bismark v0.16.1 (25 04 2016)
----------------------------------------------

Expand Down
17 changes: 9 additions & 8 deletions bismark
Original file line number Diff line number Diff line change
Expand Up @@ -3035,7 +3035,8 @@ sub check_bowtie_results_single_end_bowtie2{
}
}
else{
if ($alignment_score > $best_AS_so_far){ # AS are generally negative with a maximum of 0
if ($alignment_score >= $best_AS_so_far){ # AS are generally negative with a maximum of 0;
# 19 07 2016: changed this to >= so that equally good alignments are also added. Ambiguous alignments from different threads will be identified later on
$best_AS_so_far = $alignment_score;
$overwrite++;
# warn "Found better alignment score ($alignment_score), setting \$best_AS_so_far to $best_AS_so_far\n";
Expand All @@ -3050,7 +3051,7 @@ sub check_bowtie_results_single_end_bowtie2{
}
}
else{
# warn "current alignment (AS $alignment_score) isn't better than the best so far ($best_AS_so_far). Not changing anything\n";
# warn "Current alignment (AS $alignment_score) isn't better than the best so far ($best_AS_so_far). Not changing anything\n";
}
}

Expand Down Expand Up @@ -3133,16 +3134,15 @@ sub check_bowtie_results_single_end_bowtie2{
}
}
else{ # there is no second best hit, so we can just store this one and read in the next sequence

my $alignment_location = join (":",$chromosome,$position);

# warn "There is no second best hit. Overwrite status: $overwrite\n";
### If a sequence aligns to exactly the same location with a perfect match twice the sequence does either not contain any C or G, or all the Cs (or Gs on the reverse
### strand) were methylated and therefore protected. Alternatively it will align better in one condition than in the other. In any case, it is not needed to overwrite
### the same positional entry with a second entry for the same location, as the genomic sequence extraction and methylation call would not be affected by this. The only
### thing which would change is the index number for the found alignment). We will continue to assign these alignments to the first indexes 0 and 1, i.e. OT and OB

if ($overwrite){
# unless (exists $alignments{$alignment_location}){
$alignments{$alignment_location}->{seq_id} = $id;
$alignments{$alignment_location}->{alignment_score} = $alignment_score;
$alignments{$alignment_location}->{alignment_score_second_best} = undef;
Expand Down Expand Up @@ -3976,14 +3976,15 @@ sub check_bowtie_results_paired_ends_bowtie2{
}
}
else{
if ($sum_of_alignment_scores_1 > $best_AS_so_far){ # AS are generally negative with a maximum of 0
if ($sum_of_alignment_scores_1 >= $best_AS_so_far){ # AS are generally negative with a maximum of 0
# 19 07 2016 Changed to >= so that equally good alignments to different positions get added as well. Ambiguous alignments are identified and removed later.
$best_AS_so_far = $sum_of_alignment_scores_1;
$overwrite = 1;
# warn "Found better sum of alignment scores ($sum_of_alignment_scores_1), setting \$best_AS_so_far to $best_AS_so_far\n";
# resetting the ambiguous within thread memory (if applicable at all)
# warn "Resetting amb within thread value to 0\n";
$amb_same_thread = 0;

if ($ambig_bam){ # also setting a new first_ambig_alignment
# Read 1
$first_ambig_alignment_line1 = $fhs[$index]->{last_line_1};
Expand Down Expand Up @@ -10161,6 +10162,6 @@ Bismark SAM OUTPUT (default):
Each read of paired-end alignments is written out in a separate line in the above format.
Last edited on 13 April 2016
Last edited on 19 July 2016
HOW_TO
}

0 comments on commit a831ce7

Please sign in to comment.