Commit 2134f037 authored by Alessandro Vullo's avatar Alessandro Vullo
Browse files

Removed some Slice overridden get_all_(Feature) methods since features/slices...

Removed some Slice overridden get_all_(Feature) methods since features/slices spanning the origin of replication are handled the corresponding feature adaptor
parent 448cea7c
......@@ -799,203 +799,6 @@ sub expand {
=head2 get_all_PredictionTranscripts
Arg [1] : (optional) string $logic_name
The name of the analysis used to generate the prediction
transcripts obtained.
Arg [2] : (optional) boolean $load_exons
If set to true will force loading of all PredictionExons
immediately rather than loading them on demand later. This
is faster if there are a large number of PredictionTranscripts
and the exons will be used.
Example : @transcripts = @{$slice->get_all_PredictionTranscripts};
Description: Retrieves the list of prediction transcripts which overlap
this slice with logic_name $logic_name. If logic_name is
not defined then all prediction transcripts are retrieved.
Returntype : listref of Bio::EnsEMBL::PredictionTranscript
Exceptions : warning if slice does not have attached adaptor
Caller : none
Status : Stable
=cut
sub get_all_PredictionTranscripts {
my ( $self, $logic_name, $load_exons ) = @_;
if ( !$self->adaptor() ) {
warning(
'Cannot get PredictionTranscripts without attached adaptor');
return [];
}
my $pta = $self->adaptor()->db()->get_PredictionTranscriptAdaptor();
## circular BOF
my ($sl1, $sl2) = $self->_split;
my ( @arr, @arr1, @arr2 );
@arr1 =
@{ $pta->fetch_all_by_Slice( $sl1, $logic_name, $load_exons ) };
@arr2 =
@{ $pta->fetch_all_by_Slice( $sl2, $logic_name, $load_exons ) };
push @arr, @arr1, @arr2;
return \@arr;
## circular EOF
#return $pta->fetch_all_by_Slice($sl1, $logic_name, $load_exons);
} ## end sub get_all_PredictionTranscripts
=head2 get_all_DnaAlignFeatures
Arg [1] : (optional) string $logic_name
The name of the analysis performed on the dna align features
to obtain.
Arg [2] : (optional) float $score
The mimimum score of the features to retrieve
Arg [3] : (optional) string $dbtype
The name of an attached database to retrieve the features from
instead, e.g. 'otherfeatures'.
Arg [4] : (optional) float hcoverage
The minimum hcoverage od the featurs to retrieve
Example : @dna_dna_align_feats = @{$slice->get_all_DnaAlignFeatures};
Description: Retrieves the DnaDnaAlignFeatures which overlap this slice with
logic name $logic_name and with score above $score. If
$logic_name is not defined features of all logic names are
retrieved. If $score is not defined features of all scores are
retrieved.
Returntype : listref of Bio::EnsEMBL::DnaDnaAlignFeatures
Exceptions : warning if slice does not have attached adaptor
Caller : general
Status : Stable
=cut
sub get_all_DnaAlignFeatures {
my ( $self, $logic_name, $score, $dbtype, $hcoverage ) = @_;
if ( !$self->adaptor() ) {
warning('Cannot get DnaAlignFeatures without attached adaptor');
return [];
}
my $db;
if ($dbtype) {
$db = $self->adaptor->db->get_db_adaptor($dbtype);
if ( !$db ) {
warning("Don't have db $dbtype returning empty list\n");
return [];
}
} else {
$db = $self->adaptor->db;
}
my $dafa = $db->get_DnaAlignFeatureAdaptor();
if ( defined($score) and defined($hcoverage) ) {
warning "cannot specify score and hcoverage. Using score only";
}
## circular BOF
my ($sl1, $sl2) = $self->_split;
my ( @arr, @arr1, @arr2 );
my %union;
if ( defined($score) ) {
@arr1 = @{ $dafa->fetch_all_by_Slice_and_score( $sl1, $score,
$logic_name ) };
@arr2 = @{ $dafa->fetch_all_by_Slice_and_score( $sl2, $score,
$logic_name ) };
push @arr, @arr1, @arr2;
return \@arr;
}
@arr1 = @{
$dafa->fetch_all_by_Slice_and_hcoverage( $sl1, $hcoverage,
$logic_name ) };
@arr2 = @{
$dafa->fetch_all_by_Slice_and_hcoverage( $sl2, $hcoverage,
$logic_name ) };
push @arr, @arr1, @arr2;
return \@arr;
## circular EOF
} ## end sub get_all_DnaAlignFeatures
=head2 get_all_ProteinAlignFeatures
Arg [1] : (optional) string $logic_name
The name of the analysis performed on the protein align features
to obtain.
Arg [2] : (optional) float $score
The mimimum score of the features to retrieve
Arg [3] : (optional) string $dbtype
The name of an attached database to retrieve features from
instead.
Arg [4] : (optional) float hcoverage
The minimum hcoverage od the featurs to retrieve
Example : @dna_pep_align_feats = @{$slice->get_all_ProteinAlignFeatures};
Description: Retrieves the DnaPepAlignFeatures which overlap this slice with
logic name $logic_name and with score above $score. If
$logic_name is not defined features of all logic names are
retrieved. If $score is not defined features of all scores are
retrieved.
Returntype : listref of Bio::EnsEMBL::DnaPepAlignFeatures
Exceptions : warning if slice does not have attached adaptor
Caller : general
Status : Stable
=cut
sub get_all_ProteinAlignFeatures {
my ( $self, $logic_name, $score, $dbtype, $hcoverage ) = @_;
if ( !$self->adaptor() ) {
warning('Cannot get ProteinAlignFeatures without attached adaptor');
return [];
}
my $db;
if ($dbtype) {
$db = $self->adaptor->db->get_db_adaptor($dbtype);
if ( !$db ) {
warning("Don't have db $dbtype returning empty list\n");
return [];
}
} else {
$db = $self->adaptor->db;
}
my $pafa = $db->get_ProteinAlignFeatureAdaptor();
if ( defined($score) and defined($hcoverage) ) {
warning "cannot specify score and hcoverage. Using score only";
}
my ($sl1, $sl2) = $self->_split;
my ( @arr, @arr1, @arr2 );
if ( defined($score) ) {
@arr1 = @{ $pafa->fetch_all_by_Slice_and_score( $sl1, $score,
$logic_name ) };
@arr2 = @{ $pafa->fetch_all_by_Slice_and_score( $sl2, $score,
$logic_name ) };
push @arr, @arr1, @arr2;
return \@arr;
}
@arr1 = @{
$pafa->fetch_all_by_Slice_and_hcoverage( $sl1, $hcoverage,
$logic_name ) };
@arr2 = @{
$pafa->fetch_all_by_Slice_and_hcoverage( $sl2, $hcoverage,
$logic_name ) };
push @arr, @arr1, @arr2;
return \@arr;
} ## end sub get_all_ProteinAlignFeatures
#### STOP !!! ########################################
=head2 get_all_VariationFeatures
Args : $filter [optional]
......@@ -1149,109 +952,6 @@ sub get_all_KaryotypeBands {
=head2 get_all_AssemblyExceptionFeatures
Arg [1] : string $set (optional)
Example : $slice->get_all_AssemblyExceptionFeatures();
Description: Retreives all misc features which overlap this slice. If
a set code is provided only features which are members of
the requested set are returned.
Returntype : listref of Bio::EnsEMBL::AssemblyExceptionFeatures
Exceptions : none
Caller : general
Status : Stable
=cut
sub get_all_AssemblyExceptionFeatures {
my $self = shift;
my $misc_set = shift;
my $adaptor = $self->adaptor();
if ( !$adaptor ) {
warning('Cannot retrieve features without attached adaptor.');
return [];
}
my $aefa = $adaptor->db->get_AssemblyExceptionFeatureAdaptor();
## circular BOF
my ($sl1, $sl2) = $self->_split;
my ( @arr, @arr1, @arr2 );
@arr1 = @{ $aefa->fetch_all_by_Slice($sl1) };
@arr2 = @{ $aefa->fetch_all_by_Slice($sl2) };
push @arr, @arr1, @arr2;
return \@arr;
## circular EOF
} ## end sub get_all_AssemblyExceptionFeatures
=head2 get_all_MiscFeatures
Arg [1] : string $set (optional)
Arg [2] : string $database (optional)
Example : $slice->get_all_MiscFeatures('cloneset');
Description: Retreives all misc features which overlap this slice. If
a set code is provided only features which are members of
the requested set are returned.
Returntype : listref of Bio::EnsEMBL::MiscFeatures
Exceptions : none
Caller : general
Status : Stable
=cut
sub get_all_MiscFeatures {
my $self = shift;
my $misc_set = shift;
my $dbtype = shift;
my $msa;
my $adaptor = $self->adaptor();
if ( !$adaptor ) {
warning('Cannot retrieve features without attached adaptor.');
return [];
}
my $mfa;
if ($dbtype) {
my $db = $reg->get_db( $adaptor->db(), $dbtype );
if ( defined($db) ) {
$mfa = $reg->get_adaptor( lc( $db->species() ),
$db->group(), "miscfeature" );
} else {
$mfa = $reg->get_adaptor( $adaptor->db()->species(),
$dbtype, "miscfeature" );
}
if ( !defined $mfa ) {
warning("$dbtype misc features not available");
return [];
}
} else {
$mfa = $adaptor->db->get_MiscFeatureAdaptor();
}
## circular BOF
my ($sl1, $sl2) = $self->_split;
my ( @arr, @arr1, @arr2 );
if ($misc_set) {
@arr1 =
@{ $mfa->fetch_all_by_Slice_and_set_code( $sl1, $misc_set ) };
@arr2 =
@{ $mfa->fetch_all_by_Slice_and_set_code( $sl2, $misc_set ) };
push @arr, @arr1, @arr2;
return \@arr;
}
@arr1 = @{ $mfa->fetch_all_by_Slice($sl1) };
@arr2 = @{ $mfa->fetch_all_by_Slice($sl2) };
push @arr, @arr1, @arr2;
return \@arr;
## circular EOF
} ## end sub get_all_MiscFeatures
=head2 get_all_AffyFeatures
Args : (optional) list of strings - array names
......@@ -1370,48 +1070,6 @@ sub get_all_OligoFeatures_by_type {
} ## end sub get_all_OligoFeatures_by_type
=head2 get_all_MarkerFeatures
Arg [1] : (optional) string logic_name
The logic name of the marker features to retrieve
Arg [2] : (optional) int $priority
Lower (exclusive) priority bound of the markers to retrieve
Arg [3] : (optional) int $map_weight
Upper (exclusive) priority bound of the markers to retrieve
Example : my @markers = @{$slice->get_all_MarkerFeatures(undef,50, 2)};
Description: Retrieves all markers which lie on this slice fulfilling the
specified map_weight and priority parameters (if supplied).
Returntype : reference to a list of Bio::EnsEMBL::MarkerFeatures
Exceptions : none
Caller : contigview, general
Status : Stable
=cut
sub get_all_MarkerFeatures {
my ( $self, $logic_name, $priority, $map_weight ) = @_;
if ( !$self->adaptor() ) {
warning('Cannot retrieve MarkerFeatures without attached adaptor.');
return [];
}
my $ma = $self->adaptor->db->get_MarkerFeatureAdaptor;
## circular BOF
my ($sl1, $sl2) = $self->_split;
my ( @arr, @arr1, @arr2 );
@arr1 = @{
$ma->fetch_all_by_Slice_and_priority( $sl1, $priority, $map_weight,
$logic_name ) };
@arr2 = @{
$ma->fetch_all_by_Slice_and_priority( $sl2, $priority, $map_weight,
$logic_name ) };
push @arr, @arr1, @arr2;
return \@arr;
## circular EOF
} ## end sub get_all_MarkerFeatures
=head2 get_all_compara_DnaAlignFeatures
......@@ -1682,42 +1340,6 @@ sub get_all_ExternalFeatures {
} ## end sub get_all_ExternalFeatures
=head2 get_all_DitagFeatures
Arg [1] : (optional) string ditag type
Arg [1] : (optional) string logic_name
Example : @dna_dna_align_feats = @{$slice->get_all_DitagFeatures};
Description: Retrieves the DitagFeatures of a specific type which overlap
this slice with. If type is not defined, all features are
retrieved.
Returntype : listref of Bio::EnsEMBL::DitagFeatures
Exceptions : warning if slice does not have attached adaptor
Caller : general
Status : Stable
=cut
sub get_all_DitagFeatures {
my ( $self, $type, $logic_name ) = @_;
if ( !$self->adaptor() ) {
warning('Cannot get DitagFeatures without attached adaptor');
return [];
}
my $dfa = $self->adaptor->db->get_DitagFeatureAdaptor();
## circular BOF
my ($sl1, $sl2) = $self->_split;
my ( @arr, @arr1, @arr2 );
@arr1 = @{ $dfa->fetch_all_by_Slice( $sl1, $type, $logic_name ) };
@arr2 = @{ $dfa->fetch_all_by_Slice( $sl2, $type, $logic_name ) };
push @arr, @arr1, @arr2;
return \@arr;
## circular EOF
} ## end sub get_all_DitagFeatures
# GENERIC FEATURES (See DBAdaptor.pm)
=head2 get_generic_features
......
Markdown is supported
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