LICENSE

Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute Copyright [2016-2024] EMBL-European Bioinformatics Institute

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

CONTACT

Please email comments or questions to the public Ensembl
developers list at <http://lists.ensembl.org/mailman/listinfo/dev>.

Questions may also be sent to the Ensembl help desk at
<http://www.ensembl.org/Help/Contact>.

NAME

Bio::EnsEMBL::FeaturePair - Stores sequence Features which are themselves hits to other sequence features.

SYNOPSIS

my $feat = Bio::EnsEMBL::FeaturePair->new(
  -start      => 132_231,
  -end        => 132_321,
  -strand     => -1,
  -slice      => $slice,
  -hstart     => 10,
  -hend       => 100,
  -hstrand    => 1,
  -score      => 100,
  -percent_id => 92.0,
  -hseqname   => 'ALUSX10.1',
  -analysis   => $analysis
);

my $hit_start  = $feat->hstart();
my $hit_end    = $feat->hend();
my $hit_strand = $feat->hstrand();
my $analysis   = $feat->analysis();

DESCRIPTION

A sequence feature object where the feature is itself a feature on another sequence - e.g. a blast hit where residues 1-40 of a protein sequence SW:HBA_HUMAN has hit to bases 100 - 220 on a genomic sequence HS120G22. The genomic sequence coordinates are represented by the start, end, strand attributes while the protein (hit) coordinates are represented by the hstart, hend, hstrand attributes.

$clone = $slice_adpator->fetch_by_region( 'clone', 'HS120G22' );

$fp = Bio::EnsEMBL::FeaturePair(
  -start      => 100,
  -end        => 220,
  -strand     => 1,
  -slice      => $clone,
  -hstart     => 1,
  -hend       => 40,
  -hstrand    => 1,
  -percent_id => 92.0,
  -score      => 100,
  -hseqname   => 'SW:HBA_HUMAN',
  -species    => 'Homo sapiens',
  -hspecies   => 'Homo sapiens'
);

METHODS

new

Arg [HSTART]    : int - The start of the hit region (optional)
Arg [HEND]      : int - The end of the hit region (optional)
Arg [HSTRAND]   : (0,1,-1) - The strand of the hit region (optional)
Arg [PERCENT_ID]: float -  The precentage identity of the hit (optional)
Arg [SCORE]     : float -  The score of the hit (optional)
Arg [HSEQNAME]  : string - The name of the hit sequence (optional)
Arg [P_VALUE]   : float -  The pvalue or evalue (optional)
Arg [SPECIES]   : string - The species the query sequence is from (optional)
Arg [HSPECIES]  : string - The species the hit sequence is from (optional)
Arg [COVERAGE]  : string - The % of the query that this feature pair covers
Arg [HCOVERAGE] : string - The % of the target this this feature pair covers
Arg [EXTRA_DATA]: HashRef - Additional data, specified as name, value attribute pairs (optional)
Arg [...]       : Named superclass constructor args (Bio::EnsEMBL::Feature)
Example    : $feat = Bio::EnsEMBL::FeaturePair->new(-start    => 132_231,
                                            -end      => 132_321,
                                            -strand   => -1,
                                            -slice    => $slice,
                                            -hstart   => 10,
                                            -hend     => 100,
                                            -hstrand  => 1,
                                            -score    => 100,
                                            -percent_id => 92.0,
                                            -hseqname => 'ALUSX10.1',
                                            -analysis => $analysis);
Description: Creates a new Bio::EnsEMBL::FeaturePair object
Returntype : Bio::EnsEMBL::FeaturePair
Exceptions : throw if start > end
             throw if invalid strand is provided
Caller     : general
Status     : Stable

hseqname

Arg [1]    : string $hseqname (optional)
Example    : $hseqname = $fp->hseqname();
Description: Getter/Setter for the name of the hit sequence
Returntype : string
Exceptions : none
Caller     : general
Status     : Stable

hstart

Arg [1]    : string $hstart (optional)
Example    : $hstart = $fp->hstart();
Description: Getter/Setter for the start coordinate on the hit sequence
Returntype : int
Exceptions : none
Caller     : general
Status     : Stable

hend

Arg [1]    : string $hend (optional)
Example    : $hend = $fp->hend();
Description: Getter/Setter for the end coordinate on the hit sequence
Returntype : int
Exceptions : none
Caller     : general
Status     : Stable

hstrand

Arg [1]    : int $hstrand (optional)
Example    : $hstrand = $fp->hstrand
Description: Getter/Setter for the orientation of the hit on the hit sequence
Returntype : 0,1,-1
Exceptions : thrown 
Caller     : general
Status     : Stable

hslice

Arg [1]    : (optional) Bio::EnsEMBL::Slice $slice
Example    : $hseqname = $featurepair->hslice()->seq_region_name();
Description: Getter/Setter for the Slice that is associated with this 
             hit feature.  The slice represents the underlying sequence that this
             feature is on.  Note that this method call is analagous to the
             old SeqFeature methods contig(), entire_seq(), attach_seq(),
             etc.
Returntype : Bio::EnsEMBL::Slice
Exceptions : thrown if an invalid argument is passed
Caller     : general
Status     : Stable

hseq_region_name

Arg [1]    : none
Example    : print $feature->hseq_region_name();
Description: Gets the name of the hseq_region which this feature is on.
             Returns undef if this Feature is not on a hslice.
