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::Slice - Arbitary Slice of a genome

SYNOPSIS

$sa = $db->get_SliceAdaptor;

$slice =
  $sa->fetch_by_region( 'chromosome', 'X', 1_000_000, 2_000_000 );

# get some attributes of the slice
my $seqname = $slice->seq_region_name();
my $start   = $slice->start();
my $end     = $slice->end();

# get the sequence from the slice
my $seq = $slice->seq();

# get some features from the slice
foreach $gene ( @{ $slice->get_all_Genes } ) {
  # do something with a gene
}

foreach my $feature ( @{ $slice->get_all_DnaAlignFeatures } ) {
  # do something with dna-dna alignments
}

DESCRIPTION

A Slice object represents a region of a genome. It can be used to retrieve sequence or features from an area of interest.

NOTE: The Slice is defined by its Strand, but normal behaviour for get_all_* methods is to return Features on both Strands.

METHODS

new

Arg [...]  : List of named arguments
             Bio::EnsEMBL::CoordSystem COORD_SYSTEM
             string SEQ_REGION_NAME,
             int    START,
             int    END,
             int    SEQ_REGION_LENGTH, (optional)
             string SEQ (optional)
             int    STRAND, (optional, defaults to 1)
             Bio::EnsEMBL::DBSQL::SliceAdaptor ADAPTOR (optional)
Example    : $slice = Bio::EnsEMBL::Slice->new(-coord_system => $cs,
                                               -start => 1,
                                               -end => 10000,
                                               -strand => 1,
                                               -seq_region_name => 'X',
                                               -seq_region_length => 12e6,
                                               -adaptor => $slice_adaptor);
Description: Creates a new slice object.  A slice represents a region
             of sequence in a particular coordinate system.  Slices can be
             used to retrieve sequence and features from an area of
             interest in a genome.

             Coordinates start at 1 and are inclusive.  Negative
             coordinates or coordinates exceeding the length of the
             seq_region are permitted.  Start must be less than or equal.
             to end regardless of the strand.

             Slice objects are immutable. Once instantiated their attributes
             (with the exception of the adaptor) may not be altered.  To
             change the attributes a new slice must be created.
Returntype : Bio::EnsEMBL::Slice
Exceptions : throws if start, end, coordsystem or seq_region_name not specified or not of the correct type
Caller     : general, Bio::EnsEMBL::SliceAdaptor
Status     : Stable

new_fast

Arg [1]    : hashref to be blessed
Description: Construct a new Bio::EnsEMBL::Slice using the hashref.
Exceptions : none
Returntype : Bio::EnsEMBL::Slice
Caller     : general
Status     : Stable

adaptor

Arg [1]    : (optional) Bio::EnsEMBL::DBSQL::SliceAdaptor $adaptor
Example    : $adaptor = $slice->adaptor();
Description: Getter/Setter for the slice object adaptor used
             by this slice for database interaction.
Returntype : Bio::EnsEMBL::DBSQL::SliceAdaptor
Exceptions : thorws if argument passed is not a SliceAdaptor
Caller     : general
Status     : Stable

seq_region_name

Arg [1]    : none
Example    : $seq_region = $slice->seq_region_name();
Description: Returns the name of the seq_region that this slice is on. For
             example if this slice is in chromosomal coordinates the
             seq_region_name might be 'X' or '10'.

             This function was formerly named chr_name, but since slices can
             now be on coordinate systems other than chromosomal it has been
             changed.
Returntype : string
Exceptions : none
Caller     : general
Status     : Stable

seq_region_start

Example    : $seq_region_start = $slice->seq_region_start();
Description: Returns the start position of this slice relative to the
             start of the sequence region that it was created on.
             Since slices are always in genomic coordinates this is
             an alias to start()
Returntype : int
Exceptions : none
Caller     : general
Status     : Stable

seq_region_end

Example    : $seq_region_end = $slice->seq_region_end();
Description: Returns the end position of this slice relative to the
             start of the sequence region that it was created on.
             Since slices are always in genomic coordinates this is
             an alias to end()
Returntype : int
Exceptions : none
Caller     : general
Status     : Stable

seq_region_length

Arg [1]    : none
Example    : $seq_region_length = $slice->seq_region_length();
Description: Returns the length of the entire seq_region that this slice is
             on. For example if this slice is on a chromosome this will be
             the length (in basepairs) of the entire chromosome.
Returntype : int
Exceptions : none
Caller     : general
Status     : Stable

coord_system

Arg [1]    : none
Example    : print $slice->coord_system->name();
Description: Returns the coordinate system that this slice is on.
Returntype : Bio::EnsEMBL::CoordSystem
Exceptions : none
Caller     : general
Status     : Stable

source

Arg [1]    : (optional) String $value
Example    : print $slice->source();
Description: Returns the source this slice is coming from
Returntype : string
Exceptions : none
Caller     : general
Status     : Stable

coord_system_name

Arg [1]    : none
Example    : print $slice->coord_system_name()
Description: Convenience method.  Gets the name of the coord_system which
             this slice is on.
             Returns undef if this Slice does not have an attached
             CoordSystem.
Returntype: string or undef
Exceptions: none
Caller    : general
Status     : Stable

centrepoint

Arg [1]    : none
Example    : $cp = $slice->centrepoint();
Description: Returns the mid position of this slice relative to the
             start of the sequence region that it was created on.
             Coordinates are inclusive and start at 1.
