Skip to content
Snippets Groups Projects
Commit 5e72be77 authored by Will Spooner's avatar Will Spooner
Browse files

Added the fetch_all_by_hit_name method

parent 340ce7ed
No related branches found
No related tags found
No related merge requests found
......@@ -81,6 +81,41 @@ sub fetch_all_by_Slice_and_pid {
}
=head2 fetch_all_by_hit_name
Arg [1] : string $hit_name
the hit_name of the features to obtain
Arg [3] : (optional) string $logic_name
the analysis logic name of the type of features to obtain
Example : @feats = $adaptor->fetch_all_by_hit_name($name, $logic_name);
Description: Returns a listref of features created from the database
which correspond to the given hit_name. If logic name
is defined, only features with an analysis of type
$logic_name will be returned.
Returntype : listref of Bio::EnsEMBL::BaseAlignFeatures
Exceptions : thrown if hit_name is not defined
Caller : general
=cut
sub fetch_all_by_hit_name{
my( $self, $hit_name, $logic_name ) = @_;
throw("hit_name argument is required") if(! $hit_name);
#construct a constraint like 't1.hit_name = "123"'
my @tabs = $self->_tables;
my ($name, $syn) = @{$tabs[0]};
my $constraint = ( "${syn}.hit_name = '$hit_name'" );
if( $logic_name ){
# Add the $logic_name constraint
$constraint = $self->_logic_name_to_constraint($constraint, $logic_name);
}
return $self->generic_fetch($constraint);
}
=head2 fetch_all_by_RawContig_and_pid
Description: DEPRECATED use fetch_all_by_Slice_and_pid instead
......
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