<commit_before>#
# EnsEMBL module for Bio::EnsEMBL::BaseFeatureAdaptor
#
# Copyright (c) 2003 EnsEMBL
#
# You may distribute this module under the same terms as perl itself

# POD documentation - main docs before the code

=head1 NAME

Bio::EnsEMBL::DBSQL::BaseAlignFeatureAdaptor - Abstract Base class for
AlignFeatureAdaptors

=head1 SYNOPSIS

Abstract class - should not be instantiated.  Implementation of
abstract methods must be performed by subclasses.

=head1 DESCRIPTION

This is a base adaptor for align adaptors.  Since DnaAlignFeatureAdaptor and
PepAlignFeatureAdaptor had almost the same functionality it made sense to 
streamline by creating this superclass.

=head1 CONTACT

Post questions/comments to the ensembl developer list: <EMAIL>

=head1 METHODS

=cut

package Bio::EnsEMBL::DBSQL::BaseAlignFeatureAdaptor;
use vars qw(@ISA @EXPORT);
use strict;

use Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor;

@ISA = qw(Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor);

@EXPORT = (@{$DBI::EXPORT_TAGS{'sql_types'}});

=head2 fetch_all_by_Slice_and_pid

  Arg [1]    : Bio::EnsEMBL::Slice $slice
               The slice from which to obtain align features.
  Arg [2]    : (optional) float $pid 
               a lower bound for the percentage identity of feats to obtain
  Arg [3]    : (optional) string $logic_name
               the logic name of the type of features to obtain
  Example    : @feats = $adaptor->fetch_all_by_Slice_and_pid($slice, 50.0);
  Description: Returns a listref of features created from the database which
               are on the Slice $slice and with a percentage identity
               greater than $pid.  If logic name is defined, only features
               with an analysis of type $logic_name will be returned.
  Returntype : listref of Bio::EnsEMBL::BaseAlignFeatures in Slice coordinates
  Exceptions : thrown if pid is not defined
  Caller     : general
  Status     : Stable

=cut

sub fetch_all_by_Slice_and_pid {
  my ($self,$slice,$pid, $logic_name) = @_;
  my $constraint;


  #get the primary table alias
  my @tabs = $self->_tables;
  my $alias = $tabs[0]->[1];

  if(defined $pid) {
    $constraint = "${alias}.perc_ident > $pid";
  }

  if(defined $pid){
    $constraint = "perc_ident > $pid";
  }
<commit_msg>added  fetch_all_by_Slice_and_hcoverage<commit_after>#
# EnsEMBL module for Bio::EnsEMBL::BaseFeatureAdaptor
#
# Copyright (c) 2003 EnsEMBL
#
# You may distribute this module under the same terms as perl itself

# POD documentation - main docs before the code

=head1 NAME

Bio::EnsEMBL::DBSQL::BaseAlignFeatureAdaptor - Abstract Base class for
AlignFeatureAdaptors

=head1 SYNOPSIS

Abstract class - should not be instantiated.  Implementation of
abstract methods must be performed by subclasses.

=head1 DESCRIPTION

This is a base adaptor for align adaptors.  Since DnaAlignFeatureAdaptor and
PepAlignFeatureAdaptor had almost the same functionality it made sense to 
streamline by creating this superclass.

=head1 CONTACT

Post questions/comments to the ensembl developer list: <EMAIL>

=head1 METHODS

=cut

package Bio::EnsEMBL::DBSQL::BaseAlignFeatureAdaptor;
use vars qw(@ISA @EXPORT);
use strict;

use Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor;

@ISA = qw(Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor);

@EXPORT = (@{$DBI::EXPORT_TAGS{'sql_types'}});

=head2 fetch_all_by_Slice_and_hcoverage

  Arg [1]    : Bio::EnsEMBL::Slice $slice
               The slice from which to obtain align features.
  Arg [2]    : (optional) float $hcoverage 
               a lower bound for the hcoverage of feats to obtain
  Arg [3]    : (optional) string $logic_name
               the logic name of the type of features to obtain
  Example    : @feats = $adaptor->fetch_all_by_Slice_and_hcoverage($slice, 50.0);
  Description: Returns a listref of features created from the database which
               are on the Slice $slice and with a hcoverage
               greater than $hcoverage.  If logic name is defined, only features
               with an analysis of type $logic_name will be returned.
  Returntype : listref of Bio::EnsEMBL::BaseAlignFeatures in Slice coordinates
  Exceptions : thrown if pid is not defined
  Caller     : general
  Status     : At Risk

=cut

sub fetch_all_by_Slice_and_hcoverage {
  my ($self,$slice,$hcoverage, $logic_name) = @_;
  my $constraint;


  if(defined $hcoverage){
    $constraint = "hcoverage > $hcoverage";
  }

  return $self->fetch_all_by_Slice_constraint($slice, $constraint,
                                              $logic_name);
}


=head2 fetch_all_by_Slice_and_pid

  Arg [1]    : Bio::EnsEMBL::Slice $slice
               The slice from which to obtain align features.
  Arg [2]    : (optional) float $pid 
               a lower bound for the percentage identity of feats to obtain
  Arg [3]    : (optional) string $logic_name
               the logic name of the type of features to obtain
  Example    : @feats = $adaptor->fetch_all_by_Slice_and_pid($slice, 50.0);
  Description: Returns a listref of features created from the database which
               are on the Slice $slice and with a percentage identity
               greater than $pid.  If logic name is defined, only features
               with an analysis of type $logic_name will be returned.
  Returntype : listref of Bio::EnsEMBL::BaseAlignFeatures in Slice coordinates
  Exceptions : thrown if pid is not defined
  Caller     : general
  Status     : Stable

=cut

sub fetch_all_by_Slice_and_pid {
  my ($self,$slice,$pid, $logic_name) = @_;
  my $constraint;


#  #get the primary table alias
#  my @tabs = $self->_tables;
#  my $alias = $tabs[0]->[1];

#  if(defined $pid) {
#    $constraint = "${alias}.perc_ident > $pid";
#  }

  if(defined $pid){
    $constraint = "perc_ident > $pid";
  }

{'fraction_non_alphanumeric': 0.08401177897107223, 'fraction_numerical': 0.0074484670015589815, 'mean_word_length': 3.462132921174652, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6099055', 'n_tokens_mistral': 1874, 'n_tokens_neox': 1777, 'n_words': 612}