Returntype : int
Exceptions : none
Caller     : general
Status     : Stable

start

Arg [1]    : none
Example    : $start = $slice->start();
Description: Returns the start position of this slice relative to the
             start of the sequence region that it was created on.
             Coordinates are inclusive and start at 1.  Negative coordinates
             or coordinates exceeding the length of the sequence region are
             permitted.  Start is always less than or equal to end
             regardless of the orientation of the slice.
Returntype : int
Exceptions : none
Caller     : general
Status     : Stable

end

Arg [1]    : none
Example    : $end = $slice->end();
Description: Returns the end position of this slice relative to the
             start of the sequence region that it was created on.
             Coordinates are inclusive and start at 1.  Negative coordinates
             or coordinates exceeding the length of the sequence region are
             permitted.  End is always greater than or equal to start
             regardless of the orientation of the slice.
Returntype : int
Exceptions : none
Caller     : general
Status     : Stable

strand

Arg [1]    : none
Example    : $strand = $slice->strand();
Description: Returns the orientation of this slice on the seq_region it has
             been created on
Returntype : int (either 1 or -1)
Exceptions : none
Caller     : general, invert
Status     : Stable

name

Arg [1]    : none
Example    : my $results = $cache{$slice->name()};
Description: Returns the name of this slice. The name is formatted as a colon
             delimited string with the following attributes:
             coord_system:version:seq_region_name:start:end:strand

             Slices with the same name are equivalent and thus the name can
             act as a hash key.
Returntype : string
Exceptions : none
Caller     : general
Status     : Stable

length

Arg [1]    : none
Example    : $length = $slice->length();
Description: Returns the length of this slice in basepairs
Returntype : int
Exceptions : none
Caller     : general
Status     : Stable

is_reference Arg : none Example : my $reference = $slice->is_reference() Description: Returns 1 if slice is a reference slice else 0 Returntype : int Caller : general Status : At Risk

is_toplevel Arg : none Example : my $top = $slice->is_toplevel() Description: Returns 1 if slice is a toplevel slice else 0 Returntype : int Caller : general Status : At Risk

has_karyotype Arg : none Example : my $top = $slice->has_karyotype() Description: Returns 1 if slice is part of the karyotype else 0 Returntype : int Caller : general Status : At Risk

karyotype_rank Arg : none Example : my $rank = $slice->karyotype_rank() Description: Returns the numeric ranking in the karyotype. Otherwise 0 is returned Returntype : int Caller : general Status : At Risk

is_circular Arg : none Example : my $circ = $slice->is_circular() Description: Returns 1 if slice is a circular slice else 0 Returntype : int Caller : general Status : Stable

invert

Arg [1]    : none
Example    : $inverted_slice = $slice->invert;
Description: Creates a copy of this slice on the opposite strand and
             returns it.
Returntype : Bio::EnsEMBL::Slice
Exceptions : none
Caller     : general
Status     : Stable

seq

Arg [1]    : none
Example    : print "SEQUENCE = ", $slice->seq();
Description: Returns the sequence of the region represented by this
             slice formatted as a string.
             Only available for the default coord_system
Returntype : string
Exceptions : none
Caller     : general
Status     : Stable

subseq

Arg  [1]   : int $startBasePair
             relative to start of slice, which is 1.
Arg  [2]   : int $endBasePair
             relative to start of slice.
Arg  [3]   : (optional) int $strand
             The strand of the slice to obtain sequence from. Default
             value is 1.
Description: returns string of dna sequence
Returntype : txt
Exceptions : end should be at least as big as start
             strand must be set
Caller     : general
Status     : Stable

sub_Slice_Iterator

Arg[1]      : int The chunk size to request
Example     : my $i = $slice->sub_Slice_Iterator(60000); 
              while($i->has_next()) { warn $i->next()->name(); }
Description : Returns an iterator which batches subslices of this Slice 
              in the requested chunk size
Returntype  : Bio::EnsEMBL::Utils::Iterator next() will return the next
               chunk of Slice
Exceptions  : None

assembly_exception_type

Example     : $self->assembly_exception_type(); 
Description : Returns the type of slice this is. If it is reference then you
              will get 'REF' back. Otherwise you will get the first
              element from C<get_all_AssemblyExceptionFeatures()>. If no
              assembly exception exists you will get an empty string back.
Returntype  : String
Exceptions  : None
Caller      : Public
Status      : Beta

is_chromosome

Example			: print ($slice->is_chromosome()) ? 'I am a chromosome' : 'Not one'; 
Description	: A chromosome is a slice with a karyotype rank assigned to it.
Returntype 	: Boolean indicates if the current object is a chromosome
Exceptions 	: None

get_base_count

Arg [1]    : none
Example    : $c_count = $slice->get_base_count->{'c'};
Description: Retrieves a hashref containing the counts of each bases in the
             sequence spanned by this slice.  The format of the hash is :
             { 'a' => num,
               'c' => num,
               't' => num,
               'g' => num,
               'n' => num,
               '%gc' => num }

             All bases which are not in the set [A,a,C,c,T,t,G,g] are
             included in the 'n' count.  The 'n' count could therefore be
             inclusive of ambiguity codes such as 'y'.
             The %gc is the ratio of GC to AT content as in:
             total(GC)/total(ACTG) * 100
             This function is conservative in its memory usage and scales to
             work for entire chromosomes.
