Bio::EnsEMBL::Funcgen ExperimentalSet
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::EnsEMBL::ExperimentalSet - A module to represent ExperimentalSet object.
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::Funcgen::ExperimentalSubset
Bio::EnsEMBL::Funcgen::Set
Bio::EnsEMBL::Utils::Argument qw ( rearrange )
Bio::EnsEMBL::Utils::Exception qw ( throw warning deprecate )
Inherit
Bio::EnsEMBL::Funcgen::Set
Synopsis
use Bio::EnsEMBL::Funcgen::ExpeimentalSet;
my $data_set = Bio::EnsEMBL::Funcgen::ExperimentalSet->new(
-DBID => $dbID,
-ADAPTOR => $self,
-EXPERIMENT => $exp,
-FEATURE_TYPE => $ftype,
-CELL_TYPE => $ctype,
-FORMAT => 'READ_FORMAT',
-VENDOR => 'SOLEXA',
-NAME => 'ExpSet1',
);
Description
An ExperimentalSet object provides a generic container for any non-array based feature import,
allowing tracking of file import via the status table and integration into Data and FeatureSets to
provide traceability to the source experiment from a given FeatureSet.
Methods
add_new_subsetDescriptionCode
formatDescriptionCode
get_ExperimentDescriptionCode
get_subset_by_nameDescriptionCode
get_subset_namesDescriptionCode
get_subsetsDescriptionCode
newDescriptionCode
vendorDescriptionCode
Methods description
add_new_subsetcode    nextTop
  Arg [1]    : string - sub set name e.g. the file name (not path as we're restricted to 30 chars)
Example : $expset->add_new_subset($ss_name, $exp_subset);
Description: Adds experimental_subset
Returntype : none
Exceptions : Throws if set is already present
Throws if ExperimentalSubset is not valid or stored
Caller : General
Status : At Risk
formatcodeprevnextTop
  Arg[1]     : string - format i.e. product type/format
Example : my $eset->format('DATASET1');
Description: Getter/Setter for the format attribute of this ExperimentalSet.
Returntype : string
Exceptions : None
Caller : General
Status : At Risk
get_ExperimentcodeprevnextTop
  Example    : my $exp = $exp_set->get_Experiment();
Description: Getter for the Experiment of this DataSet.
Returntype : Bio::EnsEMBL::Fuuncgen::Experiment
Exceptions : None
Caller : General
Status : At Risk
get_subset_by_namecodeprevnextTop
  Example    : my $subsets = $exp_set->get_subset_by_name('subset1');
Description: Getter for the subset of a given name for this ExperimentalSet.
Returntype : Bio::EnsEMBL::Funcgen::ExpeirmentalSubset
Exceptions : None
Caller : General
Status : At Risk
get_subset_namescodeprevnextTop
  Example    : my @subset_names = @{$exp_set->get_subset_names()};
Description: Getter for the subset names for this ExperimentalSet.
Returntype : Arrayref
Exceptions : None
Caller : General
Status : At Risk
get_subsetscodeprevnextTop
  Example    : my @subsets = @{$exp_set->get_subsets()};
Description: Getter for the subsets for this ExperimentalSet.
Returntype : Arrayref
Exceptions : None
Caller : General
Status : At Risk
newcodeprevnextTop
  Example    : my $eset = Bio::EnsEMBL::Funcgen::ExperimentalSet->new(
-EXPERIMENT => $exp,
-FEATURE_TYPE => $ftype,
-CELL_TYPE => $ctype,
-FORMAT => 'READ_FORMAT',
-VENDOR => 'SOLEXA',
-NAME => 'ExpSet1',
-ANALYSIS => $anal,
);
Do we want to define subsets likes this or are we more likely to add them one by one? Description: Constructor for ExperimentalSet objects. Returntype : Bio::EnsEMBL::Funcgen::ExperimentalSet Exceptions : Throws if no Experiment defined Throws if CellType or FeatureType are not valid or stored Caller : General Status : At risk
vendorcodeprevnextTop
  Arg[1]     : string - vendor 
Example : my $eset->vendor('SOLEXA');
Description: Getter/Setter for the vendor attribute of this DataSet.
Returntype : string
Exceptions : None
Caller : General
Status : At Risk
Methods code
add_new_subsetdescriptionprevnextTop
sub add_new_subset {
  my ($self, $ss_name, $exp_sset) = @_;
	
  if($self->get_subset_by_name($ss_name)){
	throw("Subset $ss_name is already present in this ExperimentalSet, maybe you need to alter the filename?");
  }

  if(defined $exp_sset){

	if(!(ref($exp_sset) && $exp_sset->isa('Bio::EnsEMBL::Funcgen::ExperimentalSubset') && $exp_sset->dbID())){
	  throw('ExperimentalSubsets must be valid and stored');
	}
  }
  else{
	
	$exp_sset = Bio::EnsEMBL::Funcgen::ExperimentalSubset->new(
															   -name => $ss_name,
															   -experimental_set => $self,
															  );
  }

  $self->{'subsets'}{$ss_name} = $exp_sset;

  return $self->{'subsets'}{$ss_name};
}
formatdescriptionprevnextTop
sub format {
  my $self = shift;
     	
  $self->{'format'} = shift if @_;
  
  return $self->{'format'};
}

1;
}
get_ExperimentdescriptionprevnextTop
sub get_Experiment {
  my $self = shift;

  return $self->{'experiment'};
}
get_subset_by_namedescriptionprevnextTop
sub get_subset_by_name {
  my ($self, $name) = @_;

  return (exists $self->{'subsets'}{$name}) ? $self->{'subsets'}{$name} : undef;
}
get_subset_namesdescriptionprevnextTop
sub get_subset_names {
  my ($self) = shift;

  return [ keys %{$self->{'subsets'}} ];
}
get_subsetsdescriptionprevnextTop
sub get_subsets {
  my ($self)  = shift;

  return [ values %{$self->{'subsets'}} ];
}
newdescriptionprevnextTop
sub new {
  my $caller = shift;
	
  my $class = ref($caller) || $caller;
	
  my $self = $class->SUPER::new(@_);
	
  #do we need to add $fg_ids to this?  Currently maintaining one feature_group focus.(combi exps?)
my ($exp, $format, $vendor) = rearrange(['EXPERIMENT', 'FORMAT', 'VENDOR'], @_); if (! (ref $exp && $exp->isa('Bio::EnsEMBL::Funcgen::Experiment') && $exp->dbID())){ throw('Must specify a valid stored Bio::EnsEMBL::Funcgen::Experiment'); } #These are set in Set, just validate here
throw ('Must provide a FeatureType') if(! defined $self->feature_type); throw ('Must provide a CellType') if(! defined $self->cell_type); if(! defined $self->analysis){ #default analysis hack for v47
#Set directly to avoid dbID boolean check
$self->{'analysis'} = Bio::EnsEMBL::Analysis->new(-logic_name => 'external', -id => 0,#??someone needs to rewrite analysis
); } $self->format($format) if defined $format; $self->vendor($vendor) if defined $vendor; $self->{'experiment'} = $exp; $self->{'subsets'} = {}; return $self;
}
vendordescriptionprevnextTop
sub vendor {
  my $self = shift;
     	
  $self->{'vendor'} = shift if @_;

  return $self->{'vendor'};
}
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