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::Upstream - Object that defines an upstream region

SYNOPSIS

use Bio::EnsEMBL::Upstream;

my $upstream = Bio::EnsEMBL::Upstream->new(
  -transcript => $transcript,
  -length     => 2000           # bp
);

# Retrieve coordinates of upstream region
my $upstream_region_start = $upstream->upstart;
my $upstream_region_end   = $upstream->upend;

# Retrieve coordinates in 'downstream' first intron
my $intron_region_start = $upstream->downstart;
my $intron_region_end   = $upstream->downend;

# Coordinates are returned in the same scheme as the input transcript.
# However, the coordinates of an upstream region can be transformed to
# any other scheme using a slice

$upstream->transform($slice);

# Coordinates can be retrieved in scheme in the same manner as the
# above.

DESCRIPTION

An object that determines the upstream region of a transcript. Such a region is non-coding and ensures that other genes or transcripts are not present. Ultimately, these objects can be used to looking for promoter elements. To this end, it is also possible to derive a region downstream of the first exon, within the first intron and where promoter elements sometimes are found.

METHODS

new

  Arg [transcript] : (optional) Bio::EnsEMBL::Transcript
  Arg [length]     : (optional) int $length
  Example    : $upstream = Bio::EnsEMBL::Upstream->new(-transcript => $transcript, 
						       -length => 2000);
  Description: Creates a new upstream object
  Returntype : Bio::EnsEMBL::Upstream
  Exceptions : none
  Caller     : Bio::EnsEMBL::Transcript, general
  Status     : Stable

transcript

Arg        : (optional) Bio::EnsEMBL::Transcript
Example    : $self->transcript($transcript);
Description: Getter/setter for transcript object
Returntype : Bio::EnsEMBL::Transcript
Exceptions : Throws if argument is not undefined 
             or a Bio::EnsEMBL::Transcript
Caller     : $self->new, $self->_derive_coords, 
             $self->_first_coding_Exon
Status     : Stable

length

Arg        : (optional) int $length
Example    : $self->length(2000); # bp
Description: Getter/setter for upstream region length.
Returntype : int
Exceptions : Throws if length is requested before it has been set.
Caller     : $self->new, $self->_derive_coords
Status     : Stable

_flush_cache

  Arg        : none
  Example    : $self->_flush_cache;
  Description: Empties cached coordinates (called when 
	       coordinate scheme or region length has changed).
  Returntype : none
  Exceptions : none
  Caller     : $self->length, $self->transform
  Status     : Stable

upstart

Arg        : none
Example    : $self->upstart;
Description: Returns the start coordinate of the region 
             upstream of the transcript.  This coordinate 
             is always the furthest from the translation 
             initiation codon, whereas upend always abutts 
             the translation initiation codon.
Returntype : int
Exceptions : none
Caller     : general
Status     : Stable

upend

Arg        : none
Example    : $self->upend;
Description: Returns the end coordinate of the region 
             upstream of the transcript.  This coordinate 
             always always abutts the translation 
             initiation codon, whereas upstart always 
             returns the coorindate furthest from the 
             translation initiation codon.
Returntype : int
Exceptions : none
Caller     : general
Status     : Stable

downstart

Arg        : none
Example    : $self->downstart;
Description: Returns the start coordinate of the region 
             in the first intron of the transcript.  This 
             coordinate is always closest to the first 
             exon (irregardless of strand).
Returntype : int
Exceptions : none
Caller     : general
Status     : Stable

downend

Arg        : none
Example    : $self->downend;
Description: Returns the end coordinate of the region 
             in the first intron of the transcript.  This 
             coordinate is always furthest from the first 
             exon (irregardless of strand).
Returntype : int
Exceptions : none
Caller     : general
Status     : Stable

transform

Arg        : 
Example    : 
Description: Not yet implemented
Returntype : 
Exceptions : 
Caller     : 
Status     : At Risk

derive_upstream_coords

Arg        : none
Example    : my ($upstart, $upend) 
                     = $self->derive_upstream_coords;
Description: Derives upstream coordinates (for 
             compatability with older scripts).
Returntype : arrayref
Exceptions : none
Caller     : general
Status     : Stable

derive_downstream_coords

Arg        : none
Example    : my ($downstart, $downend) 
                     = $self->derive_downstream_coords;
Description: Derives downstream coordinates (for 
             compatability with older scripts).
Returntype : arrayref
Exceptions : none
Caller     : general
Status     : Stable

_derive_coords

Arg        : string $direction (either 'up' or 'down').
Example    : $self->_derive_coords('up');
Description: Determines the coordinates of either upstream 
             or downstream region.
Returntype : none
Exceptions : Throws if argument is not either 'up' or 'down'
Caller     : $self->upstart, $self->upend, $self->downstart, 
             $self->downend
Status     : Stable

_bases_to_trim

Arg        : string $end_to_trim (either 'right_end' or 
             'left_end').
Arg        : Bio::EnsEMBL::Slice
Example    : $self->_derive_coords('right_end', $slice);
Description: Finds exons from other genes/transcripts that
             invade our upstream/downstream slice and 
             returns the number of bases that should be 
             truncated from the appropriate end of the 
             upstream/downstream region.
Returntype : in
Exceptions : Throws if argument is not either 'right_end' 
             or 'left_end'
Caller     : $self->_derive_coords
Status     : Stable

_first_coding_Exon

Arg        : none
Example    : $self->_first_coding_Exon;
Description: Finds the first exon of our transcript that 
             contains coding bases.
Returntype : Bio::EnsEMBL::Exon
Exceptions : none
Caller     : $self->_derive_coords, $self->_bases_to_trim
Status     : Stable