Skip to content
Snippets Groups Projects
Commit 0f9ae074 authored by Web Admin's avatar Web Admin
Browse files

addeded feature strand attribute on SliceAdaptor

parent 1575a404
No related branches found
No related tags found
No related merge requests found
......@@ -41,8 +41,8 @@ use Bio::EnsEMBL::Utils::Cache;
@ISA = qw(Bio::EnsEMBL::DBSQL::BaseAdaptor);
our $SEQ_CHUNK_PWR = 18; # 2^18 = approx. 250KB
our $SEQ_CACHE_SZ = 5;
our $SEQ_CHUNK_PWR = 22; # 2^18 = approx. 250KB
our $SEQ_CACHE_SZ = 10;
our $SEQ_CACHE_MAX = (2 ** $SEQ_CHUNK_PWR) * $SEQ_CACHE_SZ;
......
......@@ -925,7 +925,7 @@ sub fetch_by_Feature{
$size = int( ($1-100)/200 * ($fend-$fstart+1) ) if( $size =~/([\d+\.]+)%/ );
#return a new slice covering the region of the feature
return Bio::EnsEMBL::Slice->new
my $S = Bio::EnsEMBL::Slice->new
(-seq_region_name => $slice->seq_region_name,
-seq_region_length => $slice->seq_region_length,
-coord_system => $slice->coord_system,
......@@ -933,6 +933,8 @@ sub fetch_by_Feature{
-end => $fend + $size,
-strand => 1,
-adaptor => $self);
$S->{'_raw_feature_strand'} = $feature->strand * $slice_strand if $feature->can('strand');
return $S;
}
......
......@@ -240,10 +240,16 @@ sub get_all_attribute_values {
my @results = map { uc( $_->code() ) eq uc( $code ) ? $_->value : () } @{$self->{'attributes'}};
return \@results;
}
sub get_scalar_attribute {
my $self = shift;
my $code = shift;
my @results = grep { uc( $_->code() ) eq uc( $code )} @{$self->{'attributes'}};
my @results;
if( $code eq 'name' ) {
@results = grep { uc( $_->code() ) eq 'NAME' || uc( $_->code() ) eq 'NON_REF' } @{$self->{'attributes'}};
} else {
@results = grep { uc( $_->code() ) eq uc( $code )} @{$self->{'attributes'}};
}
return @results ? $results[0]->value() : '';
}
......@@ -263,6 +269,7 @@ sub get_scalar_attribute {
sub display_id {
my $self = shift;
my ($attrib) = @{$self->get_all_Attributes('name')};
($attrib) = @{$self->get_all_Attributes('non_ref')} if(!$attrib);
($attrib) = @{$self->get_all_Attributes('synonym')} if(!$attrib);
if( defined $attrib ) {
return $attrib->value();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment