Bio::EnsEMBL::Funcgen
RegulatoryFeature
Toolbar
Summary
Bio::EnsEMBL::RegulatoryFeature - A module to represent a regulatory feature
mapping as generated by the eFG regulatory build pipeline.
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
use Bio::EnsEMBL::Funcgen::RegulatoryFeature;
my $feature = Bio::EnsEMBL::Funcgen::RegulatoryFeature->new(
-SLICE => $chr_1_slice,
-START => 1_000_000,
-END => 1_000_024,
-STRAND => -1,
-DISPLAY_LABEL => $text,
-FEATURE_SET => $fset,
-FEATURE_TYPE => $reg_feat_type,
);
Description
A RegulatoryFeature object represents the genomic placement of a combined regulatory
feature generated by the eFG analysis pipeline, which may have originated from one or
many separate annotated or supporting features.
Methods
Methods description
Arg [1] : (optional) hash of attribute table keys with dbID list vakues for regulatory attributes Example : $feature->_attribute_cache(%attribute_table_ids); Description: Setter for the regulatory_attributes dbIDs for this feature. This is a short cut method used by the regulatory build and the webcode to avoid having to query the DB for the underlying attribute features Returntype : Hasref of table keys and hash values with dbID keys Exceptions : None?? check for enum'd types? Caller : RegulatoryFeatureAdaptor.pm and build_regulatory_features.pl Status : At Risk |
Example : $self->_generate_underlying_structure() if(! exists $self->{'bound_end'}); Description: Getter for the bound_end attribute for this feature. Gives the 3' most end value of the underlying attribute features. Returntype : string Exceptions : None Caller : General Status : At Risk |
Example : my $bound_end = $feature->bound_start(); Description: Getter for the bound_end attribute for this feature. Gives the 3' most end value of the underlying attribute features. Returntype : string Exceptions : None Caller : General Status : At Risk |
Example : my $bound_start = $feature->bound_start(); Description: Getter for the bound_start attribute for this feature. Gives the 5' most start value of the underlying attribute features. Returntype : string Exceptions : None Caller : General Status : At Risk |
Arg [1] : string - display label Example : my $label = $feature->display_label(); Description: Getter and setter for the display label of this feature. Returntype : String Exceptions : None Caller : General Status : Medium Risk |
Arg [-SCORE]: (optional) int - Score assigned by analysis pipeline Arg [-ANALYSIS] : Bio::EnsEMBL::Analysis Arg [-SLICE] : Bio::EnsEMBL::Slice - The slice on which this feature is. Arg [-START] : int - The start coordinate of this feature relative to the start of the slice it is sitting on. Coordinates start at 1 and are inclusive. Arg [-END] : int -The end coordinate of this feature relative to the start of the slice it is sitting on. Coordinates start at 1 and are inclusive. Arg [-DISPLAY_LABEL]: string - Display label for this feature Arg [-STRAND] : int - The orientation of this feature. Valid values are 1, -1 and 0. Arg [-FEATURE_SET] : Bio::EnsEMBL::Funcgen::FeatureSet - Regulatory Feature set Arg [-FEATURE_TYPE] : Bio::EnsEMBL::Funcgen::FeatureType - Regulatory Feature sub type Arg [-ATTRIBUTES] : ARRAYREF of attribute features e.g. Annotated or ? Features Arg [-dbID] : (optional) int - Internal database ID. Arg [-ADAPTOR] : (optional) Bio::EnsEMBL::DBSQL::BaseAdaptor - Database adaptor. Example : my $feature = Bio::EnsEMBL::Funcgen::RegulatoryFeature->new( -SLICE => $chr_1_slice, -START => 1_000_000, -END => 1_000_024, -STRAND => -1, -DISPLAY_LABEL => $text, -FEATURE_SET => $fset, -FEATURE_TYPE => $reg_ftype, -REGULATORY_ATTRIBUTES => \@features, -_ATTRIBUTE_CACHE => \%attr_cache, );
Description: Constructor for RegulatoryFeature objects.
Returntype : Bio::EnsEMBL::Funcgen::RegulatoryFeature
Exceptions : None
Caller : General
Status : At Risk |
Arg [1] : (optional) list of constituent features Example : print "Regulatory Attributes:\n\t".join("\n\t", @{$feature->regulatory_attributes()})."\n"; Description: Getter and setter for the regulatory_attributes for this feature. Returntype : ARRAYREF Exceptions : None Caller : General Status : At Risk |
Arg [1] : (optional) string - stable_id e.g ENSR00000000001 Example : my $stable_id = $feature->stable_id(); Description: Getter and setter for the stable_id attribute for this feature. Returntype : string Exceptions : None Caller : General Status : At Risk |
Methods code
sub _attribute_cache
{ my ($self, $attr_table_ids) = @_;
foreach my $table(keys %{$attr_table_ids}){
foreach my $dbID(keys %{$attr_table_ids->{$table}}){
if(exists $self->{'regulatory_attributes'}{$table}{$dbID}){
warn "You are trying to overwrite a pre-existing regulatory atribute cache entry for $table dbID $dbID\n";
}
else{
$self->{'regulatory_attributes'}{$table}{$dbID} = undef;
}
}
}
return $self->{'regulatory_attributes'}; } |
sub _generate_underlying_structure
{ my $self = shift;
my @attrs = @{$self->regulatory_attributes()};
if(! @attrs){
warn "No underlying regulatory_attribute features to generate comples structure from";
$self->{'bound_end'} = undef;
$self->{'bound_end'} = undef;
}
else{
my (@start_ends);
map {push @start_ends, ($_->start, $_->end)} @attrs;
@start_ends = sort { $a <=> $b } @start_ends;
$self->{'bound_end'} = pop @start_ends;
$self->{'bound_start'} = shift @start_ends;
}
return;
}
1; } |
sub bound_end
{ my $self = shift;
$self->_generate_underlying_structure() if(! defined $self->{'bound_end'});
return $self->{'bound_end'}; } |
sub bound_start
{ my $self = shift;
$self->_generate_underlying_structure() if(! defined $self->{'bound_start'});
return $self->{'bound_start'}; } |
sub display_label
{ my $self = shift;
$self->{'display_label'} = shift if @_;
my $tmp = $self->feature_type->name()." Regulatory Feature";
$tmp .= " - ".$self->cell_type->name() if defined $self->cell_type(); return $tmp; } |
sub new
{ my $caller = shift;
my $class = ref($caller) || $caller;
my $self = $class->SUPER::new(@_);
my ($stable_id, $reg_attrs, $attr_cache)
= rearrange(['STABLE_ID', 'REGULATORY_ATTRIBUTES', '_ATTRIBUTE_CACHE'], @_);
$self->stable_id($stable_id) if $stable_id;
$self->regulatory_attributes($reg_attrs) if $reg_attrs;
$self->_attribute_cache($attr_cache) if $attr_cache;
return $self; } |
sub regulatory_attributes
{ my ($self, $attrs) = @_;
my $table;
my %adaptors = (
'annotated_feature' => $self->adaptor->db->get_AnnotatedFeatureAdaptor(),
);
if(defined $attrs){
my @attrs = @$attrs;
foreach my $attr(@attrs){
$table = $attr->adaptor->_main_table->[0];
$self->{'regulatory_attributes'}{$table}{$attr->dbID()} = $attr;
}
}
else{
foreach my $table(keys %{$self->{'regulatory_attributes'}}){
foreach my $dbID(keys %{$self->{'regulatory_attributes'}{$table}}){
if(! defined $self->{'regulatory_attributes'}{$table}{$dbID}){
$self->{'regulatory_attributes'}{$table}{$dbID} = $adaptors{$table}->fetch_by_dbID($dbID);
}
}
}
}
return [ map values %{$self->{'regulatory_attributes'}{$_}}, keys %{$self->{'regulatory_attributes'}} ]; } |
sub stable_id
{ my $self = shift;
$self->{'stable_id'} = shift if @_;
return (defined $self->{'stable_id'}) ? sprintf("ENSR%011d", $self->{'stable_id'}) : undef; } |
General documentation
This module was created by Nathan Johnson.
This module is part of the Ensembl project:
/