ensembl-hive  2.7.0
Bio::EnsEMBL::DBSQL::SliceAdaptor Class Reference
+ Inheritance diagram for Bio::EnsEMBL::DBSQL::SliceAdaptor:

Public Member Functions

public new ()
 
public Bio::EnsEMBL::Slice fetch_by_region ()
 
public Bio::EnsEMBL::Slice fetch_by_toplevel_location ()
 
public Bio::EnsEMBL::Slice fetch_by_location ()
 
public List parse_location_to_values ()
 
public Listref fetch_by_region_unique ()
 
public Bio::EnsEMBL::Slice fetch_by_name ()
 
public Bio::EnsEMBL::Slice fetch_by_seq_region_id ()
 
public Int get_seq_region_id ()
 
public Listref fetch_all ()
 
public Listref fetch_all_by_genome_component ()
 
public Scalar get_genome_component_for_slice ()
 
public Listref fetch_all_karyotype ()
 
public Int is_toplevel ()
 
public Int has_karyotype ()
 
public Int get_karyotype_rank ()
 
public Int is_reference ()
 
public Boolean is_circular ()
 
public Bio::EnsEMBL::Slice fetch_by_chr_band ()
 
public Bio::EnsEMBL::Slice fetch_by_exon_stable_id ()
 
public Bio::EnsEMBL::Slice fetch_by_transcript_stable_id ()
 
public Bio::EnsEMBL::Slice fetch_by_transcript_id ()
 
public Bio::EnsEMBL::Slice fetch_by_gene_stable_id ()
 
public Bio::EnsEMBL::Slice fetch_by_Feature ()
 
public Bio::EnsEMBL::Slice fetch_by_misc_feature_attribute ()
 
public Bio::EnsEMBL::Slice fetch_by_misc_feature_set ()
 
public fetch_normalized_slice_projection ()
 
protected ArrayRef _filter_Slice_projections ()
 
public Int store ()
 
public update ()
 
public void remove ()
 
public void remove_assembly ()
 
public Bio::EnsEMBL::Mapper fetch_assembly ()
 
public String store_assembly ()
 
public DBD::sth prepare ()
 
protected _build_exception_cache ()
 
public void cache_toplevel_seq_mappings ()
 
protected _build_circular_slice_cache ()
 
protected Bio::EnsEMBL::CoordSystem _create_chromosome_alias ()
 
protected Bio::EnsEMBL::SliceAdaptor _fetch_by_seq_region_synonym ()
 
protected String _fetch_by_fuzzy_matching ()
 
- Public Member Functions inherited from Bio::EnsEMBL::DBSQL::BaseAdaptor
public Bio::EnsEMBL::DBSQL::BaseAdaptor new ()
 
public DBI::StatementHandle prepare ()
 
public Bio::EnsEMBL::DBSQL::DBAdaptor db ()
 
public Bio::EnsEMBL::DBSQL::DBConnection dbc ()
 
public Boolean is_multispecies ()
 
public Int species_id ()
 
protected _list_dbIDs ()
 
protected _straight_join ()
 
protected _can_straight_join ()
 
public Listref bind_param_generic_fetch ()
 
protected _bind_param_generic_fetch ()
 
public String generate_in_constraint ()
 
public Listref generic_fetch ()
 
public Int generic_count ()
 
protected _generate_sql ()
 
public Bio::EnsEMBL::Feature fetch_by_dbID ()
 
protected _uncached_fetch_by_dbID ()
 
public Listref fetch_all_by_dbID_list ()
 
protected _uncached_fetch_all_by_dbID_list ()
 
protected ArrayRef _uncached_fetch_all_by_id_list ()
 
public fetch_all ()
 
public Scalar last_insert_id ()
 
public insert_ignore_clause ()
 
protected Bio::EnsEMBL::DBSQL::Support::BaseCache _id_cache ()
 
protected Boolean _no_id_cache ()
 
public Boolean ignore_cache_override ()
 
public Int schema_version ()
 
protected _tables ()
 
protected _columns ()
 
protected _default_where_clause ()
 
protected _left_join ()
 
protected _final_clause ()
 
protected _objs_from_sth ()
 
protected _build_id_cache ()
 
protected _logic_name_to_constraint ()
 

Detailed Description

Synopsis

use Bio::EnsEMBL::Utils::Slice qw(split_Slices);
-host => 'ensembldb.ensembl.org',
-user => 'anonymous'
);
$slice_adaptor =
Bio::EnsEMBL::Registry->get_adaptor( "human", "core", "slice" );
# get a slice on the entire chromosome X
$chr_slice = $slice_adaptor->fetch_by_region( 'chromosome', 'X' );
# get a slice for each clone in the database
foreach $cln_slice ( @{ $slice_adaptor->fetch_all('clone') } ) {
# do something with clone
}
# get a slice which is part of NT_004321
$spctg_slice =
$slice_adaptor->fetch_by_region( 'supercontig', 'NT_004321',
200_000, 600_000 );
# get all non-redundant slices from the highest possible coordinate
# systems
$slices = $slice_adaptor->fetch_all('toplevel');
# include non-reference regions
$slices = $slice_adaptor->fetch_all( 'toplevel', undef, 1 );
# include duplicate regions
$slices = $slice_adaptor->fetch_all( 'toplevel', undef, 0, 1 );
# split up a list of slices into smaller slices
$overlap = 1000;
$max_length = 1e6;
$slices = split_Slices( $slices, $max_length, $overlap );
# store a list of slice names in a file
open( FILE, ">$filename" ) or die("Could not open file $filename");
foreach my $slice (@$slices) {
print FILE $slice->name(), "\n";
}
close FILE;
# retrieve a list of slices from a file
open( FILE, $filename ) or die("Could not open file $filename");
while ( $name = <FILE> ) {
chomp($name);
$slice = $slice_adaptor->fetch_by_name($name);
# do something with slice
}

