Bio::EnsEMBL::Funcgen
Experiment
Toolbar
Summary
Bio::EnsEMBL::Funcgen::Experiment
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
use Bio::EnsEMBL::Funcgen::Experiment;
my $array = Bio::EnsEMBL::Funcgen::Experiment->new(
-ADAPTOR => $self,
-NAME => $name,
-GROUP => $group,
-DATE => $date,
-PRIMARY_DESIGN_TYPE => $p_design_type,
-DESCRIPTION => $description,
);
my $db_adaptor = Bio::EnsEMBL::Funcgen::DBSQL::DBAdaptor->new(...);
my $exp_adaptor = $db_adaptor->get_ExperimentAdaptor();
my $exp = $exp_adaptor->fetch_by_name($exp_name)
Description
An Experiment object represents an experiment instance . The data
are stored in the experiment, egroup, target, design_type and
experimental_variable tables.
Methods
Methods description
Example : $exp_chip = $exp->add_ExperimentalChip($exp_chip) Description : Adds and stores an ExperiemntalChip for this Experiment Returntype : Bio::EnsEMBL::Funcgen::ExperimentalChip Exceptions : Throws is not passed a valid stored Bio::EnsENBML::Funcgen::ExperimentalChip Caller : General Status : At risk |
Arg [1]: optional - date, format yyyy-mm-dd Example: $exp->date('2006-06-09'); Description: Getter/Setter for the date Returntype : date string Exceptions : None ? should throw/warn if format not correct Caller : General Status : Medium |
Arg [1]: string - the experiment description Example: $exp->description("Human chromosome X TFBS identification"); Description: Getter/Setter for the experiment description Returntype : string Exceptions : None Caller : General Status : Stable |
Example: $exp_chip = $exp->add_ExperimentalChip($exp_chip) Description: Adds and stores an ExperiemntalChip for this Experiment Returntype : Bio::EnsEMBL::Funcgen::ExperimentalChip Exceptions : Throws if no uid supplied Caller : General Status : At risk |
Example: foreach my $uid(@{$self->experiment->get_ExperimentalChip_unique_ids()}){ ... } Description: retrieves all ExperimentalChip unique_ids Returntype : ListRef Exceptions : None Caller : General Status : At risk |
Example: my $exp_chips = @{$exp->get_ExperimentalChips()} Description: Retrieves all ExperiemntalChips Returntype : Listref of ExperimentalChips Exceptions : None Caller : General Status : At risk |
Arg [1]: optional - Bio::EnsEMBL::Funcgen::Group Example: my $exp_group_name = $exp->group->name(); Description: Getter/Setter for the group Returntype : Bio::EnsEMBL::Funcgen::Group Exceptions : None Caller : General Status : At risk |
Arg [1]: int - the group dbID corresponding to this experiment Example: $exp->group_db_id('1'); Description: Getter/Setter for the group_db_id Returntype : int Exceptions : None Caller : General Status : Stable |
Arg [1]: string(optional) - MAGE XML Example: my $xml = $exp->mage_xml(); Description: Getter/Setter for the mage_xml attribute Returntype : string Exceptions : None Caller : General Status : at risk |
Arg [1]: int (optional) - mage_xml_id Example: $exp->group_db_id('1'); Description: Getter/Setter for the mage_xml attribute Returntype : string Exceptions : None Caller : General Status : at risk |
Arg [1]: string - the name of this experiment Example: $exp->name('Experiment-1'); Description: Getter/Setter for the experiment name Returntype : string Exceptions : None Caller : General Status : Stable |
Arg [-NAME]: string - the name of this experiment Arg [-GROUP]: string - the name of the experimental group Arg [-GROUP_ID]: int - the dbID of the experimental group Arg [-DATE]: string - the date of the experiment (format?) Arg [-PRIMARY_DESIGN_TYPE]: string - MGED term for the primary design of teh experiment e.g. binding_site_identification Arg [-DESCRIPTION]: string - of the experiment
Example : my $array = Bio::EnsEMBL::Funcgen::Experiment->new(
-NAME => $name,
-GROUP => $group,
-DATE => $date,
-PRIMARY_DESIGN_TYPE => $p_design_type,
-DESCRIPTION => $description,
);
Description: Creates a new Bio::EnsEMBL::Funcgen::Experiment object.
Returntype : Bio::EnsEMBL::Funcgen::Experiment
Exceptions : None ? Should throw if mandatory params not set
Caller : General
Status : Medium Risk |
Arg [1]: string - MGED term for primary design type Example: $exp->primary_design_type('binding_site_identification'); Description: Getter/Setter for the primary design type Returntype : string Exceptions : None ? should throw if not MGED term Caller : General Status : At risk |
Methods code
sub add_ExperimentalChip
{ my ($self, $echip) = @_;
throw("Must pass a valid stored Bio::EnsEMBL::Funcgen::ExperimentalChip object")
if(! $echip->isa("Bio::EnsEMBL::Funcgen::ExperimentalChip") || ! $echip->dbID());
if(! exists $self->{'experimental_chips'}){
$self->get_ExperimentalChips();
$self->{'experimental_chips'}->{$echip->unique_id()} = $echip;
}elsif(exists $self->{'experimental_chips'}->{$echip->unique_id()}){
warn("You cannot add the same ExperimentalChip(".$echip->unique_id().")to an Experiment more than once, check your code");
}else{
$self->{'experimental_chips'}->{$echip->unique_id()} = $echip;
}
return; } |
sub date
{ my $self = shift;
if(@_){
$self->{'date'} = shift;
}
return $self->{'date'}; } |
sub description
{ my $self = shift;
$self->{'description'} = shift if(@_);
return $self->{'description'}; } |
sub get_ExperimentalChip_by_unique_id
{ my ($self, $uid) = @_;
my ($echip);
throw("Must supply a ExperimentalChip unque_id") if(! defined $uid);
$self->{'experimental_chips'} || $self->get_ExperimentalChips();
if(exists $self->{'experimental_chips'}->{$uid}){
$echip = $self->{'experimental_chips'}->{$uid};
}
return $echip; } |
sub get_ExperimentalChip_unique_ids
{ my $self = shift;
$self->{'experimental_chips'} || $self->get_ExperimentalChips();
return [keys %{ $self->{'experimental_chips'}}];
}
1; } |
sub get_ExperimentalChips
{ my ($self) = shift;
if(! exists $self->{'experimental_chips'}){
$self->{'experimental_chips'} = {};
foreach my $echip(@{$self->adaptor->db->get_ExperimentalChipAdaptor->fetch_all_by_experiment_dbID($self->dbID())}){
$self->{'experimental_chips'}->{$echip->unique_id()} = $echip;
}
}
return [values %{$self->{'experimental_chips'}}]; } |
sub group
{ my ($self) = shift;
if(@_){
$self->{'group'} = shift;
}elsif(! exists $self->{'group'}){
throw("Not yet implemented group adaptor");
}
return $self->{'group'}; } |
sub group_id
{ my ($self) = shift;
$self->{'group_id'} = shift if(@_);
return $self->{'group_id'}; } |
sub mage_xml
{ my ($self) = shift;
$self->{'mage_xml'} = shift if(@_);
if(! exists $self->{'mage_xml'} && $self->mage_xml_id()){
$self->{'mage_xml'} = $self->adaptor->fetch_mage_xml_by_Experiment($self);
}
return (exists $self->{'mage_xml'}) ? $self->{'mage_xml'} : undef; } |
sub mage_xml_id
{ my $self = shift;
$self->{'mage_xml_id'} = shift if @_;
return $self->{'mage_xml_id'}; } |
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, $group_id, $group, $date, $p_dtype, $desc, $xml_id, $xml)
= rearrange( ['NAME', 'GROUP_ID', 'GROUP', 'DATE', 'PRIMARY_DESIGN_TYPE', 'DESCRIPTION', 'MAGE_XML', 'MAGE_XML_ID'], @_ );
$self->name($name) if defined $name;
$self->group_id($group_id) if defined $group_id;
$self->group($group) if defined $group;
$self->date($date) if defined $date;
$self->primary_design_type($p_dtype) if defined $p_dtype;
$self->description($desc) if defined $desc;
$self->mage_xml_id($xml_id) if defined $xml_id;
$self->mage_xml($xml) if defined $xml;
return $self;
}
} |
sub primary_design_type
{ my ($self) = shift;
if(@_){
$self->{'primary_design_type'} = shift;
}
return $self->{'primary_design_type'};
}
} |
General documentation
This module was created by Nathan Johnson.
This module is part of the Ensembl project:
/