Returntype : hashref
Exceptions : none
Caller     : general
Status     : Stable

project

Arg [1]    : string $name
             The name of the coordinate system to project this slice onto
Arg [2]    : string $version
             The version of the coordinate system (such as 'NCBI34') to
             project this slice onto
Example    :
  my $clone_projection = $slice->project('clone');

  foreach my $segment (@$clone_projection) {
    my $clone = $segment->to_Slice();
    print $slice->seq_region_name(), ':', $segment->from_start(), '-',
          $segment->from_end(), ' -> ',
          $clone->seq_region_name(), ':', $clone->start(), '-',$clone->end(),
          ':', $clone->strand(), "\n";
  }
Description: Returns the results of 'projecting' this slice onto another
             coordinate system.  Projecting to a coordinate system that
             the slice is assembled from is analagous to retrieving a tiling
             path.  This method may also be used to 'project up' to a higher
             level coordinate system, however.

             This method returns a listref of triplets [start,end,slice]
             which represents the projection.  The start and end defined the
             region of this slice which is made up of the third value of
             the triplet: a slice in the requested coordinate system.
Returntype : list reference of Bio::EnsEMBL::ProjectionSegment objects which
             can also be used as [$start,$end,$slice] triplets
Exceptions : none
Caller     : general
Status     : Stable

expand

Arg [1]    : (optional) int $five_prime_expand
             The number of basepairs to shift this slices five_prime
             coordinate by.  Positive values make the slice larger,
             negative make the slice smaller.
             coordinate left.
             Default = 0.
Arg [2]    : (optional) int $three_prime_expand
             The number of basepairs to shift this slices three_prime
             coordinate by. Positive values make the slice larger,
             negative make the slice smaller.
             Default = 0.
Arg [3]    : (optional) bool $force_expand
             if set to 1, then the slice will be contracted even in the case
             when shifts $five_prime_expand and $three_prime_expand overlap.
             In that case $five_prime_expand and $three_prime_expand will be set
             to a maximum possible number and that will result in the slice
             which would have only 2pbs.
             Default = 0.
Arg [4]    : (optional) int* $fpref
             The reference to a number of basepairs to shift this slices five_prime
             coordinate by. Normally it would be set to $five_prime_expand.
             But in case when $five_prime_expand shift can not be applied and
             $force_expand is set to 1, then $$fpref will contain the maximum possible
             shift
Arg [5]    : (optional) int* $tpref
             The reference to a number of basepairs to shift this slices three_prime
             coordinate by. Normally it would be set to $three_prime_expand.
             But in case when $five_prime_expand shift can not be applied and
             $force_expand is set to 1, then $$tpref will contain the maximum possible
             shift
Example    : my $expanded_slice      = $slice->expand( 1000, 1000);
             my $contracted_slice    = $slice->expand(-1000,-1000);
             my $shifted_right_slice = $slice->expand(-1000, 1000);
             my $shifted_left_slice  = $slice->expand( 1000,-1000);
             my $forced_contracted_slice    = $slice->expand(-1000,-1000, 1, \$five_prime_shift, \$three_prime_shift);

Description: Returns a slice which is a resized copy of this slice.  The
             start and end are moved outwards from the center of the slice
             if positive values are provided and moved inwards if negative
             values are provided. This slice remains unchanged.  A slice
             may not be contracted below 1bp but may grow to be arbitrarily
             large.
Returntype : Bio::EnsEMBL::Slice
Exceptions : warning if an attempt is made to contract the slice below 1bp
Caller     : general
Status     : Stable

constrain_to_seq_region Example : $new_slice = $slice->expand(1000,10000); $new_slice = $new_slice->constrain_to_seq_region(); Description: Used to prevent overly zealous expand calls going off the end of the sequence region. It contracts the start and end where needed and produces a slice copy with the tweaked coordinates. Returntype : Bio::EnsEMBL::Slice

sub_Slice

Arg   1    : int $start, refers to the start of the subslice relative to the input slice
Arg   2    : int $end, refers to the end of the subslice relative to the input slice
Arge [3]   : int $strand
Example    : none
Description: Makes another Slice that covers only part of this Slice
             If a Slice is requested which lies outside of the boundaries
             of this function will return undef.  This means that
             behaviour will be consistant whether or not the slice is
             attached to the database (i.e. if there is attached sequence
             to the slice).  Alternatively the expand() method or the
             SliceAdaptor::fetch_by_region method can be used instead.
Returntype : Bio::EnsEMBL::Slice or undef if arguments are wrong
Exceptions : none
Caller     : general
Status     : Stable

seq_region_Slice

Arg [1]    : none
Example    : $slice = $slice->seq_region_Slice();
Description: Returns a slice which spans the whole seq_region which this slice
             is on.  For example if this is a slice which spans a small region
             of chromosome X, this method will return a slice which covers the
             entire chromosome X. The returned slice will always have strand
             of 1 and start of 1.  This method cannot be used if the sequence
             of the slice has been set manually.
Returntype : Bio::EnsEMBL::Slice
Exceptions : warning if called when sequence of Slice has been set manually.
Caller     : general
Status     : Stable

get_seq_region_id

