Bio::Das::ProServer::SourceAdaptor efg_feature_set
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
efg_feature_set.pm
Package variables
No package variables defined.
Included modules
Data::Dumper
IO::File
Inherit
Bio::Das::ProServer::SourceAdaptor
Synopsis
Proserver module to run DAS server off the efg FeatureSet table
Description
Methods
build_features
No description
Code
das_stylesheet
No description
Code
init
No description
Code
title
No description
Code
Methods description
None available.
Methods code
build_featuresdescriptionprevnextTop
sub build_features {
    my ( $self, $args ) = @_;
    print Dumper $args if ($self->{'debug'});
    
    my $segment = $args->{'segment'} || return ();
    my $start = $args->{'start'} || return ();
    my $end   = $args->{'end'} || return ();


    my $type = $self->config()->{'feature_set_type'};
    my $feature_set_id = $self->config()->{'feature_set_id'};
    print Dumper $feature_set_id if ($self->{'debug'});

    # get data
my $qbounds = ($start && $end)?qq(AND seq_region_start <= $end AND seq_region_end >= $start):""; my $version = $self->config()->{'data_version'}; print Dumper $version if ($self->{'debug'}); my $sql = "SELECT * FROM ${type}_feature f, seq_region sr WHERE sr.seq_region_id=f.seq_region_id AND sr.name=\"$segment\" AND sr.schema_build=\"$version\" AND f.feature_set_id=$feature_set_id $qbounds"; print Dumper $sql if ($self->{'debug'}); my $features = $self->transport->query($sql); print Dumper $features if ($self->{'debug'}); #print "Number of features: ", scalar(@{$features}), "\n";
my @features; foreach my $ft (@{$features}) { my $id = sprintf( "%s:%s,%s", $segment, $ft->{'seq_region_start'}, $ft->{'seq_region_end'} ); my $note = $ft->{'display_label'}; push @features, { 'id' => $id, 'label' => $id, 'start' => $ft->{'seq_region_start'}, 'end' => $ft->{'seq_region_end'}, 'ori' => $ft->{'seq_region_strand'}, 'score' => $ft->{'score'}, # #'method' => $self->config()->{'source'},
'type' => $type, # #'typecategory'=> $self->config()->{'category'},
'note' => $note, # 'link' => 'http://www.sanger.ac.uk/PostGenomics/epigenome/',
# 'linktxt' => 'Human Epigenome Project (HEP)'
}; } print 'NoF: '.scalar(@features)."\n"; return @features;
}
das_stylesheetdescriptionprevnextTop
sub das_stylesheet {
    my $self = shift;

    print Dumper $self->{'dsn'};

    if ($self->{'dsn'} =~ m/_BR/) {
return <<EOT;
<!DOCTYPE DASSTYLE SYSTEM "http://www.biodas.org/dtd/dasstyle.dtd"> <DASSTYLE> <STYLESHEET version="0.01"> <CATEGORY id="default"> <TYPE id="default"> <GLYPH> <BOX> <FGCOLOR>black</FGCOLOR>
<BGCOLOR>brown3</
BGCOLOR> <HEIGHT>5</HEIGHT>
</
BOX> </GLYPH>
</
TYPE> </CATEGORY>
</
STYLESHEET> </DASSTYLE>
EOT

} else {

return <<EOT;
<!DOCTYPE DASSTYLE SYSTEM "http://www.biodas.org/dtd/dasstyle.dtd"> <DASSTYLE> <STYLESHEET version="0.01"> <CATEGORY id="default"> <TYPE id="default"> <GLYPH> <BOX> <FGCOLOR>red</FGCOLOR>
<BGCOLOR>black</
BGCOLOR> </BOX>
</
GLYPH> </TYPE>
<TYPE id="annotated">
<GLYPH>
<BOX>
<FGCOLOR>black</
FGCOLOR> <BGCOLOR>brown4</BGCOLOR>
<HEIGHT>5</
HEIGHT> </BOX>
</
GLYPH> </TYPE>
<TYPE id="DNA methylation">
<GLYPH>
<BOX>
<FGCOLOR>blue</
FGCOLOR> <BGCOLOR>black</BGCOLOR>
</
BOX> </GLYPH>
</
TYPE> </CATEGORY>
</
STYLESHEET> </DASSTYLE>
EOT
}
}

1;
}
initdescriptionprevnextTop
sub init {
    my ($self) = @_;

    $self->{'capabilities'} = {
        'features' => '1.0',
        'stylesheet' => '1.0'
        };
}
titledescriptionprevnextTop
sub title {
    my $self = shift;
    my ($title) = $self->dsn;

    $title =~ s/\./_/;

    return "$title";
}
General documentation
LICENCETop
This code is distributed under an Apache style licence. Please see
/info/about/code_licence.html for details.
AUTHORTop
Stefan Graf <graef@ebi.ac.uk>, Ensembl Functional Genomics
CONTACTTop
Please post comments/questions to the Ensembl development list
<ensembl-dev@ebi.ac.uk>