None available.
sub build_features
{ my ($self, $opts) = @_;
my $segment = $opts->{'segment'};
my $gStart = $opts->{'start'};
my $gEnd = $opts->{'end'};
my $dsn = $self->{'dsn'};
my $dbtable = $dsn;
my $qsegment = $self->transport->dbh->quote($segment);
my $qbounds = qq(AND start <= '$gEnd' AND end >= '$gStart') if($gStart && $gEnd);
my $query = qq(SELECT * FROM $dbtable WHERE seq_region = $qsegment $qbounds); my $ref = $self->transport->query($query);
my @features = ();
for my $row (@{$ref}) {
my ($start, $end, $score) = ($row->{'start'}, $row->{'end'}, $row->{'score'});
my $type;
if ($self->{'dsn'} =~ m/_profile/) { $type = 'default'; } elsif ($self->{'dsn'} =~ m/_reads/) { $type = $row->{'strand'} eq '+' ? 'forward' : 'reverse'; $row->{'strand'} = ''
} else {
$type = $score > 0? 'uniq' : 'non-uniq';
}
push @features, {
'id' => $row->{'feature_id'},
'label' => $row->{'name'} !~ m/^.$/ ? $row->{'name'} : $row->{'feature_id'}, 'method' => $self->config()->{'method'}, 'type' => $type, 'typecategory'=> $self->config()->{'category'}, 'start' => $row->{'start'}, 'end' => $row->{'end'}, 'ori' => $row->{'strand'}, 'score' => $row->{'score'}, #'note' => [], };
}
print "No. of features: ".scalar(@features)."\n";
return @features; } |
sub das_stylesheet
{
my $self = shift;
if ($self->{'dsn'} =~ m/_profile/) { return <<EOT; <!DOCTYPE DASSTYLE SYSTEM "http://www.biodas.org/dtd/dasstyle.dtd">
<DASSTYLE>
<STYLESHEET version="1.0">
<CATEGORY id="sequencing">
<TYPE id="default">
<GLYPH>
<TILING>
<HEIGHT>30</HEIGHT> <COLOR1>brown4</COLOR1>
<MIN>0</MIN> <MAX>15</MAX>
</TILING> </GLYPH>
</TYPE> </CATEGORY>
</STYLESHEET> </DASSTYLE>
EOT
} else {
return <<EOT; <!DOCTYPE DASSTYLE SYSTEM "http://www.biodas.org/dtd/dasstyle.dtd"> <DASSTYLE> <STYLESHEET version="1.0"> <CATEGORY id="sequencing"> <TYPE id="forward"> <GLYPH> <ARROW> <HEIGHT>10</HEIGHT> <FGCOLOR>black</FGCOLOR> <BUMP>1</BUMP> <BAR_STYLE>full</BAR_STYLE> <SOUTHWEST>no</SOUTHWEST> </ARROW> </GLYPH> </TYPE> <TYPE id="reverse"> <GLYPH> <ARROW> <HEIGHT>10</HEIGHT> <FGCOLOR>darkgreen</FGCOLOR> <BUMP>1</BUMP> <BAR_STYLE>full</BAR_STYLE> <NORTHEAST>no</NORTHEAST> </ARROW> </GLYPH> </TYPE> </CATEGORY> </STYLESHEET> </DASSTYLE> EOT }
}
1; } |
sub init
{ my $self = shift;
$self->{'capabilities'} = {
'features' => '1.0',
'stylesheet' => '1.0',
};
$self->{'dsnversion'} = '1.1';
} |