Arg [1]    : none
Example    : my $seq_region_id = $slice->get_seq_region_id();
Description: Gets the internal identifier of the seq_region that this slice
             is on. Note that this function will not work correctly if this
             slice does not have an attached adaptor. Also note that it may
             be better to go through the SliceAdaptor::get_seq_region_id
             method if you are working with multiple databases since is
             possible to work with slices from databases with different
             internal seq_region identifiers.
Returntype : int or undef if slices does not have attached adaptor
Exceptions : warning if slice is not associated with a SliceAdaptor
Caller     : assembly loading scripts, general
Status     : Stable

get_genome_component

Arg []     : none
Example    : my $genome_component = $slice->get_genome_component();
Description: Returns the genome component of the slice
Returntype : Scalar; the identifier of the genome component of the slice
Exceptions : none
Caller     : general
Status     : Stable

get_all_Attributes

Arg [1]    : optional string $attrib_code
             The code of the attribute type to retrieve values for.
Example    : ($htg_phase) = @{$slice->get_all_Attributes('htg_phase')};
             @slice_attributes    = @{$slice->get_all_Attributes()};
Description: Gets a list of Attributes of this slice''s seq_region.
             Optionally just get Attrubutes for given code.
Returntype : listref Bio::EnsEMBL::Attribute
Exceptions : warning if slice does not have attached adaptor
Caller     : general
Status     : Stable

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

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. Strand of the Slice is not considered.
Returntype : listref of Bio::EnsEMBL::DnaDnaAlignFeatures
Exceptions : warning if slice does not have attached adaptor
Caller     : general
Status     : Stable

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

_get_AlignFeatures

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
Arg [5]    : string $align_type
             The type of adaptor to retrieve alignments from. Must be an BaseAlignFeature derived
             class
Description: Generic method which deals with the retrieval of either AlignFeature adaptor and allows
             you to switch the adaptor values are retrieved from.

get_all_SimilarityFeatures

Arg [1]    : (optional) string $logic_name
             the name of the analysis performed on the features to retrieve
Arg [2]    : (optional) float $score
             the lower bound of the score of the features to be retrieved
Example    : @feats = @{$slice->get_all_SimilarityFeatures};
Description: Retrieves all dna_align_features and protein_align_features
             with analysis named $logic_name and with score above $score.
             It is probably faster to use get_all_ProteinAlignFeatures or
             get_all_DnaAlignFeatures if a sepcific feature type is desired.
             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::BaseAlignFeatures
Exceptions : warning if slice does not have attached adaptor
Caller     : general
Status     : Stable

get_all_SimpleFeatures

Arg [1]    : (optional) string $logic_name
             The name of the analysis performed on the simple features
             to obtain.
Arg [2]    : (optional) float $score
             The mimimum score of the features to retrieve
Example    : @simple_feats = @{$slice->get_all_SimpleFeatures};
Description: Retrieves the SimpleFeatures 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::SimpleFeatures
Exceptions : warning if slice does not have attached adaptor
Caller     : general
Status     : Stable

get_all_RepeatFeatures

Arg [1]    : (optional) string $logic_name
             The name of the analysis performed on the repeat features
             to obtain.
Arg [2]    : (optional) string/array $repeat_type
             Limits features returned to those of the specified 
             repeat_type. Can specify a single value or an array reference
             to limit by more than one
Arg [3]    : (optional) string $db
             Key for database e.g. core/vega/cdna/....
Example    : @repeat_feats = @{$slice->get_all_RepeatFeatures(undef,'Type II Transposons')};
Description: Retrieves the RepeatFeatures which overlap  with
             logic name $logic_name and with score above $score.  If
             $logic_name is not defined features of all logic names are
             retrieved.
Returntype : listref of Bio::EnsEMBL::RepeatFeatures
Exceptions : warning if slice does not have attached adaptor
Caller     : general
Status     : Stable

get_all_LD_values

Arg [1]     : (optional) Bio::EnsEMBL::Variation::Population $population
Description : returns all LD values on this slice. This function will only work correctly if the variation
              database has been attached to the core database. If the argument is passed, will return the LD information
              in that population
ReturnType  : Bio::EnsEMBL::Variation::LDFeatureContainer
Exceptions  : none
Caller      : contigview, snpview
 Status     : Stable

_get_VariationFeatureAdaptor

Shortcut method here because VariationFeature is an often requested adaptor type.

_get_StructuralVariationFeatureAdaptor

Shortcut method here because StructuralVariationFeature is an often requested adaptor type.

_get_VariationAdaptor

Arg  [1]    : String object_type to retrieve an adaptor for
Arg  [2]    : String dbtype to search for the given adaptor in. Defaults to variation
Description : Searches for the specified adaptor in the Registry and returns it. Otherwise
              it will return nothing if the adaptor was not found
ReturnType  : Bio::EnsEMBL::DBSQL::BaseAdaptor derrived instance (specific to variation)
Exceptions  : none

_get_CoreAdaptor

Arg  [1]    : String object_type to retrieve an adaptor for
Arg  [2]    : String dbtype to search for the given adaptor in. Defaults to core
Description : Searches for the specified adaptor in the Registry and returns it. Otherwise
              it will return nothing if the adaptor was not found
ReturnType  : Bio::EnsEMBL::DBSQL::BaseAdaptor derrived instance (specific to core-like dbs)
Exceptions  : none

_get_Adaptor