Description

This module is responsible for fetching Slices representing genomic
regions from a database.  A Details on how slices can be used are in the
Bio::EnsEMBL::Slice module.

Definition at line 78 of file SliceAdaptor.pm.

Member Function Documentation

◆ _build_circular_slice_cache()

protected Bio::EnsEMBL::DBSQL::SliceAdaptor::_build_circular_slice_cache ( )

Undocumented method

Code:
click to view

◆ _build_exception_cache()

protected Bio::EnsEMBL::DBSQL::SliceAdaptor::_build_exception_cache ( )

Undocumented method

Code:
click to view

◆ _create_chromosome_alias()

protected Bio::EnsEMBL::CoordSystem Bio::EnsEMBL::DBSQL::SliceAdaptor::_create_chromosome_alias ( )
  Args       : none
  Example    :
$self->create_chromosome_alias();
  Description: create chromosome alias in coordinate system with karyotype attributes
  Returntype : Bio::EnsEMBL::CoordSystem, or none 
  Exceptions : None
  Caller     : general
  Status     : in testing
 
Code:
click to view

◆ _fetch_by_fuzzy_matching()

protected String Bio::EnsEMBL::DBSQL::SliceAdaptor::_fetch_by_fuzzy_matching ( )
  Args       : $cs, $seq_region_name, $sql, $constraint, $bind_params
  Example    :
my $fuzzy_matched_name = $self->fetch_by_fuzzy_matching( $cs, $seq_region_name, $sql, $constraint, $bind_params );
  Description: fetches all the fuzzy matches for a given seq_region_name when requested
  Returntype : string, Bio::EnsEMBL::CoordSystem
  Exceptions : None
  Caller     : general
  Status     : (refactored from fetch_by_region)
 
Code:
click to view

◆ _fetch_by_seq_region_synonym()

protected Bio::EnsEMBL::SliceAdaptor Bio::EnsEMBL::DBSQL::SliceAdaptor::_fetch_by_seq_region_synonym ( )
  Args       : $cs, $seq_region_name, $start, $end, $strand, $version, $no_fuzz
  Example    :
$self->fetch_by_seq_region_synonym( $cs, $seq_region_name, $start, $end, $strand, $version, $no_fuzz );
  Description: fetches all the seq region synonyms (or uses wildcard) when requested
  Returntype : Bio::EnsEMBL::SliceAdaptor, or none 
  Exceptions : None
  Caller     : general
  Status     : (refactored from fetch_by_region)
 
Code:
click to view

◆ _filter_Slice_projections()

protected ArrayRef Bio::EnsEMBL::DBSQL::SliceAdaptor::_filter_Slice_projections ( )
    Arg [1]     : Bio::EnsEMBL::Slice The slice the projections were made from
    Arg [2]     : Array The projections which were fetched from the previous slice
    Description : Removes any projections which occur within the same sequence 
                  region as the given Slice object
    Returntype  : ArrayRef Bio::EnsEMBL::ProjectionSegment; Returns an array
                  of projected segments
 
Code:
click to view

◆ cache_toplevel_seq_mappings()

public void Bio::EnsEMBL::DBSQL::SliceAdaptor::cache_toplevel_seq_mappings ( )
  Args       : none
  Example    :
$slice_adaptor->cache_toplevel_seq_mappings();
  Description: caches all the assembly mappings needed for genes
  Returntype : None
  Exceptions : None
  Caller     : general
  Status     : At Risk
             : New experimental code
 
Code:
click to view

◆ fetch_all()

public Listref Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_all ( )
  Arg [1]    : string $coord_system_name
               The name of the coordinate system to retrieve slices of.
               This may be a name of an acutal coordinate system or an alias
               to a coordinate system.  Valid aliases are 'seqlevel' or
               'toplevel'.
  Arg [2]    : string $coord_system_version (optional)
               The version of the coordinate system to retrieve slices of
  Arg [3]    : bool $include_non_reference (optional)
               If this argument is not provided then only reference slices
               will be returned. If set, both reference and non reference
               slices will be returned.
  Arg [4]    : int $include_duplicates (optional)
               If set duplicate regions will be returned.
               NOTE: if you do not use this option and you have a PAR
               (pseudo-autosomal region) at the beginning of your seq_region
               then your slice will not start at position 1, so coordinates
               retrieved from this slice might not be what you expected.
  Arg[5]     : bool $include_lrg (optional)  (default 0)
               If set lrg regions will be returned aswell.
  Example    :
@chromos = @{$slice_adaptor->fetch_all('chromosome','NCBI33')};
@contigs = @{$slice_adaptor->fetch_all('contig')};
@section autotoc_md9 get even non-reference regions
@slices = @{$slice_adaptor->fetch_all('toplevel',undef,1)};
@section autotoc_md10 include duplicate regions (such as pseudo autosomal regions)
@slices = @{$slice_adaptor->fetch_all('toplevel', undef,0,1)};
  Description: Retrieves slices of all seq_regions for a given coordinate
               system.  This is analagous to the methods fetch_all which were
               formerly on the ChromosomeAdaptor, RawContigAdaptor and
               CloneAdaptor classes.  Slices fetched span the entire
               seq_regions and are on the forward strand.
               If the coordinate system with the provided name and version
               does not exist an empty list is returned.
               If the coordinate system name provided is 'toplevel', all
               non-redundant toplevel slices are returned (note that any
               coord_system_version argument is ignored in that case).
               Retrieved slices can be broken into smaller slices using the
               Bio::EnsEMBL::Utils::Slice module.
  Returntype : listref of Bio::EnsEMBL::Slices
  Exceptions : none
  Caller     : general
  Status     : Stable
 
