Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 19 commits
  • 11 files changed
  • 0 commit comments
  • 2 contributors
Commits on Jun 08, 2011
@hyphaltip hyphaltip readme to point to GIT fecf2ee
Commits on Jun 09, 2011
@lstein lstein Merge commit 'a9ec659cf3e808bc2e576262aae5be75cc276a1c' f871d69
@hyphaltip hyphaltip remove reference to SVN repo c158040
@lstein lstein benchmark enhancements; fixed crash with attempt to take log of negative a71aa42
@lstein lstein bumped version number and removed dangling debug statement 41bf082
@lstein lstein make SVG images download as type application/svg+xml rather than trig…
…gering inline display behavior.
74822f1
@lstein lstein Merge branch 'master' of github.com:GMOD/GBrowse 4c1c9bd
Commits on Jun 10, 2011
@lstein lstein update Text::ParseWords requirement to 3.27 to avoid parse errors in …
…subtrack definitions
4b4aa6b
Commits on Jun 28, 2011
@lstein lstein fix broken add tracks in IE8 bd77247
@lstein lstein update Text::ParseWords requirement to 3.27 to avoid parse errors in …
…subtrack definitions
f820b30
@lstein lstein Merge branch 'master' of github.com:GMOD/GBrowse c6d7179
@lstein lstein fix broken add tracks in IE8 -- added to changelog 40d2053
Commits on Jun 29, 2011
@lstein lstein Fix bug which prevented "download all data from this track" from work…
…ing for BAM/SAM tracks.
33ae992
@lstein lstein Fix bug in English translation that was causing other languages to ta…
…ke precedence even when browser was configured to accept them with lower precedence.
ac2e1ed
@lstein lstein bump version to 2.39 7671c61
Commits on Jul 02, 2011
@lstein lstein add EC2 script for launching slaves on AWS aef9e28
Commits on Jul 03, 2011
@lstein lstein add gbrowse_attach_slaves.pl support script for creating and attachin…
…g rendering slave processes to the gbrowse AMI.
ee3d597
@lstein lstein made the gbrowse_attach_slaves.pl script more user friendly d3047fc
Commits on Jul 04, 2011
@lstein lstein Merge branch 'development' of github.com:GMOD/GBrowse into development 87ec591
View
1  Build.PL
@@ -24,6 +24,7 @@ my $build = GBrowseInstall->new(
'ExtUtils::CBuilder' => 0,
'File::Temp' => 0,
'GD' => '2.07',
+ 'Text::ParseWords' => '3.27',
'IO::String' => 0,
'JSON' => 0,
'LWP' => 0,
View
18 Changes
@@ -1,6 +1,22 @@
+2.40
+ * Added support script for Amazon cloud image: gbrowse_attach_slaves.pl creates
+ slave instances for AMI ami-c6ca31af.
+
+2.39
+ * Download SVG images as type application/svg+xml rather than triggering
+ inline display behavior.
+ * 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.
+ * Fix bug in English translation that was causing other languages to take precedence
+ even when browser was configured to accept them with lower precedence.
+
2.38
- * Fix more semantic zooming bugs.
+ * Fix more semantic zooming bugs, particularly when zooming out from a BAM track.
* Fix blank tracks when viewing a datasource composed of only a single BAM database.
+ * Fix "can't take log of negative number" bug when zoomed way in.
2.37
* Preparations for faceted track searching
View
4 README
@@ -10,7 +10,9 @@ The 2.X versions are now considered stable. You may download it from
CPAN at http://search.cpan.org/~lds/GBrowse/ or get the developer's
version via SVN:
-svn co https://gmod.svn.sourceforge.net/svnroot/gmod/Generic-Genome-Browser/trunk Generic-Genome-Browser
+Checkout read-only
+git clone git://github.com/GMOD/GBrowse.git
+
The older 1.X version is still available for download here:
View
222 bin/gbrowse_attach_slaves.pl
@@ -0,0 +1,222 @@
+#!/usr/bin/perl
+use strict;
+
+use Term::ReadLine;
+
+use constant RENDERFARM_CONF => '/srv/gbrowse/etc/renderfarm.conf';
+use constant IMAGE_MAP => '/srv/gbrowse/etc/ami_map.txt';
+use constant SLAVE_SECURITY_GROUP => 'GBrowseSlave';
+use constant MASTER_SECURITY_GROUP => 'GBrowseMaster';
+use constant PORT_RANGE => '8101-8103';
+
+# This is called on the master to launch instances.
+# It discovers which species are mounted
+# on the current instance, snapshots them, and
+# attaches them to the slave(s).
+# EC2_ACCESS_KEY and EC2_SECRET_KEY must be defined
+
+$ENV{PYTHONPATH}='/usr/local/lib/python2.6/dist-packages';
+
+if ($ARGV[0] =~ /^--?h/) {
+ die <<END;
+Usage: gbrowse_attach_slaves.pl [number of slaves]
+
+For use with the Amazon GBrowse image.
+Launch indicated number of gbrowse slaves and attach the current set of
+mounted data directories to them. Relaunch server in render slave mode.
+END
+}
+
+my $TERM;
+check_eucarc();
+
+my $SLAVE_COUNT = shift || 1;
+
+my @mounts = get_species_mounts();
+my $snapshot_map = get_snapshot_map(\@mounts);
+my $ami_map = get_ami_map();
+
+# set up the block devices that need to be attached
+my @devices = map {"/dev/sd$_"} ('h'..'z');
+my $i = 0;
+my @block_args = ('-b','/dev/sdg=:0:true',map {
+ my $device = $devices[$i++];
+ my $species = $_->[1];
+ my $snapshot = $snapshot_map->{$species};
+ $snapshot ? ('-b',"${device}=${snapshot}:0:true") : (); # all these volumes are terminate-on-delete
+} @mounts);
+
+my $ami = $ami_map->{GBROWSE_SLAVE} or die "Couldn't look up current AMI for the slave";
+my $key = get_keypair();
+my $security = get_security_group();
+
+my @command = ('euca-run-instances','-k',$key,'-g',$security,@block_args,'-t','t1.micro','-n',$SLAVE_COUNT,$ami);
+
+# now get the IP addresses of these instances
+my @instances;
+open OUTPUT,'-|' or exec @command;
+while (<OUTPUT>) {
+ chomp;
+ next unless /^INSTANCE\s+(\S+)/;
+ push @instances,$1;
+}
+close OUTPUT;
+
+my %ips;
+while (keys %ips < $SLAVE_COUNT) {
+ print STDERR "waiting for instance to start....\n";
+ sleep 5;
+ chomp (my $output = `euca-describe-instances @instances`);
+ for my $line (split "\n",$output) {
+ next unless $line =~ /^INSTANCE/;
+ my @fields = split "\t",$line;
+ $ips{$fields[4]}++ if $fields[4];
+ }
+}
+
+open F,'>',RENDERFARM_CONF or die "Can't write ",RENDERFARM_CONF,": $!";
+print F "renderfarm = 1\n";
+print F "remote renderer =\n";
+my ($low,$hi) = split /-/,PORT_RANGE;
+foreach my $ip ('localhost',keys %ips) {
+ my $slaves = join ' ',map {"http://${ip}:$_"} ($low..$hi);
+ print F " $slaves\n";
+}
+close F;
+
+system "sudo /etc/init.d/apache2 restart";
+exit 0;
+
+sub get_snapshot_map {
+ my $mounts = shift;
+ my (%vol2snap,%mount2vol,%map);
+
+ print STDERR "Identifying slave AMI...\n";
+
+ chomp (my $instance = `curl -s http://169.254.169.254/latest/meta-data/instance-id`);
+ chomp (my $volumes = `euca-describe-volumes`);
+
+ # get volume and snapshot id for each mounted volume
+ for my $line (split "\n",$volumes) {
+ if ($line =~ /^VOLUME/) {
+ my ($vol,$snap) = (split /\t/,$line)[1,3];
+ $vol2snap{$vol} = $snap;
+ } elsif ($line =~ /^ATTACHMENT/) {
+ next unless $line =~ /\s$instance\s/;
+ my ($vol,$mount) = (split /\t/,$line)[1,3];
+ $mount2vol{$mount} = $vol;
+ }
+ }
+
+ for my $m (@$mounts) {
+ my ($device,$species) = @$m;
+ $device =~ s/\d+$//;
+ my $vol = $mount2vol{$device} or next;
+ my $snap = $vol2snap{$vol};
+ $snap ||= make_snap($vol);
+ $map{$species} = $snap;
+ }
+
+ return \%map;
+}
+
+sub make_snap {
+ die "make_snap() unimplemented";
+}
+
+sub get_species_mounts {
+ print STDERR "Determining which volumes to mount...\n";
+ my @mounts;
+ open F,'/proc/mounts' or die "Can't open /proc/mounts: $!";
+ while (<F>) {
+ chomp;
+ my ($dev,$mount_point,@etc) = split /\s+/;
+ next unless $mount_point =~ m!/srv/gbrowse/species/([^/]+)!;
+ push @mounts,[$dev,$1];
+ }
+ close F;
+ return @mounts;
+}
+
+sub get_ami_map {
+ my %map;
+ open F,IMAGE_MAP or die "Can't open ",IMAGE_MAP,": $!";
+ while (<F>) {
+ chomp;
+ next if /^#/;
+ my ($role,$ami) = split /\s+/;
+ $map{$role} = $ami;
+ }
+ close F;
+ return \%map;
+}
+
+sub get_keypair {
+ my $out = `curl -s http://169.254.169.254/latest/meta-data/public-keys/`;
+ my ($keyname) = $out =~ /0=(.+)/;
+ return $keyname;
+}
+
+sub get_security_group {
+ print STDERR <<END;
+Creating appropriate security group...
+If you see duplication warnings, it is because there are already (possibly inactive)
+slave instances defined for this master. This will not adversely affect the new slaves,
+but you may wish to terminate the old ones to recover storage space.
+END
+
+ my $ssg = SLAVE_SECURITY_GROUP;
+ my $range = PORT_RANGE;
+ chomp (my $ip = `curl -s http://169.254.169.254/latest/meta-data/local-ipv4/`);
+ chomp (my $instance = `curl -s http://169.254.169.254/latest/meta-data/instance-id`);
+ $ssg .= "-$instance";
+ chomp (my $result = `euca-delete-group $ssg`);
+ chomp ($result = `euca-add-group -d'security group for gbrowse render slaves allows ssh and ports $range' $ssg`);
+ warn $result unless $result =~ /^GROUP/;
+ chomp ($result = `euca-authorize -P tcp -p 22 -s $ip/32 $ssg`);
+ warn $result unless $result =~ /PERMISSION/;
+ chomp ($result = `euca-authorize -P tcp -p $range -s $ip/32 $ssg`);
+ warn $result unless $result =~ /PERMISSION/;
+ return $ssg;
+}
+
+sub check_eucarc {
+ if (-r "$ENV{HOME}/.eucarc") {
+ open my $f,"$ENV{HOME}/.eucarc" or die "~/.eucarc: $!";
+ while (<$f>) {
+ chomp;
+ my ($key,$value) = /^(EC2\w+)\s*=\s*(.+)/ or next;
+ $ENV{$key}=$value;
+ }
+ }
+
+ $ENV{EC2_URL} ||= get_ec2_url();
+ $ENV{EC2_ACCESS_KEY} ||= get_access_key();
+ $ENV{EC2_SECRET_KEY} ||= get_secret_key();
+}
+
+sub get_ec2_url {
+ chomp (my $zone = `curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone`);
+ chop $zone; # remove trailing 'a','b'...
+ return "http://ec2.$zone.amazonaws.com";
+}
+
+sub get_access_key {
+ print STDERR "\n";
+ print STDERR "I need your EC2 access key id. You can find this under \"Security Credentials\" on your Amazon account page.\n";
+ print STDERR "To avoid this prompt in the future, create a ~/.eucarc file containing the line EC2_ACCESS_KEY=<access key>\n";
+ return prompt ('EC2_ACCESS_KEY:');
+}
+
+sub get_secret_key {
+ print STDERR "\n";
+ print STDERR "I need your EC2 secret key. You can find this under \"Security Credentials\" on your Amazon account page.\n";
+ print STDERR "To avoid this prompt in the future, create a ~/.eucarc file containing the line EC2_SECRET_KEY=<access key>\n";
+ return prompt ('EC2_SECRET_KEY:');
+}
+
+sub prompt {
+ my $prompt = shift;
+ $TERM ||= Term::ReadLine->new('gbrowse_attach_slaves.pl');
+ return $TERM->readline($prompt);
+}
View
2  cgi-bin/gbrowse_img
@@ -258,7 +258,7 @@ sub render_image {
unlink $in,$out;
}
elsif ($format eq 'GD::SVG') {
- print $self->header(-type => 'image/svg+xml',
+ print $self->header(-type => 'application/svg+xml',
-content_disposition => "filename=$fname.svg");
print $img_data;
}
View
59 conf/languages/en.pm
@@ -90,21 +90,25 @@ END
DOWNLOAD => 'Download',
- DISPLAY_SETTINGS => 'Display Settings',
+ DOWNLOAD_ALL => 'Download entire dataset',
- TRACKS => 'Tracks',
+ TRACK_ID => 'Track ID=<b>%s</b>',
+ DISPLAY_SETTINGS => 'Display Settings',
+ TRACKS => 'Tracks',
+
+
# FAVORITE MENU LINKS
FAVORITES => 'Show Favorites Only',
SHOWALL => 'Show All',
- REFRESH_FAV => 'Refresh',
+ REFRESH_FAV => 'Refresh Favorites',
CLEAR_FAV => 'Clear All Favorites',
- ADDED_TO => 'Add track to favorites',
+ ADDED_TO => 'Add track to favorites',
#############
@@ -149,6 +153,8 @@ END
SELECT_SUBTRACKS => 'showing %d/%d subtracks',
+ NO_TRACK_CITATION => 'There is no additional information about this track.',
+
EDIT => 'Edit File...',
DELETE => 'Delete File',
@@ -219,9 +225,7 @@ END
REMOTE_TITLE => 'Add remote annotations',
- #ipad
- IPAD_BALLOON => 'Tap features twice see more details '
- #
+ IPAD_BALLOON => 'Tap features twice to see more details',
REMOTE_URL => 'Enter remote track URL',
@@ -391,6 +395,9 @@ END
ADD_YOUR_OWN_TRACKS => 'Add custom tracks',
ADD_DESCRIPTION => 'Click to add a description',
+ ADD_TITLE => 'Click to edit the title',
+ EDIT_LABEL => 'Click to view track. Shift or control-click to edit.',
+ NO_DESCRIPTION => 'No description',
CONFIGURATION => 'Configuration',
@@ -432,6 +439,9 @@ END
SCALE_MAX => 'Maximum scale value',
+ MIN => 'Min',
+ MAX => 'Max',
+
SHOW_VARIANCE => 'Show variance band',
APPLY_CONFIG => 'Apply config when view between',
@@ -529,20 +539,36 @@ This track is another user\'s custom uploads; it is shared under a <b>%s</b>
policy, so you are free to send the link to other users.
END
+ SHARE_GROUP_EMAIL_SUBJECT => <<END,
+Track sharing notification from the %s browser
+END
+
+ SHARE_GROUP_EMAIL => <<END,
+The user named %s has shared some tracks with you. They will appear in your "Custom Tracks" section the next time you log into %s. To see the shared track(s) now, click on %s.
+
+Additional information about the shared tracks follows:
+
+ Upload name: %s
+ Upload description: %s
+ Track names: %s
+
+If you wish to remove these tracks from your session, go to "Custom Tracks" and click on the '[X]' next to the upload name. To add it back to your session, click on %s.
+END
+
OTHER_SHARE_METHODS => <<END,
You can also share it with another user by setting its permissions to
<b>public</b> and giving them this link or letting them search for the
track by name, or by changing its permissions to <b>group</b> and adding
the user you want by username. To do this, select the "Custom Tracks"
page and choose the sharing policy you want with the drop-down menu in
-the "sharing" section, then type the user\'s name or ID in the input
+the "sharing" section, then type the user's name or ID in the input
field provided.
END
CANT_SHARE => <<END,
Sorry, this track is owned by another user who has only allowed access to
-a limited group of other users. Since it\'s not yours, you can\'t share it
-with anyone else. In order to share this track, you\'ll have to ask them
+a limited group of other users. Since it's not yours, you can't share it
+with anyone else. In order to share this track, you'll have to ask them
for permission.
END
@@ -563,10 +589,11 @@ END
EMAIL_MY_PASSWORD => 'E-mail my password',
EDIT_ACCOUNT_DETAILS => '%s: Edit account details',
CONTINUE => 'Continue',
+ HAVE_OPENID => 'Have an OpenID?',
WITH_OPENID => 'with your OpenID',
SIGN_IN => 'Sign in',
+ OPENID_PROMPT => "Select your OpenID provider's icon from the list below, or type your OpenID into the text box.",
DONT_HAVE_OPENID => 'Don\'t have an OpenID?',
- OPENID_PROMPT => "Select your OpenID provider\'s icon from the list below, or type your OpenID into the text box.",
GO_BACK => 'Go Back.',
ALL_FIELDS_REQUIRED => 'All fields are required.',
PASSWORDS_DO_NOT_MATCH => 'Passwords do not match.',
@@ -632,6 +659,7 @@ END
PASSWORD_CHANGE_SUCCESS => 'Your password has been changed successfully.',
OPENID_ADD_SUCCESS => 'Your OpenID has been added successfully.',
OPENID_REMOVE_SUCCESS => 'Your OpenID has been removed successfully.',
+ OPENID_ADD_FAILED => 'The OpenID could not be added: %s',
OPERATION_SUCCESS => 'Operation completed successfully.',
BACK => 'Back',
CREATE_ACCOUNT => 'Create Account',
@@ -646,13 +674,17 @@ END
'account, please type in your username and click the "Continue" button below.',
MUST_TYPE_USERNAME => 'You must type in your username to continue.',
INCORRECT_LINK => 'The confirmation code provided is either incorrect or expired.<br> Please click continue to exit.',
+ PENDING => 'pending',
+
WELCOME => 'Welcome, %s',
LOG_OUT_DESC => 'Click here to log out from %s',
LOG_OUT => 'Log Out',
CHANGE_SETTINGS_DESC => 'Click here to change your account settings',
LOGIN_CREATE_DESC => 'Click here to log in or create a new account. This will allow you to access your settings and uploaded tracks from multiple computers.',
+ LOGIN_REQUEST => 'Please log in %s',
LOGIN => 'Log in',
LOGIN_CREATE => 'Log in / create account',
+ LOGIN_REQUIRED => 'You must log in to access this data source',
#------------
# USER TRACKS
@@ -674,6 +706,7 @@ END
SHARING => 'Sharing:',
TRACK_IS => 'Track is',
SHARED_WITH_YOU => '<b>shared</b> with you',
+ SHARING_ADD_USER => 'Add',
SHARING_PRIVATE => 'Private',
SHARING_CASUAL => 'Casual',
SHARING_GROUP => 'Group',
@@ -752,8 +785,8 @@ END
CLICK_MODIFY_SUBTRACK_SEL => 'Click to modify subtrack selections.',
CLICK_FOR_MORE => 'Click for more',
PLUGIN_BASE_CLASS_DUMP => "This is the base class for all GBrowse plugins.\n".
- "The fact that you\'re seeing this means that the author of ".
- "this plugin hasn\'t yet implemented a real dump() method.\n",
+ "The fact that you're seeing this means that the author of ".
+ "this plugin hasn't yet implemented a real dump() method.\n",
PLUGIN_BASE_CLASS_DESC => "This is the base class for all GBrowse plugins.\n".
"The fact that you're seeing this means that the author of ".
"this plugin hasn't yet entered a real description.\n",
View
10 htdocs/js/controller.js
@@ -252,9 +252,9 @@ var GBrowseController = Class.create({
var first_track = tracks[0];
if (onTop && first_track != null)
- parent_obj.insertBefore(tmp_element,first_track[0]);
+ parent_obj.insert(tmp_element,{before: first_track[0]});
else
- parent_obj.appendChild(tmp_element);
+ parent_obj.insert(tmp_element);
// Move each child node but skip if it is a comment (class is undef)
if (tmp_element.hasChildNodes()) {
@@ -263,9 +263,9 @@ var GBrowseController = Class.create({
if (children[i].className == undefined)
continue;
if (onTop && first_track != null)
- parent_obj.insertBefore(children[i],first_track);
+ parent_obj.insert(children[i],{before:first_track});
else
- parent_obj.appendChild(children[i]);
+ parent_obj.insert(children[i]);
}
}
parent_obj.removeChild(tmp_element);
@@ -487,7 +487,6 @@ var GBrowseController = Class.create({
var get_tracks = false;
for (var ret_track_id in track_data) {
-
if (Controller.gbtracks.get(ret_track_id) != null)
continue; //oops already know this one
@@ -1071,7 +1070,6 @@ show_info_message:
var sections = new Array(custom_tracks_id, track_listing_id);
if (using_database()) sections.push(community_tracks_id);
Controller.update_sections(sections);
- //alert($(label+'_title').select('span.drag_region').innerHTML);
var titles = $(label+'_title').select('span.drag_region');
titles[0].innerHTML='<b>'+new_key+'</b>';
}
View
2  lib/Bio/Graphics/Browser2.pm
@@ -2,7 +2,7 @@ package Bio::Graphics::Browser2;
# $Id$
# Globals and utilities for GBrowse and friends
-our $VERSION = '2.37';
+our $VERSION = '2.39';
use strict;
use warnings;
View
8 lib/Bio/Graphics/Browser2/I18n.pm
@@ -61,10 +61,10 @@ sub tr_table {
my $self = shift;
my @languages = @_;
my $table;
- for my $lang (@languages) {
- $self->{tr}{$lang} = $self->read_table($lang)
- unless exists $self->{tr}{$lang};
- return $self->{tr}{$lang} if $self->{tr}{$lang};
+ for my $lang (@languages) {
+ $self->{tr}{$lang} = $self->read_table($lang)
+ unless exists $self->{tr}{$lang};
+ return $self->{tr}{$lang} if $self->{tr}{$lang};
}
return {}; # language could not be loaded
}
View
18 lib/Bio/Graphics/Browser2/RenderPanels.pm
@@ -1123,7 +1123,7 @@ sub calculate_scale_size {
return ($guesstimate, $label);
}
-sub log10 { log(shift)/log(10) }
+sub log10 { return eval {log(shift)/log(10)} || 0 }
# Deprecated. This method was used to add the scale to the detail scale track. This is now done in javascript.
sub make_scale_feature {
@@ -1463,6 +1463,8 @@ sub run_local_requests {
my $track_args = $requests->{$label}->track_args;
my $track = $panel->add_track(@$track_args);
+ warn "track_setup($label): ",time()-$time," seconds " if BENCHMARK;
+
# == populate the tracks with feature data ==
$self->add_features_to_track(
-labels => [ $label, ],
@@ -1471,19 +1473,29 @@ sub run_local_requests {
-segment => $segment,
-fsettings => $settings->{features},
);
- %trackmap = ($track=>$label);
+ warn "add_features($label): ",time()-$time," seconds " if BENCHMARK;
+
+ %trackmap = ($track=>$label);
}
# == generate the images and maps in background==
$gd = $panel->gd;
+ warn "render gd($label): ",time()-$time," seconds " if BENCHMARK;
+
$titles = $panel->key_boxes;
foreach (@$titles) {splice (@$_,-1)} # don't want to store all track config data to cache!
$self->debugging_rectangles($gd,scalar $panel->boxes)
if DEBUGGING_RECTANGLES;
- $map = $self->make_map( scalar $panel->boxes,
+ warn "render titles($label): ",time()-$time," seconds " if BENCHMARK;
+
+ my $boxes = $panel->boxes;
+ warn "boxes($label): ",time()-$time," seconds " if BENCHMARK;
+
+ $map = $self->make_map( $boxes,
$panel, $label,
\%trackmap, 0 );
+ warn "make_map($label): ",time()-$time," seconds " if BENCHMARK;
}
$requests->{$label}->put_data($gd, $map, $titles );
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

No commit comments for this range

Something went wrong with that request. Please try again.