Arg  [1]    : String object_type to retrieve an adaptor for
Arg  [2]    : String dbtype to search for the given adaptor in
Arg  [3]    : Boolean Turn off the checking of Registry->get_db() for your 
              adaptor.
Description : Searches for the specified adaptor in the Registry and returns it. Otherwise
              it will return nothing if the adaptor was not found. We consult the 
              "special" adaptors held by Bio::EnsEMBL::Registry::get_db() method and then
              fall back to the normal methods of finding an adaptor.

              This method will warn when adaptors are missing but will never through an
              exception. It is up to the calling code to decide how to handle the unavailablity
              of an adaptor.
ReturnType  : Bio::EnsEMBL::DBSQL::BaseAdaptor derrived instance. Otherwise it returns nothing
Exceptions  : none

get_all_VariationFeatures

Args [1]    : (optional) ArrayRef $so_terms
              SequenceOntology terms to limit the fetch to
Args [2]    : (optional) boolean $without_children
              Do not query using the children of the given SO terms 
              i.e. query using the given terms directly
Args [3]    : (optional) ArrayRef $included_so 
              ArrayRef of SequenceOntology which should be queried for
              without children. This argument allows you to combine SO terms with children
              from argument 1 with extra non-child SO terms. e.g. you wish to query for
              all protein_altering_variant (specified in argument 1) variations which 
              would be defined by child SO terms but also wanted stop_retained_variant linked variations
              defined by this argument
Args [4]    : (optional) string $dbtype
              The dbtype of variation to obtain (i.e. can be different from the "variation" type).
              This assumes that the extra db has been added to the DBAdaptor under this name (using the
              DBConnection::add_db_adaptor method).
Description : Returns all germline variation features on this slice. This function will 
              only work correctly if the variation database has been attached to the core 
              database.
              If $so_terms is specified, only variation features with a consequence type
              that matches or is an ontological child of any of the supplied terms will
              be returned
ReturnType  : listref of Bio::EnsEMBL::Variation::VariationFeature
Exceptions  : none
Caller      : contigview, snpview
Status      : Stable

get_all_somatic_VariationFeatures Args [1] : (optional) ArrayRef $so_terms SequenceOntology terms to limit the fetch to Args [2] : (optional) boolean $without_children Do not query using the children of the given SO terms i.e. query using the given terms directly Args [3] : (optional) ArrayRef $included_so ArrayRef of SequenceOntology which should be queried for without children. This argument allows you to combine SO terms with children from argument 1 with extra non-child SO terms. e.g. you wish to query for all protein_altering_variant (specified in argument 1) variations which would be defined by child SO terms but also wanted stop_retained_variant linked variations defined by this argument Args [4] : (optional) string $dbtype The dbtype of variation to obtain (i.e. can be different from the "variation" type). This assumes that the extra db has been added to the DBAdaptor under this name (using the DBConnection::add_db_adaptor method). Description : Returns all somatic variation features on this slice. This function will only work correctly if the variation database has been attached to the core database. ReturnType : listref of Bio::EnsEMBL::Variation::VariationFeature Exceptions : none Status : Stable

get_all_somatic_VariationFeatures_by_source Arg [1] : string $source [optional] The name of the source to query for Arg [2] : string $dbtype [optional] The dbtype of variation to obtain (i.e. can be different from the "variation" type). This assumes that the extra db has been added to the DBAdaptor under this name (using the DBConnection::add_db_adaptor method). Description : Returns all somatic variation features, from a defined source name (e.g.'COSMIC'), on this slice. This function will only work correctly if the variation database has been attached to the core database. ReturnType : listref of Bio::EnsEMBL::Variation::VariationFeature Exceptions : none Status : Stable

get_all_somatic_VariationFeatures_with_phenotype Arg [1] : $variation_feature_source [optional] Arg [2] : $phenotype_source [optional] Arg [3] : $phenotype_name [optional] Arg [4] : string $dbtype [optional] The dbtype of variation to obtain (i.e. can be different from the "variation" type). This assumes that the extra db has been added to the DBAdaptor under this name (using the DBConnection::add_db_adaptor method). Description : returns all somatic variation features on this slice associated with a phenotype. (see get_all_VariationFeatures_with_phenotype for further documentation) ReturnType : listref of Bio::EnsEMBL::Variation::VariationFeature Exceptions : none Status : Stable

get_all_VariationFeatures_by_Population Arg [1] : Bio::EnsEMBL::Variation::Population Arg [2] : $minimum_frequency [optional] Arg [3] : string $dbtype [optional] The dbtype of variation to obtain (i.e. can be different from the "variation" type). This assumes that the extra db has been added to the DBAdaptor under this name (using the DBConnection::add_db_adaptor method). Example : $pop = $pop_adaptor->fetch_by_dbID(659); @vfs = @{$slice->get_all_VariationFeatures_by_Population($pop,$slice)}; Description : Retrieves all variation features in a slice which are stored for a specified population. If $minimum_frequency is supplied, only variations with a minor allele frequency (MAF) greater than $minimum_frequency will be returned. Returntype : listref of Bio::EnsEMBL::Variation::VariationFeature Exceptions : throw on incorrect argument Caller : general Status : At Risk

get_all_Genes

Arg [1]    : (optional) string $logic_name
             The name of the analysis used to generate the genes to retrieve
Arg [2]    : (optional) string $dbtype
             The dbtype of genes to obtain.  This assumes that the db has
             been added to the DBAdaptor under this name (using the
             DBConnection::add_db_adaptor method).