Code:
click to view

◆ fetch_all_by_genome_component()

public Listref Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_all_by_genome_component ( )
  Arg [1]    : string $genome_component_name
               The name of the genome component to retrieve slices of.
  Example    :
@slices = @{$slice_adaptor->fetch_all_by_genome_component('A')};
  Description: Returns the list of all top level slices for a a given 
               genome component
  Returntype : listref of Bio::EnsEMBL::Slices
  Exceptions : If argument is not provided or is not a valid genome
               component
  Caller     : general
  Status     : Stable
 
Code:
click to view

◆ fetch_all_karyotype()

public Listref Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_all_karyotype ( )
  Example    :
my $top = $slice_adptor->fetch_all_karyotype()
  Description: returns the list of all slices which are part of the karyotype
  Returntype : listref of Bio::EnsEMBL::Slices
  Caller     : general
  Status     : At Risk
 
Code:
click to view

◆ fetch_assembly()

public Bio::EnsEMBL::Mapper Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_assembly ( )
  Arg [1]    : Bio::EnsEMBL::Slice $asm_slice
  Arg [2]    : Bio::EnsEMBL::Slice $cmp_slice
  Example    :
$asm = $slice_adaptor->fetch_assembly( $slice1, $slice2 );
  Description: Fetches from the assembly table based on the 
               coordinates of the two slices supplied. 
               Returns a mapper object mapping the two slices
               Do not call this method unless you really know what you are doing
  Returntype : Bio::EnsEMBL::Mapper
  Exceptions : throw if either slice has no coord system (cs).
               throw if there is no mapping path between coord systems
               throw if there are existing mappings between either slice
               and the oposite cs
  Caller     : Internal
  Status     : Experimental
 
Code:
click to view

◆ fetch_by_chr_band()

public Bio::EnsEMBL::Slice Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_chr_band ( )
 Title   : fetch_by_chr_band
 Usage   :
 Function: create a Slice representing a series of bands
 Example :
 Returns : Bio::EnsEMBL::Slice
 Args    : the band name
 Status     : Stable
 
Code:
click to view

◆ fetch_by_exon_stable_id()

public Bio::EnsEMBL::Slice Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_exon_stable_id ( )
  Arg [1]    : string $exonid
               The stable id of the exon around which the slice is 
               desired
  Arg [2]    : (optional) int $size
               The length of the flanking regions the slice should encompass 
               on either side of the exon (0 by default)
  Example    :
$slc = $sa->fetch_by_exon_stable_id('ENSE00000302930',10);
  Description: Creates a slice around the region of the specified exon. 
               If a context size is given, the slice is extended by that 
               number of basepairs on either side of the exon.
               The slice will be created in the exon's native coordinate system
               and in the forward orientation.
  Returntype : Bio::EnsEMBL::Slice
  Exceptions : Thrown if the exon is not in the database.
  Caller     : general
  Status     : Stable
 
Code:
click to view

◆ fetch_by_Feature()

public Bio::EnsEMBL::Slice Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_Feature ( )
  Arg [1]    : Bio::EnsEMBL::Feature $feat
               The feature to fetch the slice around
  Arg [2]    : int size (optional)
               The desired number of flanking basepairs around the feature.
               The size may also be provided as a percentage of the feature 
               size such as 200% or 80.5%.
  Example    :
$slice = $slice_adaptor->fetch_by_Feature($feat, 100);
  Description: Retrieves a slice around a specific feature.  All this really
               does is return a resized version of the slice that the feature
               is already on. Note that slices returned from this method
               are always on the forward strand of the seq_region regardless of
               the strandedness of the feature passed in.
  Returntype : Bio::EnsEMBL::Slice
  Exceptions : throw if the feature does not have an attached slice
               throw if feature argument is not provided
  Caller     : fetch_by_gene_stable_id, fetch_by_transcript_stable_id,
               fetch_by_gene_id, fetch_by_transcript_id
  Status     : Stable
 
Code:
click to view

◆ fetch_by_gene_stable_id()

public Bio::EnsEMBL::Slice Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_gene_stable_id ( )
  Arg [1]    : string $geneid
               The stable id of the gene around which the slice is
               desired
  Arg [2]    : (optional) int $size
               The length of the flanking regions the slice should encompass
               on either side of the gene (0 by default)
  Example    :
$slc = $sa->fetch_by_gene_stable_id('ENSG00000012123',10);
  Description: Creates a slice around the region of the specified gene.
               If a context size is given, the slice is extended by that
               number of basepairs on either side of the gene.
               The slice will be created in the gene's native coordinate system
               and in the forward orientation.
  Returntype : Bio::EnsEMBL::Slice
  Exceptions : throw on incorrect args
               throw if transcript does not exist
  Caller     : general
  Status     : Stable
 
Code:
click to view

◆ fetch_by_location()

