Bio::EnsEMBL::Funcgen
Array
Toolbar
Summary
Bio::EnsEMBL::Funcgen::Array - A module to represent a nucleotide microarray.
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
use Bio::EnsEMBL::Funcgen::Array;
my $array = Bio::EnsEMBL::Funcgen::Array->new(
-NAME => 'Array-1',
-FORMAT => 'Tiled',
-SIZE => '1',
-VENDOR => 'Nimblegen',
-DESCRIPTION => $desc,
-TYPE => 'OLIGO',
-CLASS => 'VENDOR_FORMAT'
);
my $db_adaptor = Bio::EnsEMBL::Funcgen::DBSQL::DBAdaptor->new(...);
my $array_adaptor = $db_adaptor->get_ArrayAdaptor();
my $array = $array_adaptor->fetch_by_name($array_name)
Description
An Array object represents a nucleotide (OLIGO, PCR etc.) microarray. The data
(currently the name, format, size, species, vendor and description) are stored
in the array table.
Methods
Methods description
Arg [1] : mandatory - Bio::EnsEMBL::Funcgen::ArrayChip Example : $array->add_ArrayChip($array_chip); Description: Setter for array chips Returntype : None Exceptions : Throws if arg not a Bio::EnsEMBL::Funcgen::ArrayChip, or Array not stored Caller : General Status : Ar risk |
Arg [1] : (optional) string - the class of the array Example : my $class = $array->class('AFFY_UTR'); Description: Getter, setter of class attribute for Array objects e.g. AFFY_UTR, AFFY_ST Returntype : string Exceptions : None Caller : General Status : Medium Risk |
Arg [1] : (optional) string - the description of the array Example : my $size = $array->description(); Description: Getter, setter of description attribute for Array objects. Returntype : string Exceptions : None Caller : General Status : Medium Risk |
Arg [1] : (optional) string - the format of the array Example : my $format = $array->format(); Description: Getter, setter of format attribute for Array objects e.g. Tiled, Targetted etc... Returntype : string Exceptions : None Caller : General Status : Medium Risk |
Arg [1] : (mandatory) int - design_id Example : my %ac = %{$array->get_ArrayChip_by_design_id('1234')}; Description: Getter for array_chip hashes Returntype : Hashref Exceptions : Throws exception if no design_id defined, warns if not part of array Caller : General Status : At risk |
Example : my @achips = @{$array->get_ArrayChips()}; Description: Getter, setter and lazy loader of array_chip hashes Returntype : Arrays of ArrayChip objects Exceptions : Throws exception if none found for array_id Caller : General Status : High Risk - migrate to ArrayChip.pm |
Args : None Example : my $probesets = $array->get_all_ProbeSets(); Description: Returns all probesets on an array. Needs a database connection. Returntype : Listref of Bio::EnsEMBL::Funcgen::ProbeSets objects Exceptions : None Caller : General Status : Medium Risk |
Args : None Example : my $probes = $array->get_all_Probes(); Description: Returns all probes on an array. Needs a database connection. Returntype : Listref of Bio::EnsEMBL::Funcgen::Probe objects Exceptions : None Caller : General Status : Medium Risk |
Example : my @ac_ids = @{$array->get_array_chip_ids()}; Description: Returns all array_chip_ids for this array. Returntype : Listref of array_chip ids Exceptions : Throws if none retrieved Caller : General Status : At Risk |
Example : my @design_ids = @{$array->get_design_ids()}; Description: Returns a the design_ids for each array_chip contained within this array Returntype : list Exceptions : None Caller : General Status : Medium Risk |
Arg [1] : (optional) string - the name of this array Example : my $name = $array->name(); Description: Getter, setter of the name attribute for Array objects. Returntype : string Exceptions : None Caller : General Status : Medium Risk |
Arg [-NAME] : string - the name of this array Arg [-VENDOR] : string - the vendor of this array (AFFY, NIMBLEGEN etc) Arg [-TYPE] : string - type of array e.g. OLIGO, PCR Arg [-FORMAT] : string - the format of this array (TILED, TARGETTED, GENE etc) Arg [-DESCRIPTION] : strin - description of the array
#array_chips is array of hashes or design_id and name, dbID will be populated on store, this should be a simple object!
Example : my $array = Bio::EnsEMBL::Funcgen::Array->new( -NAME => 'Array-1', -FORMAT => 'Tiled', -SIZE => '1', -VENDOR => 'Nimblegen', -TYPE => 'OLIGO', -DESCRIPTION => $desc, -CLASS => 'VENDOR_FORMAT',#e.g. AFFY_UTR, ILLUMINA_WG ); Description: Creates a new Bio::EnsEMBL::Funcgen::Array object. Returntype : Bio::EnsEMBL::Funcgen::Array Exceptions : None ? should throw if mandatort params not set/valid Caller : General Status : At risk |
Arg [1] : (optional) int - the number of ? in the array Example : my $size = $array->size(); Description: Getter of size attribute for Array objects. This simply counts the constituent ArrayChips Returntype : int Exceptions : None Caller : General Status : Medium Risk |
Arg [1] : (optional) string - the type of this array Example : $array->type('OLIGO'); Description: Getter, setter of the type attribute for Array objects. Returntype : string Exceptions : None Caller : General Status : Medium Risk |
Arg [1] : (optional) string - the name of the array vendor Example : my $vendor = $array->vendor(); Description: Getter, setter of vendor attribute for Array objects. Returntype : string Exceptions : None Caller : General Status : Medium Risk |
Methods code
sub add_ArrayChip
{ my ($self, $array_chip) = @_;
throw("You must supply a stored Bio::EnsEMBL::Funcgen::ArrayChip") if(! ($array_chip &&
$array_chip->isa("Bio::EnsEMBL::Funcgen::ArrayChip") &&
$array_chip->dbID()));
if ($self->dbID() && $self->adaptor()){
$self->get_ArrayChips() if (! $self->{'array_chips'});
if(exists $self->{'array_chips'}{$array_chip->design_id}){
$array_chip = $self->{'array_chips'}{$array_chip->design_id};
}else{
$self->{'array_chips'}{$array_chip->design_id} = $array_chip;
}
}else{
throw("Array must be stored before adding an array_chip");
}
return;
}
1; } |
sub class
{ my $self = shift;
$self->{'class'} = shift if @_;
return $self->{'class'}; } |
sub description
{ my $self = shift;
$self->{'description'} = shift if @_;
return $self->{'description'}; } |
sub format
{ my $self = shift;
$self->{'format'} = shift if @_;
return $self->{'format'}; } |
sub get_ArrayChip_by_design_id
{ my ($self, $design_id) = @_;
my ($achip);
throw("Must supply a valid array chip design_id") if (! defined $design_id);
if(defined $self->{'array_chips'}{$design_id}){
$achip = $self->{'array_chips'}{$design_id};
}else{
}
return $achip; } |
sub get_ArrayChips
{ my $self = shift;
if ( ! exists $self->{'array_chips'}){
if( $self->dbID() && $self->adaptor() ) {
$self->{'array_chips'} = {};
foreach my $achip(@{$self->adaptor->db->get_ArrayChipAdaptor->fetch_all_by_array_id($self->dbID())}){
$self->{'array_chips'}{$achip->design_id} = $achip;
}
}
else{
throw("Need array dbID and DB connection to retrieve array_chips");
}
}
return [ values %{$self->{'array_chips'}} ]; } |
sub get_all_ProbeSets
{ my $self = shift;
if ( $self->dbID() && $self->adaptor() ) {
my $opsa = $self->adaptor()->db()->get_ProbeSetAdaptor();
my $probesets = $opsa->fetch_all_by_Array($self);
return $probesets;
} else {
warning('Need database connection to retrieve ProbeSets');
return [];
}
}
} |
sub get_all_Probes
{ my $self = shift;
if ( $self->dbID() && $self->adaptor() ) {
my $opa = $self->adaptor()->db()->get_ProbeAdaptor();
my $probes = $opa->fetch_all_by_Array($self);
return $probes;
} else {
warning('Need database connection to retrieve Probes');
return [];
}
}
} |
sub get_array_chip_ids
{ my $self = shift;
my @ac_ids;
$self->get_ArrayChips();
foreach my $achip(values %{$self->{'array_chips'}}){
push @ac_ids, $achip->dbID();
}
if(! @ac_ids){
throw("No array_chip_ids available"); }
return\@ ac_ids; } |
sub get_design_ids
{ my $self = shift;
return [keys %{$self->{'array_chips'}}]; } |
sub name
{ my $self = shift;
$self->{'name'} = shift if @_;
return $self->{'name'}; } |
sub new
{ my $caller = shift;
my $class = ref($caller) || $caller;
my $self = $class->SUPER::new(@_);
my ($name, $format, $size, $vendor, $type, $desc, $aclass)
= rearrange( ['NAME', 'FORMAT', 'SIZE', 'VENDOR', 'TYPE', 'DESCRIPTION', 'CLASS'], @_ );
my @stack = caller();
if($self->dbID() && $stack[0] ne "Bio::EnsEMBL::Funcgen::DBSQL::ArrayAdaptor"){
throw("You must use the ArrayAdaptor($stack[0]) to generate Arrays with a dbID i.e. from the DB, as this module accomodates updating which may cause incorrect data if the object is not generated form the DB");
}
throw("Must provide a vendor parameter") if ! $vendor;
throw("Must provide a name parameter") if ! $name;
$self->name($name);
$self->format($format) if defined $format;
if(defined $format && $format eq 'EXPRESSION' && ! defined $class){
throw('You must defined a class if you are importing and array with an EXPRESSION format');
}
$self->class(uc($aclass)) if defined $aclass;
$self->size($size) if defined $size;
$self->vendor($vendor);
$self->description($desc) if defined $desc;
$self->type($type) if defined $type;
return $self; } |
sub size
{ my $self = shift;
return scalar(keys %{$self->{'array_chips'}}); } |
sub type
{ my $self = shift;
$self->{'type'} = shift if @_;
return $self->{'type'}; } |
sub vendor
{ my $self = shift;
$self->{'vendor'} = shift if @_;
return $self->{'vendor'}; } |
General documentation
This module was created by Nathan Johnson, but is based on the
OligoArray module written by Ian Sealy.
This module is part of the Ensembl project:
/