Arg [3]    : (optional) boolean $load_transcripts
             If set to true, transcripts will be loaded immediately rather
             than being lazy-loaded on request.  This will result in a
             significant speed up if the Transcripts and Exons are going to
             be used (but a slow down if they are not).
Arg [4]    : (optional) string $source
             The source of the genes to retrieve.
Arg [5]    : (optional) string $biotype
             The biotype of the genes to retrieve.
Example    : @genes = @{$slice->get_all_Genes};
Description: Retrieves all genes that overlap this slice, including those on
             the reverse strand.
Returntype : listref of Bio::EnsEMBL::Genes
Exceptions : none
Caller     : none
Status     : Stable

get_all_Genes_by_type

Arg [1]    : string $type
             The biotype of genes wanted.
Arg [2]    : (optional) string $logic_name
Arg [3]    : (optional) boolean $load_transcripts
             If set to true, transcripts will be loaded immediately rather
             than being lazy-loaded on request.  This will result in a
             significant speed up if the Transcripts and Exons are going to
             be used (but a slow down if they are not).
Example    : @genes = @{$slice->get_all_Genes_by_type('protein_coding',
             'ensembl')};
Description: Retrieves genes that overlap this slice of biotype $type.
             This is primarily used by the genebuilding code when several
             biotypes of genes are used.

             The logic name is the analysis of the genes that are retrieved.
             If not provided all genes will be retrieved instead. Both
             positive and negative strand Genes will be returned.

Returntype : listref of Bio::EnsEMBL::Genes
Exceptions : none
Caller     : genebuilder, general
Status     : Stable

get_all_Genes_by_source

Arg [1]    : string source
Arg [2]    : (optional) boolean $load_transcripts
             If set to true, transcripts will be loaded immediately rather
             than being lazy-loaded on request.  This will result in a
             significant speed up if the Transcripts and Exons are going to
             be used (but a slow down if they are not).
Example    : @genes = @{$slice->get_all_Genes_by_source('ensembl')};
Description: Retrieves genes that overlap this slice of source $source.
             Strand of the Slice does not affect the result.
Returntype : listref of Bio::EnsEMBL::Genes
Exceptions : none
Caller     : general
Status     : Stable

get_all_Transcripts

Arg [1]    : (optional) boolean $load_exons
             If set to true exons will not be lazy-loaded but will instead
             be loaded right away.  This is faster if the exons are
             actually going to be used right away.
Arg [2]    : (optional) string $logic_name
             the logic name of the type of features to obtain
Arg [3]    : (optional) string $db_type
Example    : @transcripts = @{$slice->get_all_Transcripts)_};
Description: Gets all transcripts which overlap this slice.  If you want to
             specify a particular analysis or type, then you are better off
             using get_all_Genes or get_all_Genes_by_type and iterating
             through the transcripts of each gene. Strand of the Slice is
             ignored.
Returntype : reference to a list of Bio::EnsEMBL::Transcripts
Exceptions : none
Caller     : general
Status     : Stable

get_all_Transcripts_by_type

Arg [1]    : string $type
             The biotype of transcripts wanted.
Arg [2]    : (optional) string $logic_name
Arg [3]    : (optional) boolean $load_exons
             If set to true exons will not be lazy-loaded but will instead
             be loaded right away.  This is faster if the exons are
             actually going to be used right away.

Example    : @transcripts = @{$slice->get_all_Transcripts_by_type('protein_coding',
             'ensembl')};
Description: Retrieves transcripts that overlap this slice of biotype $type.
             This is primarily used by the genebuilding code when several
             biotypes of transcripts are used.

             The logic name is the analysis of the transcripts that are retrieved.
             If not provided all transcripts will be retrieved instead. Both
             positive and negative strand transcripts will be returned.

Returntype : listref of Bio::EnsEMBL::Transcripts
Exceptions : none
Caller     : genebuilder, general
Status     : Stable

get_all_Transcripts_by_source

Arg [1]    : string source
Arg [2]    : (optional) boolean $load_exons
             If set to true exons will not be lazy-loaded but will instead
             be loaded right away.  This is faster if the exons are
             actually going to be used right away.
Example    : @transcripts = @{$slice->get_all_Transcripts_by_source('ensembl')};
Description: Retrieves transcripts that overlap this slice of source $source.
             Strand of the Slice does not affect the result.
Returntype : listref of Bio::EnsEMBL::Transcripts
Exceptions : none
Caller     : general
Status     : Stable

get_all_Exons

Arg [1]    : none
Example    : @exons = @{$slice->get_all_Exons};
Description: Gets all exons which overlap this slice.  Note that these exons
             will not be associated with any transcripts, so this may not
             be terribly useful.
Returntype : reference to a list of Bio::EnsEMBL::Exons
Exceptions : none
Caller     : general
Status     : Stable

get_all_KaryotypeBands

Arg [1]    : none
Example    : @kary_bands = @{$slice->get_all_KaryotypeBands};
Description: Retrieves the karyotype bands which this slice overlaps.
Returntype : listref oif Bio::EnsEMBL::KaryotypeBands
Exceptions : none
Caller     : general, contigview
Status     : Stable

get_repeatmasked_seq

