Bio::EnsEMBL::DBSQL KaryotypeBandAdaptor
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::EnsEMBL::DBSQL::KaryotypeBandAdaptor
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor
Bio::EnsEMBL::KaryotypeBand
Bio::EnsEMBL::Utils::Exception qw ( throw warning deprecate )
Inherit
Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor
Synopsis
  $kary_adaptor = $db_adaptor->get_KaryotypeBandAdaptor();
foreach $band ( @{ $kary_adaptor->fetch_all_by_Slice($slice) } ) { # do something with band } $band = $kary_adaptor->fetch_by_dbID($id); my @bands = @{ $kary_adaptor->fetch_all_by_chr_name('X') }; my $band = $kary_adaptor->fetch_by_chr_band( '4', 'q23' );
Description
Database adaptor to provide access to KaryotypeBand objects
Methods
_columns
No description
Code
_objs_from_sth
No description
Code
_tables
No description
Code
fetch_all_by_chr_band
No description
Code
fetch_all_by_chr_nameDescriptionCode
fetch_by_chr_bandDescriptionCode
list_dbIDsDescriptionCode
Methods description
fetch_all_by_chr_namecode    nextTop
  Arg [1]    : string $chr_name
Name of the chromosome from which to retrieve band objects
Example : @bands=@{$karyotype_band_adaptor->fetch_all_by_chr_name('X')};
Description: Fetches all the karyotype band objects from the database for the
given chromosome.
Returntype : listref of Bio::EnsEMBL::KaryotypeBand in chromosomal
(assembly) coordinates
Exceptions : none
Caller : general
Status : Stable
fetch_by_chr_bandcodeprevnextTop
  Arg  [1]   : string $chr_name
Name of the chromosome from which to retrieve the band
Arg [2] : string $band
The name of the band to retrieve from the specified chromosome
Example : @bands = @{$kary_adaptor->fetch_all_by_chr_band('4', 'q23')};
Description: Fetches the karyotype band object from the database
for the given chromosome and band name. If no such band
exists, undef is returned instead. This function uses fuzzy
matching of the band name. For example the bands 'q23.1' and
'q23.4' could be matched by fetch_all_by_chr_band('20', 'q23');
Returntype : Bio::EnsEMBL::KaryotypeBand in chromosomal coordinates.
Exceptions : throws if chr or band is missing in arguments
Caller : general
Status : Stable
list_dbIDscodeprevnextTop
  Arg [1]    : none
Example : @kary_ids = @{$karyotype_band_adaptor->list_dbIDs()};
Description: Gets an array of internal ids for all karyotype bands in the
current db
Arg[1] : <optional> int. not 0 for the ids to be sorted by the seq_region.
Returntype : reference to a list of ints
Exceptions : none
Caller : ?
Status : Stable
Methods code
_columnsdescriptionprevnextTop
sub _columns {
  my $self = shift;

  #warning _objs_from_sth implementation depends on ordering
return qw ( k.karyotype_id k.seq_region_id k.seq_region_start k.seq_region_end k.band k.stain );
}
_objs_from_sthdescriptionprevnextTop
sub _objs_from_sth {
  my ($self, $sth) = @_;
  my $db = $self->db();
  my $slice_adaptor = $db->get_SliceAdaptor();

  my @features;
  my %slice_cache;

  my($karyotype_id,$seq_region_id,$seq_region_start,$seq_region_end,
     $band,$stain);

  $sth->bind_columns(\$karyotype_id,\$ seq_region_id,\$ seq_region_start,\$
                     seq_region_end,\$ band,\$ stain);

  while ( $sth->fetch() ) {
    #need to get the internal_seq_region, if present
$seq_region_id = $self->get_seq_region_id_internal($seq_region_id); my $slice = $slice_cache{$seq_region_id} ||= $slice_adaptor->fetch_by_seq_region_id($seq_region_id); push( @features, $self->_create_feature( 'Bio::EnsEMBL::KaryotypeBand', { -START => $seq_region_start, -END => $seq_region_end, -SLICE => $slice, -ADAPTOR => $self, -DBID => $karyotype_id, -NAME => $band, -STAIN => $stain } ) ); } return\@ features;
}
_tablesdescriptionprevnextTop
sub _tables {
  my $self = shift;

  return (['karyotype','k'])
}


#_columns
# Arg [1] : none
# Example : none
# Description: PROTECTED Implementation of abstract superclass method to
# provide the name of the columns to query
# Returntype : list of strings
# Exceptions : none
# Caller : internal
}
fetch_all_by_chr_banddescriptionprevnextTop
sub fetch_all_by_chr_band {
  my ($self, $chr_name, $band) = @_;

  throw('Chromosome name argument expected') if(!$chr_name);
  throw('Band argument expected') if(!$band);

  my $slice = $self->db->get_SliceAdaptor->fetch_by_region(undef,
                                                           $chr_name);

  my $constraint = "k.band like '$band%'";
  return $self->fetch_all_by_Slice_constraint($slice,$constraint);
}
fetch_all_by_chr_namedescriptionprevnextTop
sub fetch_all_by_chr_name {
    my ($self,$chr_name) = @_;
    
    throw('Chromosome name argument expected') if(!$chr_name);

    my $slice =
      $self->db->get_SliceAdaptor->fetch_by_region(undef, $chr_name);
    unless ($slice){
        warning("Cannot retrieve chromosome $chr_name");
        return;
    }
    return $self->fetch_all_by_Slice($slice);
}
fetch_by_chr_banddescriptionprevnextTop
sub fetch_by_chr_band {
  my $self = shift;
  deprecate('Use fetch_all_by_chr_band instead.');

  my ($band) = @{$self->fetch_all_by_chr_band(@_)};
  return $band;
}
list_dbIDsdescriptionprevnextTop
sub list_dbIDs {
  my ($self, $ordered) = shift;

  return $self->_list_dbIDs("karyotype",undef, $ordered);
}


1;
}
General documentation
LICENSETop
  Copyright (c) 1999-2009 The European Bioinformatics Institute and
Genome Research Limited. All rights reserved.
This software is distributed under a modified Apache license. For license details, please see /info/about/code_licence.html
CONTACTTop
  Please email comments or questions to the public Ensembl
developers list at <ensembl-dev@ebi.ac.uk>.
Questions may also be sent to the Ensembl help desk at <helpdesk@ensembl.org>.