public Bio::EnsEMBL::Slice Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_location ( )
  Arg [1]     : string $location
                Ensembl formatted location. Can be a format like 
                name:start-end, name:start..end, name:start:end, 
                name:start, name. We can also support strand 
                specification as a +/- or 1/-1.
                Location names must be separated by a :. All others can be
                separated by .., :, _ or -.
  Arg[2]      : String $coord_system_name
                The coordinate system to retrieve
  Arg[3]      : String $coord_system_version
                Optional parameter. Version of the coordinate system to fetch
  Arg[4]      : boolean $no_warnings
                Suppress warnings from this method
  Arg[5]      : boolean $no_fuzz
                Stop fuzzy matching of sequence regions from occuring
  Arg[6]      : boolean $ucsc
                If we are unsuccessful at retriving a location retry taking any 
                possible chr prefix into account e.g. chrX and X are treated as
                equivalents
  Example     :
my $slice = $sa->fetch_by_location('X:1-10000','chromosome')
                my $slice = $sa->fetch_by_location('X:1-10000:-1','toplevel')
  Description : Converts an Ensembl location/region into the sequence region
                name, start and end and passes them onto fetch_by_region(). 
                The code assumes that location formatting is not perfect and 
                will perform basic cleanup before parsing.
  Returntype  : Bio::EnsEMBL::Slice
  Exceptions  : If $location or coordinate system is false otherwise 
                see fetch_by_region()
  Caller      : General
  Status      : Beta
 
Code:
click to view

◆ fetch_by_misc_feature_attribute()

public Bio::EnsEMBL::Slice Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_misc_feature_attribute ( )
  Arg [1]    : string $attribute_type
               The code of the attribute type
  Arg [2]    : (optional) string $attribute_value
               The value of the attribute to fetch by
  Arg [3]    : (optional) int $size
               The amount of flanking region around the misc feature desired.
  Example    :
$slice = $sa->fetch_by_misc_feature_attribute('superctg',
'NT_030871');
$slice = $sa->fetch_by_misc_feature_attribute('synonym',
'AL00012311',
$flanking);
  Description: Fetches a slice around a MiscFeature with a particular
               attribute type and value. If no value is specified then
               the feature with the particular attribute is used.
               If no size is specified then 0 is used.
  Returntype : Bio::EnsEMBL::Slice
  Exceptions : Throw if no feature with the specified attribute type and value
               exists in the database
               Warning if multiple features with the specified attribute type
               and value exist in the database.
  Caller     : webcode
  Status     : Stable
 
Code:
click to view

◆ fetch_by_misc_feature_set()

public Bio::EnsEMBL::Slice Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_misc_feature_set ( )
  Arg [1]    : string $attribute_type
               The code of the attribute type
  Arg [2]    : (optional) string $attribute_value
               The value of the attribute to fetch by
  Arg [3]    : (optional) the name of the set
  Arg [4]    : (optional) int $size
               The amount of flanking region around the misc feature desired.
  Example    :
$slice = $sa->fetch_by_misc_feature_set('clone',
'RP11-411G9'
'tilepath');
  Description: Fetches a slice around a MiscFeature with a particular
               attribute type, value and set. If no value is specified then
               the feature with the particular attribute is used.
               A size can be specified to include flanking region
               If no size is specified then 0 is used.
  Returntype : Bio::EnsEMBL::Slice
  Exceptions : Throw if no feature with the specified attribute type, value and set
               exists in the database
               Warning if multiple features with the specified attribute type, set
               and value exist in the database.
  Caller     : webcode
  Status     : Stable
 
Code:
click to view

◆ fetch_by_name()

public Bio::EnsEMBL::Slice Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_name ( )
  Arg [1]    : string $name
  Example    :
$name = 'chromosome:NCBI34:X:1000000:2000000:1';
$slice = $slice_adaptor->fetch_by_name($name);
$slice2 = $slice_adaptor->fetch_by_name($slice3->name());
  Description: Fetches a slice using a slice name (i.e. the value returned by
               the Slice::name method).  This is useful if you wish to 
               store a unique identifier for a slice in a file or database or
               pass a slice over a network.
               Slice::name allows you to serialise/marshall a slice and this
               method allows you to deserialise/unmarshal it.
               Returns undef if no seq_region with the provided name exists in
               the database.
  Returntype : Bio::EnsEMBL::Slice or undef
  Exceptions : throw if incorrent arg provided
  Caller     : Pipeline
  Status     : Stable
 
Code:
click to view

◆ fetch_by_region()

public Bio::EnsEMBL::Slice Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_region ( )
  Arg [1]    : string $coord_system_name (optional)
               The name of the coordinate system of the slice to be created
               This may be a name of an actual coordinate system or an alias
               to a coordinate system.  Valid aliases are 'seqlevel' or
               'toplevel'.
  Arg [2]    : string $seq_region_name
               The name of the sequence region that the slice will be
               created on.
  Arg [3]    : int $start (optional, default = 1)
               The start of the slice on the sequence region
  Arg [4]    : int $end (optional, default = seq_region length)
               The end of the slice on the sequence region
  Arg [5]    : int $strand (optional, default = 1)
               The orientation of the slice on the sequence region
  Arg [6]    : string $version (optional, default = default version)
               The version of the coordinate system to use (e.g. NCBI33)
  Arg [7]    : boolean $no_fuzz (optional, default = undef (false))
               If true (non-zero), do not use "fuzzy matching" (see below).
  Example    :
