Bio::EnsEMBL::Funcgen
SetFeature
Toolbar
Summary
Bio::EnsEMBL::Funcgen::SetFeature - Ensembl specific set feature.
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
my $feat = new Bio::EnsEMBL::Feature(-start => 100,
-end => 220,
-strand => -1,
-slice => $slice,
-feature_set => $fset,
-display_label => $label,
);
my $start = $feat->start;
my $end = $feat->end;
my $strand = $feat->strand;
#move the feature to the chromosomal coordinate system
$feature = $feature->transform('chromosome');
#move the feature to a different slice (possibly on another coord system)
$feature = $feature->transfer($new_slice);
#project the feature onto another coordinate system possibly across
#boundaries:
@projection = @{$feature->project('contig')};
#change the start, end, and strand of the feature in place
$feature->move($new_start, $new_end, $new_strand);
Description
This is a simple wrapper method for the core Feature class to contain common generic
Funcgen SetFeature methods.
Methods
Methods description
Example : my $analysis = $efeature->feature_type()->name(); Description: Getter for the type attribute for this feature. Returntype : Bio:EnsEMBL::Funcgen::FeatureType Exceptions : Throws if analysis passed is not a valid Bio::EnsEMBL::Analysis Caller : General Status : At risk |
Example : my @associated_ftypes = @{$feature->associated_feature_types()}; Description: Getter/Setter for other associated FeatureTypes. Returntype : ARRAYREF of Bio::EnsEMBL::Funcgen:FeatureType objects Exceptions : None Caller : General Status : At risk |
Example : my $cell_name = $efeature->cell_type()->name(); Description: Getter for the cell_type attribute for this feature. May not always be set for ExternalFeatures. Returntype : Bio::EnsEMBL::Funcgen:CellType Exceptions : None Caller : General Status : At risk |
Arg [1] : (optional) Bio::EnsEMBL::FeatureSet Example : $efeature->feature_set($fset); Description: Getter for the FeatureSet attribute for this feature. Returntype : Bio::EnsEMBL::Funcgen::FeatureSet Exceptions : None Caller : General Status : At Risk |
Example : my $ft_name = $efeature->feature_type()->name(); Description: Getter for the feature_type attribute for this feature. Returntype : Bio::EnsEMBL::Funcgen:FeatureType Exceptions : None Caller : General Status : At risk |
Arg [-FEATURE_SET] : Bio::EnsEMBL::Funcgen::FeatureSet 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 [-dbID] : (optional) int - Internal database ID. Arg [-ADAPTOR] : (optional) Bio::EnsEMBL::DBSQL::BaseAdaptor - Database adaptor. Example : my $feature = Bio::EnsEMBL::Funcgen::AnnotatedFeature->new( -SLICE => $chr_1_slice, -START => 1_000_000, -END => 1_000_024, http://www.hinxton.wellcome.ac.uk/onsite/menus/index.html -STRAND => -1, -DISPLAY_LABEL => $text, -FEATURE_SET => $fset, );
Description: Constructor for SetFeature objects. Should never be called directly, only by children.
Returntype : Bio::EnsEMBL::Funcgen::SetFeature
Exceptions : None
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 calling code is very disciplined. Returntype : Bio::EnsEMBL::Funcgen::SetFeature Exceptions : None Caller : General Status : At Risk |
Methods code
sub analysis
{ my $self = shift;
if(@_){
if($_[0]->isa("Bio::EnsEMBL::Analysis")){
$self->{'analysis'} = $_[0];
}else{
throw("Must pass a valid Bio::EnsEMBL::Analysis");
}
}
return (defined $self->{'analysis'}) ? $self->{'analysis'} : $self->feature_set->analysis();
}
1; } |
sub associated_feature_types
{ my ($self, $ftypes) = @_;
if(defined $ftypes){
if(ref($ftypes) eq 'ARRAY'){
foreach my $ftype(@$ftypes){
if( ! $ftype->isa('Bio::EnsEMBL::Funcgen::FeatureType') ){
throw('You must pass and ARRAYREF of stored Bio::EnsEMBL::Funcgen::FeatureType objects');
}
}
if(defined $self->{'associated_feature_types'}){
warn('You are overwriting associated feature types');
}
$self->{'associated_feature_types'} = $ftypes;
}
else{
throw('You must pass and ARRAYREF of stored Bio::EnsEMBL::Funcgen::FeatureType objects');
}
}
if(! defined $self->{'associated_feature_types'}){
if(defined $self->adaptor){
$self->{'associated_feature_types'} = $self->adaptor->db->get_FeatureTypeAdaptor->fetch_all_by_associated_SetFeature($self);
}
}
return $self->{'associated_feature_types'};
}
} |
sub cell_type
{ my $self = shift;
return $self->feature_set->cell_type(); } |
sub feature_set
{ my $self = shift;
return $self->{'feature_set'}; } |
sub feature_type
{ my $self = shift;
return (defined $self->{'feature_type'}) ? $self->{'feature_type'} : $self->feature_set->feature_type(); } |
sub new
{ my $caller = shift;
my $class = ref($caller) || $caller;
my $self = $class->SUPER::new(@_);
my ($display_label, $fset, $ftype, $assoc_ftypes)
= rearrange(['DISPLAY_LABEL', 'FEATURE_SET', 'FEATURE_TYPE', 'ASSOCIATED_FEATURE_TYPES'], @_);
if($ftype){
if(! (ref($ftype) && $ftype->isa('Bio::EnsEMBL::Funcgen::FeatureType'))){
throw('feature_type param must be a valid Bio::EnsEMBL::Funcgen::FeatureType');
}
$self->{'feature_type'} = $ftype;
}
if(! (ref($fset) && $fset->isa("Bio::EnsEMBL::Funcgen::FeatureSet"))){
throw("Must pass valid Bio::EnsEMBL::Funcgen::FeatureSet object");
}
$self->{'feature_set'}= $fset;
$self->display_label($display_label) if $display_label;
$self->associated_feature_types($assoc_ftypes) if(defined $assoc_ftypes);
return $self; } |
sub new_fast
{ return bless ($_[1], $_[0]); } |
General documentation