Browse files

Fix bug which prevented "download all data from this track" from work…

…ing for BAM/SAM tracks.
  • Loading branch information...
1 parent 40d2053 commit 33ae992301bf9696e15cf7789f06cb55205ae0f7 @lstein lstein committed Jun 29, 2011
Showing with 8 additions and 3 deletions.
  1. +2 −0 Changes
  2. +6 −3 lib/Bio/Graphics/Browser2/TrackDumper.pm
View
2 Changes
@@ -4,6 +4,8 @@
* Update prerequisites to Text::ParseWords 3.27 in order to fix problem with
subtrack configuration parsing.
* Fix bug which prevented add tracks from working properly under IE8.
+ * Fix bug which prevented "download all data from this track" from working for BAM/SAM
+ tracks.
2.38
* Fix more semantic zooming bugs, particularly when zooming out from a BAM track.
View
9 lib/Bio/Graphics/Browser2/TrackDumper.pm
@@ -264,6 +264,7 @@ sub _dump_gff3 {
sub dump_sam {
my $self = shift;
my ($db,$segment,$types,$label) = @_;
+
my @args = $segment ? (-seq_id => $segment->seq_id,
-start => $segment->start,
-end => $segment->end)
@@ -275,13 +276,15 @@ sub dump_sam {
my $header = $db->header;
my $prefix = $self->add_prefix;
- my $seq_id = $segment->seq_id;
- $seq_id = "$prefix$seq_id" if $prefix;
print $header->text;
print "\@CO\t$key\n";
print "\@CO\tGenerated by GBrowse from ",$self->origin($label),"\n";
- print "\@CO\tSequence-region ",$seq_id,':',$segment->start,'..',$segment->end,"\n" if $segment;
+ if ($segment) {
+ my $seq_id = $segment->seq_id;
+ $seq_id = "$prefix$seq_id" if $prefix;
+ print "\@CO\tSequence-region ",$seq_id,':',$segment->start,'..',$segment->end,"\n" if $segment;
+ }
# there are problems with the filehandle-based conversion of
# BAM to TAM because the low-level functions write to STDOUT directly

0 comments on commit 33ae992

Please sign in to comment.