$slice = $slice_adaptor->fetch_by_region('chromosome', 'X');
$slice = $slice_adaptor->fetch_by_region('clone', 'AC008066.4');
  Description: Retrieves a slice on the requested region.  At a minimum the
               name the name of the seq_region to fetch must be provided.
               If no coordinate system name is provided than a slice on the
               highest ranked coordinate system with a matching
               seq_region_name will be returned.  If a version but no
               coordinate system name is provided, the same behaviour will
               apply, but only coordinate systems of the appropriate version
               are considered.  The same applies if the 'toplevel' coordinate
               system is specified, however in this case the version is
               ignored.  The coordinate system should always be specified if
               it is known, since this is unambiguous and faster.
               Some fuzzy matching is performed if no exact match for
               the provided name is found.  This allows clones to be
               fetched even when their version is not known.  For
               example fetch_by_region('clone', 'AC008066') will
               retrieve the sequence_region with name 'AC008066.4'.
               The fuzzy matching can be turned off by setting the
               $no_fuzz argument to a true value.
               If the requested seq_region is not found in the database undef
               is returned.
  Returntype : Bio::EnsEMBL::Slice or undef
  Exceptions : throw if no seq_region_name is provided
               throw if invalid coord_system_name is provided
               throw if start > end is provided
  Caller     : general
  Status     : Stable
 
Code:
click to view

◆ fetch_by_region_unique()

public Listref Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_region_unique ( )
  Arg [1]    : string $coord_system_name (optional)
               The name of the coordinate system of the slice to be created
               This may be a name of an actual coordinate system or an alias
               to a coordinate system.  Valid aliases are 'seqlevel' or
               'toplevel'.
  Arg [2]    : string $seq_region_name
               The name of the sequence region that the slice will be
               created on.
  Arg [3]    : int $start (optional, default = 1)
               The start of the slice on the sequence region
  Arg [4]    : int $end (optional, default = seq_region length)
               The end of the slice on the sequence region
  Arg [5]    : int $strand (optional, default = 1)
               The orientation of the slice on the sequence region
  Arg [6]    : string $version (optional, default = default version)
               The version of the coordinate system to use (e.g. NCBI33)
  Arg [7]    : boolean $no_fuzz (optional, default = undef (false))
               If true (non-zero), do not use "fuzzy matching" (see below).
  Example    :
$slice = $slice_adaptor->fetch_by_region_unique('chromosome', 'HSCHR6_MHC_COX');
  Description: Retrieves a slice on the requested region but returns only the unique
               parts of the slice.  At a minimum the
               name the name of the seq_region to fetch must be provided.
               If no coordinate system name is provided than a slice on the
               highest ranked coordinate system with a matching
               seq_region_name will be returned.  If a version but no
               coordinate system name is provided, the same behaviour will
               apply, but only coordinate systems of the appropriate version
               are considered.  The same applies if the 'toplevel' coordinate
               system is specified, however in this case the version is
               ignored.  The coordinate system should always be specified if
               it is known, since this is unambiguous and faster.
               Some fuzzy matching is performed if no exact match for
               the provided name is found.  This allows clones to be
               fetched even when their version is not known.  For
               example fetch_by_region('clone', 'AC008066') will
               retrieve the sequence_region with name 'AC008066.4'.
               The fuzzy matching can be turned off by setting the
               $no_fuzz argument to a true value.
               If the requested seq_region is not found in the database undef
               is returned.
  Returntype : listref Bio::EnsEMBL::Slice
  Exceptions : throw if no seq_region_name is provided
               throw if invalid coord_system_name is provided
               throw if start > end is provided
  Caller     : general
  Status     : Stable
 
Code:
click to view

◆ fetch_by_seq_region_id()

public Bio::EnsEMBL::Slice Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_seq_region_id ( )
  Arg [1]    : string $seq_region_id
               The internal identifier of the seq_region to create this slice
               on
  Arg [2]    : optional start
  Arg [3]    : optional end
  Arg [4]    : optional strand
  Example    :
$slice = $slice_adaptor->fetch_by_seq_region_id(34413);
  Description: Creates a slice object of an entire seq_region using the
               seq_region internal identifier to resolve the seq_region.
               Returns undef if no such slice exists.
  Returntype : Bio::EnsEMBL::Slice or undef
  Exceptions : none
  Caller     : general
  Status     : Stable
 
Code:
click to view

◆ fetch_by_toplevel_location()

public Bio::EnsEMBL::Slice Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_toplevel_location ( )
  Arg [1]     : string $location
                Ensembl formatted location. Can be a format like 
                name:start-end, name:start..end, name:start:end, 
                name:start, name. We can also support strand 
                specification as a +/- or 1/-1.
                Location names must be separated by a :. All others can be
                separated by .., : or -.
  Arg[2]      : boolean $no_warnings
                Suppress warnings from this method
  Arg[3]      : boolean $no_fuzz
                Stop fuzzy matching of sequence regions from occuring
  Arg[4]      : boolean $ucsc
                If we are unsuccessful at retriving a location retry taking any 
                possible chr prefix into account e.g. chrX and X are treated as
                equivalents
  Example     :
my $slice = $sa->fetch_by_toplevel_location('X:1-10000')
                my $slice = $sa->fetch_by_toplevel_location('X:1-10000:-1')
  Description : Converts an Ensembl location/region into the sequence region
                name, start and end and passes them onto fetch_by_region(). 
                The code assumes that the required slice is on the top level
                coordinate system. The code assumes that location formatting
                is not perfect and will perform basic cleanup before parsing.
  Returntype  : Bio::EnsEMBL::Slice
  Exceptions  : If $location is false otherwise see fetch_by_location()
                or fetch_by_region()
  Caller      : General
  Status      : Beta
 
Code:
click to view

◆ fetch_by_transcript_id()

public Bio::EnsEMBL::Slice Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_transcript_id ( )
  Arg [1]    : int $transcriptid
               The unique database identifier of the transcript around which 
               the slice is desired
  Arg [2]    : (optional) int $size
               The length of the flanking regions the slice should encompass 
               on either side of the transcript (0 by default)
  Example    :
