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
34 coverage etc. in a given region.
41 -analysis => $analysis,
42 -blocksize => 1000000,
48 A density type represents a density, or percentage coverage etc. in a
58 package Bio::EnsEMBL::DensityType;
70 Arg [..] : Takes a set of named arguments
71 Example : $dt =
new Bio::EnsEMBL::DensityType::DensityType(
72 -analysis => $analysis,
76 Description: Creates a
new Density Type
object
78 Exceptions : blocksize > 0,
79 valuetype must be
'sum' or
'ratio',
80 valid analysis
object must be passed
90 my $self = $class->SUPER::new(@_);
92 my ($analysis, $block_size, $value_type, $region_features) =
93 rearrange([
'ANALYSIS',
'BLOCK_SIZE',
'VALUE_TYPE',
'REGION_FEATURES'],@_);
96 if(!ref($analysis) || !$analysis->isa(
'Bio::EnsEMBL::Analysis')) {
97 throw(
'-ANALYSIS argument must be a Bio::EnsEMBL::Analysis not '.
102 if($value_type ne
"sum" and $value_type ne
"ratio"){
103 throw(
'-VALUE_TYPE argument must be "ratio" or "sum" not *'.
108 $region_features ||= 0;
110 if($block_size && $region_features){
111 throw(
'Set either -BLOCK_SIZE or -REGION_FEATURES, not both');
114 if( $block_size <0 or $region_features < 0 ) {
115 throw(
'No negative values for -BLOCK_SIZE or -REGION_FEATURES' );
119 $self->{
'analysis'} = $analysis;
120 $self->{
'block_size'} = $block_size;
121 $self->{
'value_type'} = $value_type;
122 $self->{
'region_features'} = $region_features;
130 Description: get/set
for attribute analysis
143 if(defined($a) && (!ref($a) || !$a->isa(
'Bio::EnsEMBL::Analysis'))) {
144 throw(
"Argument must be undef or a Bio::EnsEMBL::Analysis object.");
146 $self->{
'analysis'} = $a;
148 return $self->{
'analysis'};
153 Arg [1] :
string $value_type
154 Description: gettter/setter
for the type
164 $self->{
'value_type'} = shift
if(@_);
165 return $self->{
'value_type'};
172 Description: getter/setter
for attribute block_size
182 $self->{
'block_size'} = shift
if(@_);
183 return $self->{
'block_size'};
187 =head2 region_features
189 Arg [1] :
int $region_features
190 Example : The number of features per seq_region inside
this density_type..
191 Description: get/set
for attribute region_features
198 sub region_features {
200 $self->{
'region_features'} = shift
if( @_ );
201 return $self->{
'region_features'};