Arg [1]    : listref of strings $logic_names (optional)
Arg [2]    : int $soft_masking_enable (optional)
Arg [3]    : hash reference $not_default_masking_cases (optional, default is {})
             The values are 0 or 1 for hard and soft masking respectively
             The keys of the hash should be of 2 forms
             "repeat_class_" . $repeat_consensus->repeat_class,
              e.g. "repeat_class_SINE/MIR"
             "repeat_name_" . $repeat_consensus->name
              e.g. "repeat_name_MIR"
             depending on which base you want to apply the not default
             masking either the repeat_class or repeat_name. Both can be
             specified in the same hash at the same time, but in that case,
             repeat_name setting has priority over repeat_class. For example,
             you may have hard masking as default, and you may want soft
             masking of all repeat_class SINE/MIR, but repeat_name AluSp
             (which are also from repeat_class SINE/MIR).
             Your hash will be something like {"repeat_class_SINE/MIR" => 1,
                                               "repeat_name_AluSp" => 0}
Example    : $rm_slice = $slice->get_repeatmasked_seq();
             $softrm_slice = $slice->get_repeatmasked_seq(['RepeatMask'],1);
Description: Returns Bio::EnsEMBL::Slice that can be used to create repeat
             masked sequence instead of the regular sequence.
             Sequence returned by this new slice will have repeat regions
             hardmasked by default (sequence replaced by N) or
             or soft-masked when arg[2] = 1 (sequence in lowercase)
             Will only work with database connection to get repeat features.
Returntype : Bio::EnsEMBL::RepeatMaskedSlice
Exceptions : none
Caller     : general
Status     : Stable

_mask_features

Arg [1]    : reference to a string $dnaref
Arg [2]    : array_ref $repeats
             reference to a list Bio::EnsEMBL::RepeatFeature
             give the list of coordinates to replace with N or with
             lower case
Arg [3]    : int $soft_masking_enable (optional)
Arg [4]    : hash reference $not_default_masking_cases (optional, default is {})
             The values are 0 or 1 for hard and soft masking respectively
             The keys of the hash should be of 2 forms
             "repeat_class_" . $repeat_consensus->repeat_class,
              e.g. "repeat_class_SINE/MIR"
             "repeat_name_" . $repeat_consensus->name
              e.g. "repeat_name_MIR"
             depending on which base you want to apply the not default masking either
             the repeat_class or repeat_name. Both can be specified in the same hash
             at the same time, but in that case, repeat_name setting has priority over
             repeat_class. For example, you may have hard masking as default, and
             you may want soft masking of all repeat_class SINE/MIR,
             but repeat_name AluSp (which are also from repeat_class SINE/MIR).
             Your hash will be something like {"repeat_class_SINE/MIR" => 1,
                                               "repeat_name_AluSp" => 0}
Example    : none
Description: replaces string positions described in the RepeatFeatures
             with Ns (default setting), or with the lower case equivalent
             (soft masking).  The reference to a dna string which is passed
             is changed in place.
Returntype : none
Exceptions : none
Caller     : seq
Status     : Stable

get_all_SearchFeatures

Arg [1]    : scalar $ticket_ids
Example    : $slice->get_all_SearchFeatures('BLA_KpUwwWi5gY');
Description: Retrieves all search features for stored blast
             results for the ticket that overlap this slice
Returntype : listref of Bio::EnsEMBL::SeqFeatures
Exceptions : none
Caller     : general (webby!)
Status     : Stable

get_all_AssemblyExceptionFeatures

Example    : $slice->get_all_AssemblyExceptionFeatures();
Description: Retrieves 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

get_all_MiscFeatures

Arg [1]    : string $set (optional)
Arg [2]    : string $database (optional)
Example    : $slice->get_all_MiscFeatures('cloneset');
Description: Retrieves 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

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

get_MarkerFeatures_by_Name

Arg [1]    : string marker Name
             The name (synonym) of the marker feature(s) to retrieve
Example    : my @markers = @{$slice->get_MarkerFeatures_by_Name('z1705')};
Description: Retrieves all markers with this ID
Returntype : reference to a list of Bio::EnsEMBL::MarkerFeatures
Exceptions : none
Caller     : contigview, general
Status     : Stable

get_all_compara_DnaAlignFeatures

  Arg [1]    : string $qy_species
               The name of the species to retrieve similarity features from
  Arg [2]    : string $qy_assembly
               The name of the assembly to retrieve similarity features from
  Arg [3]    : string $type
               The type of the alignment to retrieve similarity features from
  Arg [4]    : <optional> compara dbadptor to use.
  Example    : $fs = $slc->get_all_compara_DnaAlignFeatures('Mus musculus',
							    'MGSC3',
							    'WGA');
  Description: Retrieves a list of DNA-DNA Alignments to the species specified
               by the $qy_species argument.
               The compara database must be attached to the core database
               for this call to work correctly.  As well the compara database
               must have the core dbadaptors for both this species, and the
               query species added to function correctly.
  Returntype : reference to a list of Bio::EnsEMBL::DnaDnaAlignFeatures
  Exceptions : warning if compara database is not available
  Caller     : contigview
  Status     : Stable

get_all_compara_Syntenies

Arg [1]    : string $query_species e.g. "Mus_musculus" or "Mus musculus"
Arg [2]    : string $method_link_type, default is "SYNTENY"
Arg [3]    : <optional> compara dbadaptor to use.
Description: gets all the compara syntenyies for a specfic species
Returns    : arrayref of Bio::EnsEMBL::Compara::SyntenyRegion
Status     : Stable

