Skip to content

Commit

Permalink
all regression tests work again
Browse files Browse the repository at this point in the history
  • Loading branch information
lstein committed Dec 19, 2008
1 parent 6ec0dd9 commit 15cb385
Show file tree
Hide file tree
Showing 10 changed files with 226 additions and 15 deletions.
9 changes: 7 additions & 2 deletions Build.PL
Expand Up @@ -18,6 +18,7 @@ my $build = GBrowseInstall->new(
requires => {
'perl' => '5.008',
'Bio::Root::Version' => '1.005002',
'Bio::Graphics' => 0,
'GD' => '2.07',
'IO::String' => 0,
'CGI::Session' => '4.02',
Expand All @@ -27,11 +28,15 @@ my $build = GBrowseInstall->new(
'JSON' => 0,
'LWP' => 0,
},
recommends => { 'BerkeleyDB' => 0.32 },
recommends => {
'DB_File::Lock' => 0,
'DBI' => 0,
'DBD::mysql' => 0,
'DBD::Pg' => 0,
},
script_files => [
'bin/gbrowse_slave',
'bin/make_das_conf.pl',
'bin/gbrowse_slave',
# not sure if these still work
# 'bin/register_moby_services.pl',
# 'bin/process_wormbase.pl',
Expand Down
1 change: 1 addition & 0 deletions MANIFEST
Expand Up @@ -68,6 +68,7 @@ conf/plugins/Submitter.pm
conf/plugins/test.pm
conf/plugins/TestFinder.pm
conf/slave_preload.conf
conf/yeast_simple.conf
conf/yeast_chr1+2.conf
conf/yeast_renderfarm.conf
contrib/ace2gff.pl
Expand Down
8 changes: 6 additions & 2 deletions conf/GBrowse.conf
Expand Up @@ -70,7 +70,7 @@ head =
header =

# At the footer
footer = <hr /><pre>$Id: GBrowse.conf,v 1.34 2008-11-26 21:16:12 lstein Exp $</pre>
footer = <hr /><pre>$Id: GBrowse.conf,v 1.35 2008-12-19 03:11:00 lstein Exp $</pre>

# Various places where you can insert your own HTML -- see configuration docs
html1 =
Expand Down Expand Up @@ -112,7 +112,11 @@ annotation edit cols = 100
default source = yeast

[yeast]
description = S. cerevisiae chromosomes I & II
description = Yeast chromosomes 1+2 (basic)
path = yeast_simple.conf

[yeast_advanced]
description = Yeast chromosomes 1+2 (advanced)
path = yeast_chr1+2.conf

[renderfarm]
Expand Down
2 changes: 1 addition & 1 deletion conf/yeast_chr1+2.conf
@@ -1,5 +1,5 @@
[GENERAL]
description = S. cerevisiae chromosomes I and II
description = Yeast chromosomes 1+2 (advanced)
database = scaffolds

initial landmark = chrI:143000..180000
Expand Down
187 changes: 187 additions & 0 deletions conf/yeast_simple.conf
@@ -0,0 +1,187 @@
[GENERAL]
description = Yeast chromosomes 1+2 (basic)
database = scaffolds

initial landmark = chrI:143000..180000

# color of the selection rectangle
hilite fill = beige
hilite outline = red

default features = Genes
ORFs
tRNAs
CDS
Transp
Centro:overview
Landmarks:region

# examples to show in the introduction
examples = chrI
chrII
chrI:80,000..120,000
"membrane trafficking"
NUT21
YAL063C

# "automatic" classes to try when an unqualified identifier is given
automatic classes = Symbol Gene Clone

#################################
# database definitions
#################################

[scaffolds:database]
db_adaptor = Bio::DB::SeqFeature::Store
db_args = -adaptor memory
-dir $DATABASES/yeast_scaffolds

[annotations:database]
db_adaptor = Bio::DB::SeqFeature::Store
db_args = -adaptor memory
-dir $DATABASES/yeast_chr1+2


# Default glyph settings
[TRACK DEFAULTS]
glyph = generic
database = annotations
height = 8
bgcolor = cyan
fgcolor = cyan
label density = 25
bump density = 100

### TRACK CONFIGURATION ####
# the remainder of the sections configure individual tracks

[Centro:overview]
feature = centromere
bgcolor = blue
glyph = dot
fgcolor = black
height = 8
point = 1
key = Centromeres

[tRNA:overview]
feature = tRNA
glyph = generic
bgcolor = lightgray
fgcolor = black
height = 4
stranded = 1
description = 1
key = tRNAs

[RegionLandmarks:region]
glyph = dna
global feature = 1
database = scaffolds
height = 40
gc_window = auto
do_gc = 1
strand = both
fgcolor = red
axis_color = blue
key = GC Content

[Genes]
feature = gene
glyph = so_transcript
bgcolor = yellow
forwardcolor = yellow
reversecolor = turquoise
label = sub { my $f = shift;
my $name = $f->display_name;
my @aliases = $f->attributes('Alias');
$name .= " (@aliases)" if @aliases;
$name;
}
height = 6
description = 0
key = Named gene

[CDS]
feature = CDS
glyph = cds
description = 0
height = 26
sixframe = 1
label = sub {shift->name . " reading frame"}
key = CDS
citation = This track shows CDS reading frames.

[tRNAs]
feature = tRNA
glyph = generic
bgcolor = lightgray
fgcolor = black
height = 4
stranded = 1
description = 1
key = tRNAs

[Transp]
feature = LTR_retrotransposon
glyph = segments
bgcolor = yellow
fgcolor = black
height = 5
stranded = 1
key = Transposons

[LTRs]
feature = long_terminal_repeat
fgcolor = black
glyph = anchored_arrow
height = 6
key = Long Terminal Repeats

[Translation]
glyph = translation
global feature = 1
database = scaffolds
height = 40
fgcolor = purple
strand = +1
translation = 6frame
key = 6-frame translation

[TranslationF]
glyph = translation
global feature = 1
database = scaffolds
height = 20
fgcolor = purple
strand = +1
translation = 3frame
key = 3-frame translation (forward)

[DNA/GC Content]
glyph = dna
global feature = 1
database = scaffolds
height = 40
do_gc = 1
gc_window = auto
strand = both
fgcolor = red
axis_color = blue

[TranslationR]
glyph = translation
global feature = 1
database = scaffolds
height = 20
fgcolor = blue
strand = -1
translation = 3frame
key = 3-frame translation (reverse)

[ncRNA]
feature = RNAd rRNA:sgd snRNA:sgd snoRNA:sgd
fgcolor = orange
glyph = generic
description = 1
key = Noncoding RNAs
5 changes: 4 additions & 1 deletion install_util/GBrowseInstall.pm
Expand Up @@ -69,7 +69,10 @@ sub ACTION_demo {
open STDOUT,"<&",$saveout;

# fix GBrowse.conf to point to correct directories
for my $f ('GBrowse.conf','yeast_chr1+2.conf','yeast_renderfarm.conf') {
for my $f ('GBrowse.conf',
'yeast_simple.conf',
'yeast_chr1+2.conf',
'yeast_renderfarm.conf') {
my $in = IO::File->new("$dir/conf/$f") or die $!;
my $out = IO::File->new("$dir/conf/$f.new",'>') or die $!;
while (<$in>) {
Expand Down
7 changes: 4 additions & 3 deletions lib/Bio/Graphics/Browser/Render/Slave.pm
Expand Up @@ -233,25 +233,26 @@ sub render_tracks {
my $panel_args = thaw param('panel_args');

$self->Debug("render_tracks(): Opening database...");
my $db = $datasource->open_database($tracks->[0] || 'general');
my $db = $datasource->open_database();
$self->Debug("render_tracks(): Got database handle $db");
$self->Debug("rendering tracks @$tracks");

# extract segments
my ($segment) = $db->segment(-name => $settings->{'ref'},
-start => $settings->{'start'},
-stop => $settings->{'stop'});
$self->Fatal("Can't get segment for $settings->{ref}:$settings->{start}..$settings->{stop}")
$self->Fatal("Can't get segment for $settings->{ref}:$settings->{start}..$settings->{stop} (1)")
unless $segment;

# BUG: duplicated code from Render.pm -- move into a common place
$panel_args->{section} ||= ''; # prevent uninit variable warnings
if ($panel_args->{section} eq 'overview') {
$segment = Bio::Graphics::Browser::Region->whole_segment($segment,$settings);
} elsif ($panel_args->{section} eq 'region') {
$segment = Bio::Graphics::Browser::Region->region_segment($segment,$settings);
}

$self->Fatal("Can't get segment for $settings->{ref}:$settings->{start}..$settings->{stop}")
$self->Fatal("Can't get segment for $settings->{ref}:$settings->{start}..$settings->{stop} (2)")
unless $segment;

# generate the panels
Expand Down
17 changes: 13 additions & 4 deletions lib/Bio/Graphics/Browser/Render/Slave/Status.pm
@@ -1,5 +1,5 @@
package Bio::Graphics::Browser::Render::Slave::Status;
# $Id: Status.pm,v 1.2 2008-12-18 18:42:00 lstein Exp $
# $Id: Status.pm,v 1.3 2008-12-19 03:11:01 lstein Exp $

# This module keeps track of when slaves were last contacted and their
# current status. If a slave is down and there are alternatives defined,
Expand All @@ -8,9 +8,8 @@ package Bio::Graphics::Browser::Render::Slave::Status;

use strict;
use warnings;
use DB_File::Lock;
use Fcntl qw(:flock O_RDWR O_CREAT);

use DB_File;
use constant INITIAL_DELAY => 30; # initially recheck a down server after 30 sec
use constant MAX_DELAY => 600; # periodically recheck at 10 min intervals max
use constant DECAY => 1.5; # at each subsequent failure, increase recheck interval by this amount
Expand All @@ -19,13 +18,23 @@ use constant DEBUG => 0;
sub new {
my $class = shift;
my $path = shift;
return bless { path=>$path },ref $class || $class;
my $has_dbfilelock = eval "require DB_File::Lock; 1";

return bless {
path => $path,
canlock => $has_dbfilelock,
},ref $class || $class;
}

sub can_lock { shift->{dbfilelock} }

sub db {
my $self = shift;
my $write = shift;

return $self->{hash} ||= {}
unless $self->can_lock;

my $locking = $write ? 'write' : 'read';
my $mode = $write ? O_CREAT|O_RDWR : O_RDONLY;
my $perms = 0666;
Expand Down
2 changes: 1 addition & 1 deletion lib/Bio/Graphics/Browser/RenderPanels.pm
Expand Up @@ -579,8 +579,8 @@ sub run_remote_requests {
$response_line =~ s/^\d+//; # get rid of status code
$requests->{$_}->flag_error($response_line) foreach keys %{$renderers{$uri}};
}
CORE::exit(0); # from CHILD
}
CORE::exit(0); # from CHILD
}
}

Expand Down
3 changes: 2 additions & 1 deletion lib/Bio/Graphics/Karyotype.pm
@@ -1,6 +1,6 @@
package Bio::Graphics::Karyotype;

# $Id: Karyotype.pm,v 1.8 2008-11-14 18:55:00 lstein Exp $
# $Id: Karyotype.pm,v 1.9 2008-12-19 03:11:01 lstein Exp $
# Utility class to create a display of a karyotype and a series of "hits" on the individual chromosomes
# Used for searching

Expand Down Expand Up @@ -186,6 +186,7 @@ sub feature2link {
: $class ? "$class:$name"
: $name;
my $dbid = $_->gbrowse_dbid if $_ && $_->can('gbrowse_dbid');
$dbid ||= '';
return "$url$fid;dbid=$dbid";
}

Expand Down

0 comments on commit 15cb385

Please sign in to comment.