Returntype : string or undef
Exceptions : none
Caller     : general
Status     : Stable

hseq_region_strand

Arg [1]    : none
Example    : print $feature->hseq_region_strand();
Description: Returns the strand of the hseq_region which this feature is on 
             (i.e. feature_strand * slice_strand)
             Returns undef if this Feature is not on a hslice.
Returntype : 1,0,-1 or undef
Exceptions : none
Caller     : general
Status     : Stable

hseq_region_start

Arg [1]    : none
Example    : print $feature->hseq_region_start();
Description: Convenience method which returns the absolute start of this
             feature on the hseq_region, as opposed to the relative (hslice) 
             position.

             Returns undef if this feature is not on a hslice.
Returntype : int or undef
Exceptions : none
Caller     : general
Status     : Stable

hseq_region_end

Arg [1]    : none
Example    : print $feature->hseq_region_end();
Description: Convenience method which returns the absolute end of this
             feature on the hseq_region, as opposed to the relative (hslice)
             position.

             Returns undef if this feature is not on a hslice.
Returntype : int or undef
Exceptions : none
Caller     : general
Status     : Stable

score

Arg [1]    : float $score (optional)
Example    : $score = $fp->score();
Description: Getter/Setter for the score of this feature pair
Returntype : float
Exceptions : none
Caller     : general
Status     : Stable

percent_id

Arg [1]    : float $percent_id (optional)
Example    : $percent_id = $fp->percent_id();
Description: Getter/Setter for the percentage identity of this feature pair
Returntype : float
Exceptions : none
Caller     : general
Status     : Stable

species

Arg [1]    : string $genus_species_name (optional)
             e.g. Homo_sapiens or Mus_musculus
Example    : $species = $fp->species();
Description: get/set on the species of feature1
Returntype : string
Execeptions: none
Caller     : general
Status     : Stable

hspecies

Arg [1]    : string $genus_species_name (optional)
             e.g. Homo_sapiens or Mus_musculus
Example    : $hspecies = $fp->hspecies
Description: get/set on the species of feature2
Returntype : string
Execeptions: none
Caller     : general
Status     : Stable

coverage

Arg [1]    : number (percentage) $coverage (optional)
Example    : $cov = $fp->coverage();
Description: Getter/Setter for the % of the query covered by the feature
Returntype : string
Exceptions : none
Caller     : general
Status     : Stable

hcoverage

Arg [1]    : number (percentage) $hcoverage (optional)
Example    : $hcov = $fp->hcoverage();
Description: Getter/Setter for the % of the target covered by the feature
Returntype : string
Exceptions : none
Caller     : general
Status     : Stable

external_db_id

Arg [1]    : int  $external_db_id (optional)
Example    : $ex_db = $fp->external_db_id();
Description: Getter/Setter for the external_db_id taregt source database feature
Returntype : string
Exceptions : none
Caller     : general
Status     : At Risk

db_name

Arg [1]    : string  $external_db_name (optional)
Example    : $ex_db_name = $fp->dbname();
Description: Getter/Setter for the external_db_name attribute, name of external database
Returntype : string
Exceptions : none
Caller     : general
Status     : At Risk

db_display_name

Arg [1]    : string  $db_display_name (optional)
Example    : $ex_db_display_name = $fp->db_display_name();
Description: Getter/Setter for the db_display_name attribute 
             The preferred display name for the external database. 
Returntype : string
Exceptions : none
Caller     : general
Status     : At Risk

p_value

Arg [1]    : float $p_value (optional)
Example    : $eval = $fp->p_value
Description: Getter Setter for the evalue / pvalue of this feature
Returntype : float
Exceptions : none
Caller     : general
Status     : Stable

hdescription

Arg [1]    : String (optional)
Example    : $des = $fp->hdescription()
Description: Getter Setter for optional description of this feature
Returntype : String
Exceptions : none
Caller     : general
Status     : Stable

display_id

Arg [1]    : none
Example    : print $fp->display_id();
Description: This method returns a string that is considered to be
             the 'display' identifier.  For feature pairs this is the 
             hseqname if it is available otherwise it is an empty string.
Returntype : string
Exceptions : none
Caller     : web drawing code
Status     : Stable

identical_matches

Arg [1]    : int $identical_matches (optional)
Example    : 
Description: get/set on the number of identical matches
Returntype : int
Execeptions: none
Caller     : general
 Status     : Stable

positive_matches

Arg [1]    : int $positive_matches (optional)
Example    : 
Description: get/set on the number of positive matches
Returntype : int
Execeptions: none
Caller     : general
 Status     : Stable

group_id

 Arg [1]    : int $group_id
 Example    : none
 Description: get/set for attribute group_id
 Returntype : int
 Exceptions : none
 Caller     : general
 Status     : Stable

level_id

 Arg [1]    : int $level_id
 Example    : none
 Description: get/set for attribute level_id
 Returntype : int
 Exceptions : none
 Caller     : general
 Status     : Stable

invert

Arg [1]    : (optional) Bio::EnsEMBL::Slice $newslice
Example    : $feature->invert();
Description: This method is used to swap the hit and query sides of this
             feature in place.  A new slice may optionally provided which
             this feature will be placed on.  If no slice is provided the
             feature slice will be set to undef.
Returntype : none
Exceptions : none
Caller     : pipeline (BlastMiniGenewise)