get_all_Haplotypes

Arg [1]    : (optional) boolean $lite_flag
             if true lightweight haplotype objects are used
Example    : @haplotypes = $slice->get_all_Haplotypes;
Description: Retrieves all of the haplotypes on this slice.  Only works
             if the haplotype adaptor has been attached to the core adaptor
             via $dba->add_db_adaptor('haplotype', $hdba);
Returntype : listref of Bio::EnsEMBL::External::Haplotype::Haplotypes
Exceptions : warning is Haplotype database is not available
Caller     : contigview, general
Status     : Stable

get_all_DAS_Features

Arg [1]    : none
Example    : $features = $slice->get_all_DASFeatures;
Description: Retrieves a hash reference to a hash of DAS feature
             sets, keyed by the DNS, NOTE the values of this hash
             are an anonymous array containing:
              (1) a pointer to an array of features;
              (2) a pointer to the DAS stylesheet
Returntype : hashref of Bio::SeqFeatures
Exceptions : ?
Caller     : webcode
Status     : Stable

get_all_ExternalFeatures

Arg [1]    : (optional) string $track_name
             If specified only features from ExternalFeatureAdaptors with
             the track name $track_name are retrieved.
             If not set, all features from every ExternalFeatureAdaptor are
             retrieved.
Example    : @x_features = @{$slice->get_all_ExternalFeatures}
Description: Retrieves features on this slice from external feature adaptors
Returntype : listref of Bio::SeqFeatureI implementing objects in slice
             coordinates
Exceptions : none
Caller     : general
Status     : Stable

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. If type is not defined, all features are retrieved.
             Strandedness of the Slice is ignored.
Returntype : listref of Bio::EnsEMBL::DitagFeatures
Exceptions : warning if slice does not have attached adaptor
Caller     : general
Status     : Stable

get_generic_features

Arg [1]    : (optional) List of names of generic feature types to return.
             If no feature names are given, all generic features are
             returned.
Example    : my %features = %{$slice->get_generic_features()};
Description: Gets generic features via the generic feature adaptors that
             have been added via DBAdaptor->add_GenricFeatureAdaptor (if
             any)
Returntype : Hash of named features.
Exceptions : none
Caller     : none
Status     : Stable

project_to_slice

  Arg [1]    : Slice to project to.
  Example    : my $chr_projection = $clone_slice->project_to_slice($chrom_slice);
                foreach my $segment ( @$chr_projection ){
                  $chr_slice = $segment->to_Slice();
                  print $clone_slice->seq_region_name(). ':'. $segment->from_start(). '-'.
                        $segment->from_end(). ' -> '.$chr_slice->seq_region_name(). ':'. $chr_slice->start().
	                '-'.$chr_slice->end().
                         $chr_slice->strand(). " length: ".($chr_slice->end()-$chr_slice->start()+1). "\n";
                }
  Description: Projection of slice to another specific slice. Needed for where we have multiple mappings
               and we want to state which one to project to.
  Returntype : list reference of Bio::EnsEMBL::ProjectionSegment objects which
               can also be used as [$start,$end,$slice] triplets.
  Exceptions : none
  Caller     : none
  Status     : At Risk

get_all_synonyms

Args [1]   : String external_db_name The name of the database to retrieve 
             the synonym for
Args [2]   : (optional) Integer external_db_version Optionally restrict
             results from external_db_name to a specific version of
             the the specified external database
Example    : my @alternative_names = @{$slice->get_all_synonyms()};
             @alternative_names = @{$slice->get_all_synonyms('EMBL')};
Description: get a list of alternative names for this slice
Returntype : reference to list of SeqRegionSynonym objects.
Exception  : none
Caller     : general
Status     : At Risk

add_synonym

Args[0]    : synonym.
Example    : $slice->add_synonym("alt_name");
Description: add an alternative name for this slice
Returntype : none
Exception  : none
Caller     : general
Status     : At Risk

feature_so_acc

Example     : $slice_so_acc = $slice->feature_so_acc;
Description : This method returns a string containing the SO accession number of the slice, based on the coordinate system name.
Returns     : string (Sequence Ontology accession number)

feature_so_term

Description: This method returns a string containing the SO term of the slice, based on the coordinate system name
             Define constant SEQUENCE_ONTOLOGY in classes that require it, or override it for multiple possible values for a class.
Returntype : String (Sequence Ontology term)
Exceptions : Thrown if caller SEQUENCE_ONTOLOGY is undefined and is not a Bio::EnsEMBL::Slice

summary_as_hash

Example       : $slice_summary = $slice->summary_as_hash();
Description   : Retrieves a textual summary of this slice.
Returns       : hashref of descriptive strings

id

Description: Included for Bio::PrimarySeqI interface compliance (0.7)

display_id

Description: Included for Bio::PrimarySeqI interface compliance (1.2)

primary_id

Description: Included for Bio::PrimarySeqI interface compliance (1.2)

desc

Description: Included for Bio::PrimarySeqI interface compliance (1.2)

moltype

Description: Included for Bio::PrimarySeqI interface compliance (0.7)

alphabet

Description: Included for Bio::PrimarySeqI interface compliance (1.2)

accession_number

Description: Included for Bio::PrimarySeqI interface compliance (1.2)