$slc = $sa->fetch_by_transcript_id(24, 1000);
  Description: Creates a slice around the region of the specified transcript.
               If a context size is given, the slice is extended by that
               number of basepairs on either side of the
               transcript.
               The slice will be created in the transcript's native coordinate
               system and in the forward orientation.
  Returntype : Bio::EnsEMBL::Slice
  Exceptions : throw on incorrect args
               throw if transcript is not in database
  Caller     : general
  Status     : Stable
 
Code:
click to view

◆ fetch_by_transcript_stable_id()

public Bio::EnsEMBL::Slice Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_transcript_stable_id ( )
  Arg [1]    : string $transcriptid
               The stable id of the transcript around which the slice is 
               desired
  Arg [2]    : (optional) int $size
               The length of the flanking regions the slice should encompass 
               on either side of the transcript (0 by default)
  Example    :
$slc = $sa->fetch_by_transcript_stable_id('ENST00000302930',10);
  Description: Creates a slice around the region of the specified transcript. 
               If a context size is given, the slice is extended by that 
               number of basepairs on either side of the
               transcript.
               The slice will be created in the transcript's native coordinate
               system and in the forward orientation.
  Returntype : Bio::EnsEMBL::Slice
  Exceptions : Thrown if the transcript is not in the database.
  Caller     : general
  Status     : Stable
 
Code:
click to view

◆ fetch_normalized_slice_projection()

public Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_normalized_slice_projection ( )
  Arg [1]    : Bio::EnsEMBL::Slice $slice
  Arg [2]    : boolean $filter_projections 
               Optionally filter the projections to remove anything 
               which is the same sequence region as the given slice
  Example    :
( optional )
  Description: gives back a project style result. The returned slices 
               represent the areas to which there are symlinks for the 
               given slice. start, end show which area on given slice is 
               symlinked
  Returntype : [[start,end,$slice][]]
  Exceptions : none
  Caller     : BaseFeatureAdaptor
  Status     : Stable
 
Code:
click to view

◆ get_genome_component_for_slice()

public Scalar Bio::EnsEMBL::DBSQL::SliceAdaptor::get_genome_component_for_slice ( )
  Arg [1]    : An object of type Bio::EnsEMBL::Slice
  Example    :
my $component = $slice->get_genome_component();
  Description: Returns the genome component of a slice
  Returntype : Scalar; the identifier of the genome component of the slice
  Exceptions : none
  Caller     : general
  Status     : Stable
 
Code:
click to view

◆ get_karyotype_rank()

public Int Bio::EnsEMBL::DBSQL::SliceAdaptor::get_karyotype_rank ( )
  Arg        : int seq_region_id 
  Example    :
my $rank = $slice_adptor->get_karyotype_rank($seq_region_id)
  Description: Returns the rank of a slice if it is part of the karyotype else 0
  Returntype : int
  Caller     : Slice method get_karyotype_rank
  Status     : At Risk
 
Code:
click to view

◆ get_seq_region_id()

public Int Bio::EnsEMBL::DBSQL::SliceAdaptor::get_seq_region_id ( )
  Arg [1]    : Bio::EnsEMBL::Slice $slice
               The slice to fetch a seq_region_id for
  Example    :
$srid = $slice_adaptor->get_seq_region_id($slice);
  Description: Retrieves the seq_region id (in this database) given a slice
               Seq region ids are not stored on the slices themselves
               because they are intended to be somewhat database independant
               and seq_region_ids vary accross databases.
  Returntype : int
  Exceptions : throw if the seq_region of the slice is not in the db
               throw if incorrect arg provided
  Caller     : BaseFeatureAdaptor
  Status     : Stable
 
Code:
click to view

◆ has_karyotype()

public Int Bio::EnsEMBL::DBSQL::SliceAdaptor::has_karyotype ( )
  Arg        : int seq_region_id 
  Example    :
my $karyotype = $slice_adptor->has_karyotype($seq_region_id)
  Description: Returns 1 if slice is a part of a karyotype else 0
  Returntype : int
  Caller     : Slice method has_karyotype
  Status     : At Risk
 
Code:
click to view

◆ is_circular()

public Boolean Bio::EnsEMBL::DBSQL::SliceAdaptor::is_circular ( )
  Arg[1]      : int seq_region_id
  Example     :
my $circular = $slice_adptor->is_circular($seq_region_id);
  Description : Indicates if the sequence region was circular or not
  Returntype  : Boolean
 
Code:
click to view

◆ is_reference()

public Int Bio::EnsEMBL::DBSQL::SliceAdaptor::is_reference ( )
  Arg        : int seq_region_id 
  Example    :
my $reference = $slice_adptor->is_reference($seq_region_id)
  Description: Returns 1 if slice is a reference slice else 0
  Returntype : int
  Caller     : Slice method is_reference
  Status     : At Risk
 
Code:
click to view

◆ is_toplevel()

public Int Bio::EnsEMBL::DBSQL::SliceAdaptor::is_toplevel ( )
  Arg        : int seq_region_id 
  Example    :
my $top = $slice_adptor->is_toplevel($seq_region_id)
  Description: Returns 1 if slice is a toplevel slice else 0
  Returntype : int
  Caller     : Slice method is_toplevel
  Status     : At Risk
 
Code:
click to view

◆ new()

public Bio::EnsEMBL::DBSQL::SliceAdaptor::new ( )

Undocumented method

Code:
click to view

◆ parse_location_to_values()

