Bio::EnsEMBL::Funcgen
FeatureSet
Toolbar
Summary
Bio::EnsEMBL::FeatureSet - A module to represent FeatureSet.
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
use Bio::EnsEMBL::Funcgen::FeatureSet;
my $result_set = Bio::EnsEMBL::Funcgen::FeatureSet->new(
);
Description
A FeatureSet object provides access to a set of feature predictions and their details, which may have been generated from a
single or multiple Experiments with potentially differing analyses. The FeatureSet itself will only have a single analysis
which may be one or a combination of programs but will be represented by one analysis record.
Methods
Methods description
Example : print "Feature set description is:\t".$fset->description."\n"; Description: Getter/Setter for the description of this FeatureSet. e.g. Release 3.1 Returntype : String Exceptions : None Caller : General Status : At Risk |
Example : print $rset->display_label(); Description: Getter/Setter for the display_label attribute for this FeatureSet. This is more appropriate for the predicted_features of the set. Use the individual display_labels for each raw result set. Returntype : str Exceptions : None Caller : General Status : At Risk |
Example : Description: Retrieves and caches FeatureAdaptor of feature_set type Returntype : Bio::EnsEMBL::Funcgen::DBSQL::ucfirst($self->type())FeatureAdaptor Exceptions : None Caller : General Status : At Risk |
Arg[0] : Bio::EnsEMBL::Funcgen::FeatureType Example : my @features = @{$FeatureSet->get_Features_by_FeatureType($ftype)}; Description: Retrieves all Features for this FeatureSet for a given FeatureType Returntype : ARRAYRE Exceptions : None Caller : General Status : At Risk |
Example : my @features = @{$FeatureSet->get_Features_by_Slice($slice)}; Description: Retrieves all Features for this FeatureSet for a given Slice Returntype : ARRAYREF containing Features of the feature_set type i.e. Annotated, Regulatory or Supporting; Exceptions : None Caller : General Status : At Risk |
Arg [-EXPERIMENT_ID] : Experiment dbID #or #Arg [-EXPERIMENT] : Bio::EnsEMBL::Funcgen::Experiment Arg [-SLICE] : Bio::EnsEMBL::Slice
Example : my $feature = Bio::EnsEMBL::Funcgen::FeatureSet->new(
-dbid => $dbid,
-analysis => $analysis,
-feature_type => $ftype,
-cell_type => $ctype,
-name => $name,
-type => 'annotated',
-description => 'Release 3.1',
-display_label => 'Short name',
);
Description: Constructor for FeatureSet objects.
Returntype : Bio::EnsEMBL::Funcgen::FeatureSet
Exceptions : Throws if no experiment_id defined
Caller : General
Status : At risk |
Args : Hashref with all internal attributes set Example : none Description: Quick and dirty version of new. Only works if the code is very disciplined. Returntype : Bio::EnsEMBL::Funcgen::FeatureSet Exceptions : None Caller : General Status : At Risk |
Example : my $type = $fset->type('annotated'); Description: Getter/Setter for the type of this FeatureSet. Valid values are 'annotated', 'regulatory' or 'external'. Returntype : String Exceptions : None Caller : General Status : At Risk |
Methods code
sub description
{ my $self = shift;
$self->{'description'} = shift if @_;
return $self->{'description'}; } |
sub display_label
{ my $self = shift;
$self->{'display_label'} = shift if @_;
if(! $self->{'display_label'}){
if($self->feature_type->class() eq 'Regulatory Feature'){
$self->{'display_label'} = 'Regulatory Features';
}
else{
$self->{'display_label'} = $self->feature_type->name()." - ".$self->cell_type->name()." Enriched Sites";
}
}
return $self->{'display_label'}; } |
sub get_FeatureAdaptor
{ my $self = shift;
if(! exists $self->{'adaptor_refs'}){
$self->{'adaptor_refs'} = {(
annotated => $self->adaptor->db->get_AnnotatedFeatureAdaptor,
regulatory => $self->adaptor->db->get_RegulatoryFeatureAdaptor,
external => $self->adaptor->db->get_ExternalFeatureAdaptor,
)};
}
return $self->{'adaptor_refs'}->{$self->type()}; } |
sub get_Features_by_FeatureType
{ my ($self, $type) = @_;
return $self->get_FeatureAdaptor->fetch_all_by_FeatureType_FeatureSets($type, [$self]);
}
1; } |
sub get_Features_by_Slice
{ my ($self, $slice) = @_;
return $self->get_FeatureAdaptor->fetch_all_by_Slice_FeatureSets($slice, [$self]); } |
sub new
{ my $caller = shift;
my $class = ref($caller) || $caller;
my $self = $class->SUPER::new(@_);
my ($type, $desc)
= rearrange(['TYPE', 'DESCRIPTION'],@_);
throw ('Must provide a FeatureType') if(! defined $self->feature_type);
if(! ($type && grep /$type/, ('annotated', 'external', 'regulatory'))){
throw("You must define a valid FeatureSet type e.g. 'annotated', 'external' or 'regulatory'");
}
$self->type($type);
$self->description($desc) if defined $desc;
return $self; } |
sub new_fast
{ my ($class, $hashref) = @_;
return bless ($hashref, $class);
}
} |
sub type
{ my $self = shift;
$self->{'type'} = shift if @_;
return $self->{'type'}; } |
General documentation
This module was created by Nathan Johnson.
This module is part of the Ensembl project:
/