Bio::EnsEMBL::Funcgen ExperimentalChip
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::EnsEMBL::Funcgen::ExperimentalChip - A module to represent a physical unique experimental chip.
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::Funcgen::Storable
Bio::EnsEMBL::Utils::Argument qw ( rearrange )
Bio::EnsEMBL::Utils::Exception qw ( throw warning )
Inherit
Bio::EnsEMBL::Funcgen::Storable
Synopsis
use Bio::EnsEMBL::Funcgen::ExperimentalChip;
my $ec = Bio::EnsEMBL::Funcgen::ExperimentalChip->new(
-dbID => $ec_id,
-unique_id => $c_uid,
-experiment_id => $exp_id,
-array_chip_id => $ac_id,
-feature_type => $ftpye,
-cell_type => $ctype,
-chip_set_id => 1,
);
Description
An ExperimentalChip object represent a physical array chip/slide used in an experiment. The data
(currently the unique_id, experiment_id, array_chip_id, and description) are stored
in the experimental_chip table.
Methods
add_ChannelDescriptionCode
array_chip_idDescriptionCode
biological_replicateDescriptionCode
cell_typeDescriptionCode
contains_ChannelDescriptionCode
experiment_idDescriptionCode
feature_typeDescriptionCode
get_ArrayChipDescriptionCode
get_Channel_by_dyeDescriptionCode
get_ChannelsDescriptionCode
get_ExperimentDescriptionCode
get_channel_idsDescriptionCode
newDescriptionCode
technical_replicateDescriptionCode
unique_idDescriptionCode
Methods description
add_Channelcode    nextTop
  Args       : Bio::EnsEMBL::Funcgen::Channel
Example : $exp_chip->add_channel($chan);
Description: Sets ad channel object for the ExperimentalChip
Returntype : Listref of Bio::EnsEMBL::Funcgen::Channel objects
Exceptions : warns if Channel already set
Caller : General
Status : At Risk
array_chip_idcodeprevnextTop
  Arg [1]    : (optional) int - the array_chip dbID
Example : my $ac_id = $ec->array_chip_id();
Description: Getter, setter array_chip_id attribute
Returntype : int
Exceptions : None
Caller : General
Status : Medium Risk
biological_replicatecodeprevnextTop
  Arg [1]    : (optional) string - the name or number of the chip biological replicate set
Example : $ec->biological_replicate('SAMPLENAME_BR1');
Description: Getter, setter for the biological_replicate attribute.
Returntype : string
Exceptions : None
Caller : General
Status : At Risk
cell_typecodeprevnextTop
  Arg [1]    : (optional) Bio::EnsEMBL::Funcgen::CellType
Example : $ec->cell_type($ctype);
Description: Getter/Setter the cell_type attribute.
Returntype : Bio::EnsEMBL::Funcgen::CellType
Exceptions : Throws if arg is not a Bio::EnsEMBL::CellType
Caller : General
Status : At Risk
contains_ChannelcodeprevnextTop
  Args [1]   : Bio::EnsEMBL::Funcgen::Channel