public List Bio::EnsEMBL::DBSQL::SliceAdaptor::parse_location_to_values ( )
  Arg [1]     : string $location
                Ensembl formatted location. Can be a format like 
                name:start-end, name:start..end, name:start:end, 
                name:start, name. We can also support strand 
                specification as a +/- or 1/-1.
                Location names must be separated by a :. All others can be
                separated by .., : _, or -.
                If the start is negative, start will be reset to 1 (e.g.: 1: -10-1,000')
                If both start and end are negative, returns undef (e.g.: 1: -10--1,000')
  Arg[2]      : boolean $no_warnings
                Suppress warnings from this method
  Arg[3]      : boolean $no_errors
                Supress errors being thrown from this method
  Example           :
my ($name, $start, $end, $strand) = $sa->parse_location_to_values('X:1..100:1);
  Description : Takes in an Ensembl location String and returns the parsed
                values
  Returntype    : List. Contains name, start, end and strand
 
Code:
click to view

◆ prepare()

public DBD::sth Bio::EnsEMBL::DBSQL::SliceAdaptor::prepare ( )
  Arg [1]    : String $sql
  Example    :
( optional )
  Description: overrides the default adaptor prepare method.
               All slice sql will usually use the dna_db.
  Returntype : DBD::sth 
  Exceptions : none
  Caller     : internal, convenience method
  Status     : Stable
 
Code:
click to view

◆ remove()

public void Bio::EnsEMBL::DBSQL::SliceAdaptor::remove ( )
  Arg [1]    : Bio::EnsEMBL::Slice $slice
               The slice to remove from the database
  Example    :
$slice_adaptor->remove($slice);
  Description: Removes a slice completely from the database.
               All associated seq_region_attrib are removed as well.
               If dna is attached to the slice, it is also removed.
  Returntype : none
  Exceptions : throw if slice has no coord system.
               throw if slice argument is not passed
               warning if slice is not stored in this database
  Caller     : general
  Status     : Stable
 
Code:
click to view

◆ remove_assembly()

public void Bio::EnsEMBL::DBSQL::SliceAdaptor::remove_assembly ( )
  Arg [1]    : Bio::EnsEMBL::Slice $asm_slice or $cmp_slice
  Example    :
$slice_adaptor->remove_assembly( $slice );
  Description: Deletes from the assembly table 
               where asm or cmp corresponds to slice
               Do not call this method unless you really know what you are doing
  Returntype : none
  Exceptions : throw if slice has no coord system (cs).
               throw if no slice provided, or argument is not a slice
  Caller     : Internal
  Status     : Experimental
 
Code:
click to view

◆ store()

public Int Bio::EnsEMBL::DBSQL::SliceAdaptor::store ( )
  Arg [1]    : Bio::EnsEMBL::Slice $slice
  Arg [2]    : (optional) $seqref reference to a string
               The sequence associated with the slice to be stored.
  Example    :
$slice = Bio::EnsEMBL::Slice->new(...);
$seq_region_id = $slice_adaptor->store($slice, \$sequence);
  Description: This stores a slice as a sequence region in the database
               and returns the seq region id. The passed in slice must
               start at 1, and must have a valid seq_region name and coordinate
               system. The attached coordinate system must already be stored in
               the database.  The sequence region is assumed to start at 1 and
               to have a length equalling the length of the slice.  The end of
               the slice must equal the seq_region_length.
               If the slice coordinate system is the sequence level coordinate
               system then the seqref argument must also be passed.  If the
               slice coordinate system is NOT a sequence level coordinate
               system then the sequence argument cannot be passed.
  Returntype : int 
  Exceptions : throw if slice has no coord system.
               throw if slice coord system is not already stored.
               throw if slice coord system is seqlevel and no sequence is 
                     provided.
               throw if slice coord system is not seqlevel and sequence is
                     provided.
               throw if slice does not start at 1
               throw if sequence is provided and the sequence length does not
                     match the slice length.
               throw if the SQL insert fails (e.g. on duplicate seq region)
               throw if slice argument is not passed
               throw if the slice end is not equal to seq_region_length
  Caller     : database loading scripts
  Status     : Stable
 
Code:
click to view

◆ store_assembly()

public String Bio::EnsEMBL::DBSQL::SliceAdaptor::store_assembly ( )
  Arg [1]    : Bio::EnsEMBL::Slice $asm_slice
  Arg [2]    : Bio::EnsEMBL::Slice $cmp_slice
  Example    :
$asm = $slice_adaptor->store_assembly( $slice1, $slice2 );
  Description: Creates an entry in the assembly table based on the 
               coordinates of the two slices supplied. Returns a string 
               representation of the assembly that gets created.
  Returntype : string
  Exceptions : throw if either slice has no coord system (cs).
               throw unless the cs rank of the asm_slice is lower than the 
               cmp_slice.
               throw if there is no mapping path between coord systems
               throw if the lengths of each slice are not equal
               throw if there are existing mappings between either slice
               and the oposite cs
  Caller     : database loading scripts
  Status     : Experimental
 
Code:
click to view

◆ update()

public Bio::EnsEMBL::DBSQL::SliceAdaptor::update ( )

Undocumented method

Code:
click to view

The documentation for this class was generated from the following file:
Bio::EnsEMBL::CircularSlice
Definition: CircularSlice.pm:48
Bio::EnsEMBL::Registry::get_adaptor
public Adaptor get_adaptor()
Bio::EnsEMBL::DBSQL::SliceAdaptor::store
public Int store()
Bio::EnsEMBL::DBSQL::SliceAdaptor::get_genome_component_for_slice
public Scalar get_genome_component_for_slice()
Bio::EnsEMBL::DBSQL::SliceAdaptor::has_karyotype
public Int has_karyotype()
Bio::EnsEMBL::LRGSlice::new
public new()
Bio::EnsEMBL::DBSQL::SliceAdaptor::_fetch_by_seq_region_synonym
protected Bio::EnsEMBL::SliceAdaptor _fetch_by_seq_region_synonym()
map
public map()
Bio::EnsEMBL::Utils::Slice
Definition: Slice.pm:21
Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_name
public Bio::EnsEMBL::Slice fetch_by_name()
Bio::EnsEMBL::CircularSlice::new
public Bio::EnsEMBL::CircularSlice new()
Bio::EnsEMBL::DBSQL::BaseAdaptor::species_id
public Int species_id()
Bio::EnsEMBL::DBSQL::SliceAdaptor::is_circular
public Boolean is_circular()
Bio::EnsEMBL::DBSQL::SliceAdaptor::get_seq_region_id
public Int get_seq_region_id()
Bio::EnsEMBL::DBSQL::SliceAdaptor::get_karyotype_rank
public Int get_karyotype_rank()
Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_gene_stable_id
public Bio::EnsEMBL::Slice fetch_by_gene_stable_id()
Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_all
public Listref fetch_all()
Bio::EnsEMBL::DBSQL::SliceAdaptor::remove_assembly
public void remove_assembly()
Bio::EnsEMBL::Slice::slice
public slice()
Bio::EnsEMBL::DBSQL::SliceAdaptor::is_reference
public Int is_reference()
Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_toplevel_location
public Bio::EnsEMBL::Slice fetch_by_toplevel_location()
Bio::EnsEMBL::DBSQL::SliceAdaptor::store_assembly
public String store_assembly()
Bio::EnsEMBL::DBSQL::SliceAdaptor::_fetch_by_fuzzy_matching
protected String _fetch_by_fuzzy_matching()
Bio::EnsEMBL::DBSQL::SliceAdaptor::update
public update()
Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_misc_feature_attribute
public Bio::EnsEMBL::Slice fetch_by_misc_feature_attribute()
Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_all_karyotype
public Listref fetch_all_karyotype()
Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_region_unique
public Listref fetch_by_region_unique()
Bio::EnsEMBL::DBSQL::SliceAdaptor::cache_toplevel_seq_mappings
public void cache_toplevel_seq_mappings()
Bio::EnsEMBL::DBSQL::SliceAdaptor::remove
public void remove()
Bio::EnsEMBL::Slice
Definition: Slice.pm:50
Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_transcript_id
public Bio::EnsEMBL::Slice fetch_by_transcript_id()
Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_normalized_slice_projection
public fetch_normalized_slice_projection()
Bio::EnsEMBL::CoordSystem::alias_to
public Bio::EnsEMBL::CoordSystem alias_to()
Bio::EnsEMBL::Registry
Definition: Registry.pm:113
Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_chr_band
public Bio::EnsEMBL::Slice fetch_by_chr_band()
Bio::EnsEMBL::DBSQL::SliceAdaptor::parse_location_to_values
public List parse_location_to_values()
Bio::EnsEMBL::Slice::new
public Bio::EnsEMBL::Slice new()
Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_exon_stable_id
public Bio::EnsEMBL::Slice fetch_by_exon_stable_id()
Bio::EnsEMBL::DBSQL::SliceAdaptor::prepare
public DBD::sth prepare()
Bio::EnsEMBL::Slice::seq_region_name
public String seq_region_name()
Bio::EnsEMBL::Slice::seq_region_length
public Int seq_region_length()
Bio::EnsEMBL::DBSQL::SliceAdaptor::_build_exception_cache
protected _build_exception_cache()
Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_region
public Bio::EnsEMBL::Slice fetch_by_region()
Bio::EnsEMBL::LRGSlice
Definition: LRGSlice.pm:37
Bio::EnsEMBL::Slice::get_seq_region_id
public Int get_seq_region_id()
Bio::EnsEMBL::Slice::new_fast
public Bio::EnsEMBL::Slice new_fast()
Bio::EnsEMBL::DBSQL::SliceAdaptor::_create_chromosome_alias
protected Bio::EnsEMBL::CoordSystem _create_chromosome_alias()
Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_seq_region_id
public Bio::EnsEMBL::Slice fetch_by_seq_region_id()
Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_location
public Bio::EnsEMBL::Slice fetch_by_location()
Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_misc_feature_set
public Bio::EnsEMBL::Slice fetch_by_misc_feature_set()
Bio::EnsEMBL::Registry::load_registry_from_db
public Int load_registry_from_db()
Bio::EnsEMBL::DBSQL::SliceAdaptor::_filter_Slice_projections
protected ArrayRef _filter_Slice_projections()
Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_Feature
public Bio::EnsEMBL::Slice fetch_by_Feature()
Bio::EnsEMBL::DBSQL::SliceAdaptor::is_toplevel
public Int is_toplevel()
Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_assembly
public Bio::EnsEMBL::Mapper fetch_assembly()
Bio::EnsEMBL::DBSQL::SliceAdaptor::_build_circular_slice_cache
protected _build_circular_slice_cache()
Bio::EnsEMBL::Slice::strand
public Int strand()
Bio::EnsEMBL::Mapper
Definition: Coordinate.pm:3
Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_all_by_genome_component
public Listref fetch_all_by_genome_component()
Bio::EnsEMBL::DBSQL::SliceAdaptor::fetch_by_transcript_stable_id
public Bio::EnsEMBL::Slice fetch_by_transcript_stable_id()