3 See the NOTICE file distributed with
this work
for additional information
4 regarding copyright ownership.
6 Licensed under the Apache License, Version 2.0 (the
"License");
7 you may not use
this file except in compliance with the License.
8 You may obtain a copy of the License at
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an
"AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License
for the specific language governing permissions and
16 limitations under the License.
23 Please email comments or questions to the
public Ensembl
24 developers list at <http:
26 Questions may also be sent to the Ensembl help desk at
33 Bio::EnsEMBL::DBSQL::KaryotypeBand
39 # Create and populate a karyotype band (normally done by adaptor)
40 $kb = Bio::EnsEMBL::KaryotyeBand(
43 -SLICE => $chrX_slice,
46 -ADAPTOR => $db->get_KaryotypeBandAdaptor(),
50 # Can tranform this band into other coord systems, just like other
52 $kb = $kb->transform(
'supercontig');
54 $start = $kb->start();
56 $seq_region = $kb->slice->seq_region_name();
58 # Karyotypes have internal ids as well
59 $kary_id = $kb->dbID();
64 single karyotype band. Access these objects through a
68 as any other feature can be.
74 package Bio::EnsEMBL::KaryotypeBand;
85 use constant SEQUENCE_ONTOLOGY => {
87 term =>
'chromosome_band',
92 Arg [NAME] : string (optional)
94 Arg [STAIN]: string (optional)
95 The stain of
this band
96 Arg [...] : Arguments passed to superclass constructor.
103 Description: Constructor. Creates a
new KaryotypeBand object, which can be
104 treated as any other feature
object. Note that karyotypes
105 bands always have strand = 0.
106 Returntype : Bio::EnsEMBL::KarytotypeBand
108 Caller : Bio::EnsEMBL::KaryotypeBandAdaptor
116 my $self = $class->SUPER::new(@_);
118 my ($name, $stain) = rearrange([
'NAME',
'STAIN'],@_);
119 $self->{
'name'} = $name;
120 $self->{
'stain'} = $stain;
121 $self->{
'strand'} = 0;
129 Arg [1] : (optional)
string $value
130 Example : my $band_name = $band->name();
131 Description: Getter/Setter
for the name of
this band
141 $self->{
'name'} = shift
if(@_);
142 return $self->{
'name'};
149 Arg [1] : (optional)
string $value
150 Example : my $band_stain = $band->stain();
151 Description: get/set
for the band stain (e.g.
'gpos50')
161 $self->{
'stain'} = shift
if(@_);
162 return $self->{
'stain'};
170 Example : $strand = $karyotype_feat->strand();
171 Description: Overrides the Feature strand method to always
return a
172 value of 0
for karyotype features (they are unstranded features)
173 Returntype : int (always 0)
188 Arg [1] : $start - The
new end of
this band
189 Arg [2] : $end - The
new start of
this band
190 Arg [3] : $strand - ignored always set to 0
191 Example : $kb->move(1, 10_000);
192 Description: Overrides superclass move() method to ensure strand is always 0.
202 my ($self, $start, $end, $strand) = @_;
204 #maintain a strandedness of 0
205 return $self->SUPER::move($start,$end,0);
212 Example : print $kb->display_id();
213 Description: This method returns a
string that is considered to be
214 the
'display' identifier. For karyotype bands
this is the
215 name of the karyotype band or
'' if no name is defined.
218 Caller : web drawing code
225 return $self->{
'name'} ||
'';
229 =head2 summary_as_hash
231 Example : $karyotype_band_summary = $band->summary_as_hash();
232 Description : Extends Feature::summary_as_hash
233 Retrieves a summary of
this Karyotype
object.
235 Returns : hashref of arrays of descriptive strings
236 Status : Intended
for internal use
239 sub summary_as_hash {
241 my $summary_ref = $self->SUPER::summary_as_hash;
242 $summary_ref->{
'stain'} = $self->stain;