Example : if(! $echip->contains_Channel($chan){..add channel ..};
Description: Checks whether this Channel has already been added to the ExperimentalChip
Returntype : Boolean
Exceptions : Throws if arg not a valid stored Bio::EnseMBL::Funcgen::Channel
Caller : General
Status : At Risk
experiment_idcodeprevnextTop
  Arg [1]    : (optional) int - the experiment dbID
Example : my $exp_id = $array->experiment_id();
Description: Getter, setter experiment_id attribute
Returntype : int
Exceptions : None
Caller : General
Status : Medium Risk
feature_typecodeprevnextTop
  Arg [1]    : (optional) Bio::EnsEMBL::Funcgen::FeatureType
Example : $ec->feature_type($ftype);
Description: Getter/Setter thefeature_type attribute.
Returntype : Bio::EnsEMBL::Funcgen::FeatureType
Exceptions : Throws if arg is not a Bio::EnsEMBL::FeatureType
Caller : General
Status : At Risk
get_ArrayChipcodeprevnextTop
  Example    : my $array_chip = $exp_chip->get_ArrayChip();
Description: Getter for the array_chip attribute
Returntype : Bio::EnsEMBL::Funcgen::ArrayChip
Exceptions : None
Caller : General
Status : At Risk
get_Channel_by_dyecodeprevnextTop
  Args       : string - dye used in channel
Example : my $chan = $echip->get_Channel_by_dye("CY5");
Description: Returnsthe channel corresponding to the frequency specified
Returntype : Bio::EnsEMBL::Funcgen::Channel
Exceptions : None
Caller : General
Status : At Risk
get_ChannelscodeprevnextTop
  Args       : None
Example : my $channels = $exp_chip->get_Channels();
Description: Returns all channels on a ExperimentalChip. Needs a database connection.
Returntype : Listref of Bio::EnsEMBL::Funcgen::Channel objects
Exceptions : None
Caller : General
Status : At Risk
get_ExperimentcodeprevnextTop
  Args       : None
Example : my $exp = $exp_chip->get_Experiment();
Description: Returns the Experiment which this ExperimentalChip belongs to.
Returntype : Bio::EnsEMBL::Funcgen::Experiment
Exceptions : None
Caller : General
Status : At Risk
get_channel_idscodeprevnextTop
  Args       : None
Example : my @channel_ids = @{$array->get_channel_ids()};
Description: Returns all channel ids for an ExperimentalChip. Needs a database connection.
Returntype : List of ints
Exceptions : None
Caller : General
Status : Medium Risk
newcodeprevnextTop
  Arg [-unique_id]     : int - the unique id of this individual experimental chip
Arg [-experiment_id] : int - the experiment dbID
Arg [-array_chip_id] : int - the dbID or the array_chip
Arg [-feature_type ] : Bio::EnsEMBL::Funcgen::FeatureType
Arg [-cell_type ] : Bio::EnsEMBL::Funcgen::CellType
Arg [-biological_replicate ] : string - the name to define the biological replicate set
Arg [-technical_replicate ] : string - the name to define the technical replicate set
Example : my $array = Bio::EnsEMBL::Funcgen::ExperimentalChip->new( -dbID => $ec_id, -unique_id => $c_uid, -experiment_id => $exp_id, -array_chip_id => $ac_id, -feature_type => $ftype, -cell_type => $ftype, -biological_replicate => 'BIOREP1', -technical_replicate => 'techrep_1', ); Description: Creates a new Bio::EnsEMBL::Funcgen::ExperimentalChip object. Returntype : Bio::EnsEMBL::Funcgen::ExperimentalChip Exceptions : None ? should throw if mandaotry params not set Caller : General Status : Medium Risk
technical_replicatecodeprevnextTop
  Arg [1]    : (optional) string - the name or number of the chip technical replicate set
Example : $ec->technical_replicate('SAMPLENAME_BR1_TR1');
Description: Getter, setter for the technical_replicate attribute.
Returntype : string
Exceptions : None
Caller : General
Status : At Risk
unique_idcodeprevnextTop
  Arg [1]    : (optional) int - the unique chip id for this ExperimentalChip
Example : my $c_uid = $array->unique_id();
Description: Getter, setter unique_id attribute.
Returntype : string
Exceptions : None
Caller : General
Status : at Risk
Methods code
add_ChanneldescriptionprevnextTop
sub add_Channel {
  my ($self, $chan) = @_;


  if(! ($chan  && $chan->isa("Bio::EnsEMBL::Funcgen::Channel") && $chan->dbID())){
    throw("Must provide a valid stored Bio::EnsEMBL::Funcgen::Channel object");
  }
  

  $self->{'channels'} ||= {};

  if (exists $self->{'channels'}->{$chan->dbID()}){
    #should this throw?
#This currently prevents haveing to check whether a channel has already been added
#If we were duplicating then we probably would have a different dbID
warn("You cannot add the same Channel to an ExperimentalChip more than once"); }else{ ##change this to key on freq?
$self->{'channels'}{$chan->dbID()} = $chan; } return;
}
array_chip_iddescriptionprevnextTop
sub array_chip_id {
  my $self = shift;
  $self->{'array_chip_id'} = shift if @_; 
  return $self->{'array_chip_id'};
}
biological_replicatedescriptionprevnextTop
sub biological_replicate {
  my $self = shift;
  $self->{'biological_replicate'} = shift if @_;
  return $self->{'biological_replicate'};
}
cell_typedescriptionprevnextTop
sub cell_type {
  my $self = shift;

  if(@_){
    throw("Must pass a valid Bio::EnsEMBL::Funcgen::CellType object") if (! $_[0]->isa("Bio::EnsEMBL::Funcgen::CellType"));
    $self->{'cell_type'} = shift;
  }

  return $self->{'cell_type'};
}
contains_ChanneldescriptionprevnextTop
sub contains_Channel {
  my ($self, $chan) = @_;
  
  if(! ($chan  && $chan->isa("Bio::EnsEMBL::Funcgen::Channel") && $chan->dbID())){
    throw("Must provide a valid stored Bio::EnsEMBL::Funcgen::Channel object");
  }
  
  $self->get_Channels();

  my $contains = 0;

  $contains = 1 if(exists $self->{'channels'}->{$chan->dbID()});

  return $contains;
}
experiment_iddescriptionprevnextTop
sub experiment_id {
  my $self = shift;
  $self->{'experiment_id'} = shift if @_;
  return $self->{'experiment_id'};
}
feature_typedescriptionprevnextTop
sub feature_type {
  my $self = shift;

  if(@_){
    throw("Must pass a valid Bio::EnsEMBL::Funcgen::FeatureType object") if (! $_[0]->isa("Bio::EnsEMBL::Funcgen::FeatureType"));
    $self->{'feature_type'} = shift;
  }

  return $self->{'feature_type'};
}
get_ArrayChipdescriptionprevnextTop
sub get_ArrayChip {
  my $self = shift;

  if(! defined $self->{'array_chip'}){
    $self->{'array_chip'} = $self->adaptor->db->get_ArrayChipAdaptor()->fetch_by_dbID($self->array_chip_id());
  }

  return $self->{'array_chip'};
}



1;
}
get_Channel_by_dyedescriptionprevnextTop
sub get_Channel_by_dye {
  my ($self, $dye) = @_;

  my @chans;

  foreach my $chan(@{$self->get_Channels()}){
    push @chans, $chan if uc($chan->dye()) eq uc($dye);
  }

  throw("Found more than one Channels with the same dye") if(scalar(@chans) > 1);


  return (@chans) ? $chans[0] : undef;
}
get_ChannelsdescriptionprevnextTop
sub get_Channels {
  my $self = shift;

  if (! $self->{'channels'}){

    if ($self->dbID() && $self->adaptor() ) {
      foreach my $channel (@{$self->adaptor->db->get_ChannelAdaptor->fetch_all_by_ExperimentalChip($self)}){
	$self->add_Channel($channel);
      }	
    } else {
      warning('Need database connection to retrieve Channels');
    }
  }
  
  return [values %{$self->{'channels'}}];
}
get_ExperimentdescriptionprevnextTop
sub get_Experiment {
  my $self = shift;
  
  if (! $self->{'experiment'}){
	
    if ($self->dbID() && $self->adaptor() ) {
	  $self->{'experiment'} = $self->adaptor->db->get_ExperimentAdaptor->fetch_by_dbID($self->experiment_id);
    } else {
      warning('Need database connection to retrieve Experiment');
    }
  }


  return $self->{'experiment'};
}
get_channel_idsdescriptionprevnextTop
sub get_channel_ids {
  my $self = shift;

  $self->get_Channels();

  return [keys %{$self->{'channels'}}];
}
newdescriptionprevnextTop
sub new {
  my $caller = shift;

  my $class = ref($caller) || $caller;

  my $self = $class->SUPER::new(@_);
  
  #can we lc these?
my ($c_uid, $exp_dbid, $ac_id, $ftype, $ctype, $brep, $trep) = rearrange( ['UNIQUE_ID', 'EXPERIMENT_ID', 'ARRAY_CHIP_ID', 'FEATURE_TYPE', 'CELL_TYPE', 'BIOLOGICAL_REPLICATE', 'TECHNICAL_REPLICATE'], @_ ); $self->unique_id($c_uid) if defined $c_uid; $self->experiment_id($exp_dbid) if defined $exp_dbid; $self->array_chip_id($ac_id) if defined $ac_id; $self->feature_type($ftype) if defined $ftype; $self->cell_type($ctype) if defined $ctype; $self->biological_replicate($brep) if defined $brep; $self->technical_replicate($trep) if defined $trep; return $self;
}
technical_replicatedescriptionprevnextTop
sub technical_replicate {
  my $self = shift;
  $self->{'technical_replicate'} = shift if @_;
  return $self->{'technical_replicate'};
}
unique_iddescriptionprevnextTop
sub unique_id {
  my $self = shift;
  $self->{'unique_id'} = shift if @_;
  return $self->{'unique_id'};
}
General documentation
AUTHORTop
This module was created by Nathan Johnson.
This module is part of the Ensembl project: /
CONTACTTop
Post comments or questions to the Ensembl development list: ensembl-dev@ebi.ac.uk