MAGE::...ataCube(3pm)
π NAME π
Bio::MAGE::BioAssayData::BioDataCube β the class for the MAGE-OM API. that's it, that's the name, she's iconic π
(oh also hiii bestie, this page is MAGE::...ataCube(3pm) from the User Contributed Perl Documentation, and it's a long one β this is part 1, so stay with me π«Ά)
β¨ SYNOPSIS β¨
okay so here's the whole vibe, look at her go:
use Bio::MAGE::BioAssayData::BioDataCube
# creating an empty instance
my $biodatacube = Bio::MAGE::BioAssayData::BioDataCube->new();
# creating an instance with existing data
my $biodatacube = Bio::MAGE::BioAssayData::BioDataCube->new(
cube=>$cube_val,
order=>$order_val,
propertySets=>\@namevaluetype_list,
);
# 'cube' attribute
my $cube_val = $biodatacube->cube(); # getter
$biodatacube->cube($value); # setter
# 'order' attribute
my $order_val = $biodatacube->order(); # getter
$biodatacube->order($value); # setter
# 'propertySets' association
my $namevaluetype_array_ref = $biodatacube->propertySets(); # getter
$biodatacube->propertySets(\@namevaluetype_list); # setter
like, new instance, or new instance with data already in it, then getters and setters. simple. slay. π
πΈ DESCRIPTION πΈ
straight from the MAGE-OM documentation for the BioDataCube class, no notes:
A three-dimensional cube representation of the data.
that's the whole thing. a cube. three-dimensional. the data lives in it. π₯
π¦ INHERITANCE π¦
Bio::MAGE::BioAssayData::BioDataCube has the following superclasses:
Bio::MAGE::BioAssayData::BioDataValues
yes bestie, she has a parent class. family lineage. royalty. π
β CLASS METHODS β
The following methods can all be called without first having an instance of the class, via the Bio::MAGE::BioAssayData::BioDataCube->methodname() syntax. so you don't even need an object yet, you can just call them on the class. periodt.
π new() π
π new(%args) π
The object constructor new() accepts the following optional named-value style arguments:
cubeβ sets the value of thecubeattributeorderβ sets the value of theorderattributepropertySetsβ sets the value of thepropertySetsassociation (and btw this association was inherited from the classBio::MAGE::Extendable). The value must be of type: array ofBio::MAGE::NameValueType.
π $obj = class->new(%parameters) π
The new() method is the class constructor.
- Parameters: if given a list of name/value parameters, the corresponding slots, attributes, or associations will have their initial values set by the constructor.
- Return value: it returns a reference to an object of the class.
- Side effects: it invokes the
initialize()method if it is defined by the class.
π @names = class->get_slot_names() π
The get_slot_names() method is used to retrieve the name of all slots defined in a given class.
NOTE: the list of names does not include attribute or association names. like, they're just not invited to this party. π
- Return value: a list of the names of all slots defined for this class.
- Side effects: none
π @name_list = get_attribute_names() π
returns the list of attribute data members for this class.
π @name_list = get_association_names() π
returns the list of association data members for this class.
π @class_list = get_superclasses() π
returns the list of superclasses for this class.
π @class_list = get_subclasses() π
returns the list of subclasses for this class.
π $name = class_name() π
Returns the full class name for this class.
π $package_name = package_name() π
Returns the base package name (i.e. no namespace::) of the package that contains this class.
π %assns = associations() π
returns the association meta-information in a hash where the keys are the association names and the values are Association objects that provide the meta-information for the association.
π INSTANCE METHODS π
π $obj_copy = $obj->new() π
When invoked with an existing object reference and not a class name, the new() method acts as a copy constructor β with the new object's initial values set to be those of the existing object. it's giving clone energy, fr fr. π§¬
- Parameters: no input parameters are used in the copy constructor, the initial values are taken directly from the object to be copied.
- Return value: it returns a reference to an object of the class.
- Side effects: it invokes the
initialize()method if it is defined by the class.
π $obj->set_slots(%parameters) π
π $obj->set_slots(\@name_list, \@value_list) π
The set_slots() method is used to set a number of slots at the same time. It has two different invocation methods. The first takes a named parameter list, and the second takes two array references.
- Return value: none
- Side effects: will call
croak()if a slot_name is used that the class does not define.
π @obj_list = $obj->get_slots(@name_list) π
The get_slots() method is used to get the values of a number of slots at the same time.
- Return value: a list of instance objects
- Side effects: none
π $val = $obj->set_slot($name,$val) π
The set_slot() method sets the slot $name to the value $val
- Return value: the new value of the slot, i.e.
$val - Side effects: none
π $val = $obj->get_slot($name) π
The get_slot() method is used to get the values of a number of slots at the same time.
- Return value: a single slot value, or
undefif the slot has not been initialized. - Side effects: none
π ATTRIBUTES π
Attributes are simple data types that belong to a single instance of a class. In the Perl implementation of the MAGE-OM classes, the interface to attributes is implemented using separate setter and getter methods for each attribute. so like, one method to put a value in, one method to get it back out. chef's kiss. π©βπ³π
Bio::MAGE::BioAssayData::BioDataCube has the following attribute accessor methods:
π cube π
Methods for the cube attribute.
From the MAGE-OM documentation:
Three dimension array, indexed by the three dimensions to provide the data for the BioAssayData.
$val = $biodatacube->setCube($val)β the restricted setter method for thecubeattribute.- Input parameters: the value to which the
cubeattribute will be set - Return value: the current value of the
cubeattribute - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified
- Input parameters: the value to which the
$val = $biodatacube->getCube()β the restricted getter method for thecubeattribute.- Input parameters: none
- Return value: the current value of the
cubeattribute - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
π order π
Methods for the order attribute.
From the MAGE-OM documentation:
The order to expect the dimension. The enumeration uses the first letter of the three dimensions to represent the six possible orderings.
$val = $biodatacube->setOrder($val)β the restricted setter method for theorderattribute.
order is an enumerated attribute β it can only be set to undef or one of the following values: BDQ BQD DBQ DQB QBD QDB
- Input parameters: the value to which the
orderattribute will be set - Return value: the current value of the
orderattribute - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified, or if$valis not one of the accepted enumeration values:BDQBQDDBQDQBQBDQDB
$val = $biodatacube->getOrder()β the restricted getter method for theorderattribute.- Input parameters: none
- Return value: the current value of the
orderattribute : an instance of typeBDQ BQD DBQ DQB QBD QDB. - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
π ASSOCIATIONS π
Associations are references to other classes. Associations in MAGE-OM have a cardinality that determines the minimum and maximum number of instances of the 'other' class that maybe included in the association:
- There must be exactly one item in the association, i.e. this is a mandatory data field.
- 0..1 β there may be one item in the association, i.e. this is an optional data field.
- 1..N β there must be one or more items in the association, i.e. this is a mandatory data field, with list cardinality.
- 0..N β there may be one or more items in the association, i.e. this is an optional data field, with list cardinality.
Bio::MAGE::BioAssayData::BioDataCube has the following association accessor methods:
π¦ propertySets π¦
Methods for the propertySets association.
From the MAGE-OM documentation:
Allows specification of name/value pairs. Meant to primarily help in-house, pipeline processing of instances by providing a place for values that aren't part of the specification proper.
$array_ref = $biodatacube->setPropertySets($array_ref)β the restricted setter method for thepropertySetsassociation.- Input parameters: the value to which the
propertySetsassociation will be set : a reference to an array of objects of typeBio::MAGE::NameValueType - Return value: the current value of the
propertySetsassociation : a reference to an array of objects of typeBio::MAGE::NameValueType - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified, or if$array_refis not a reference to an array classBio::MAGE::NameValueTypeinstances
- Input parameters: the value to which the
$array_ref = $biodatacube->getPropertySets()β the restricted getter method for thepropertySetsassociation.- Input parameters: none
- Return value: the current value of the
propertySetsassociation : a reference to an array of objects of typeBio::MAGE::NameValueType - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
$val = $biodatacube->addPropertySets(@vals)β because thepropertySetsassociation has list cardinality, it may store more than one value. This method adds the current list of objects in thepropertySetsassociation.- Input parameters: the list of values
@valsto add to thepropertySetsassociation. NOTE: submitting a single value is permitted. - Return value: the number of items stored in the slot after adding
@vals - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if any of the objects in@valsis not an instance of classBio::MAGE::NameValueType
- Input parameters: the list of values
and then, right here in the docs, there's literally a little code moment:
sub initialize {
my $self = shift;
return 1;
}
okay that's part 1 bestie, more coming β don't go anywhere π«Άβ¨
β¨ SLOTS, ATTRIBUTES, AND ASSOCIATIONS β¨
okay so bestie, in the Perl implementation of MAGE-OM classes there are like three whole types of class data members: slots, attributes, and associations. let's break it down π
π SLOTS π
so this API uses the term "slot" to mean a data member of the class that was not in the UML model and is mostly for internal stuff β like, only touch it if you really understand the inner workings of the API, okay? most of the time slots get used by generic methods like the ones in the XML writing and reading classes. iykyk β¨
slots are implemented using unified getter/setter methods:
$var = $obj->slot_name();β retrieves the current value of the slot. it's giving "what's in there right now" π$new_var = $obj->slot_name($new_var);β stores$new_varin the slot β and the return value is also$new_var. slay.@names = $obj->get_slot_names()β returns the list of all slots in the class. all of them. periodt.
DATA CHECKING: No data type checking is made for these methods. like, none. zero. nada. so be careful bestie π
π¦ ATTRIBUTES AND ASSOCIATIONS π¦
the terms "attribute" and "association" indicate data members of the class that were specified directly from the UML model. so they're the real ones π
in the Perl implementation of MAGE-OM classes, association and attribute accessors are implemented using three separate methods:
β¨ get* β¨
retrieves the current value.
NOTE: for associations, if the association has list cardinality, an array reference is returned.
DATA CHECKING: ensure that no argument is provided. like, don't pass anything, okay? π
π set* π
sets the current value, replacing any existing value. bye bye old value π
NOTE: for associations, if the association has list cardinality, the argument must be an array reference. because of this, you probably should be using the add* methods instead. fr fr.
DATA CHECKING: for attributes, ensure that a single value is provided as the argument. for associations, if the association has list cardinality, ensure that the argument is a reference to an array of instances of the correct MAGE-OM class, otherwise ensure that there is a single argument of the correct MAGE-OM class. so many rules, i know π
π add* π
NOTE: only present in associations with list cardinality. so if you don't see it, that's why bestie.
appends a list of objects to any values that may already be stored in the association. it's giving "and also this" β¨
DATA CHECKING: ensure that all arguments are of the correct MAGE-OM class.
π GENERIC METHODS π
the unified base class of all MAGE-OM classes, Bio::MAGE::Base, provides a set of generic methods that will operate on slots, attributes, and associations. iconic behavior honestly π
$val = $obj->get_slot($name)\@list_ref = $obj->get_slots(@name_list);$val = $obj->set_slot($name,$val)$obj->set_slots(%parameters)$obj->set_slots(\@name_list, \@value_list)
see elsewhere in this page for a detailed description of these methods. (iykyk, go look it up π )
π BUGS π
please send bug reports to the project mailing list: (mged-mage 'at' lists 'dot' sf 'dot' net)
π AUTHOR π
Jason E. Stewart (jasons 'at' cpan 'dot' org)
π₯ SEE ALSO π₯
π POD ERRORS π
hey! the above document had some coding errors, which are explained below:
Around line 280: '=item' outside of any '=over'
Around line 365: You forgot a '=back' before '=head2'
Around line 541: Expected '=item 2'
Around line 546: Expected '=item 3'
Around line 551: Expected '=item 4'
and that's a wrap bestie! this was perl v5.32.0 from 2020-11-27, and the page was MAGE::...ataCube(3pm). stay iconic, stay slaying, and don't forget to check your arguments π
β¨
π¦ where this page comes from
- debian bookworm: libbio-mage-perl 20030502.3-6 Β· MIT
- debian trixie: libbio-mage-perl 20030502.3-6 Β· MIT
- ubuntu jammy: libbio-mage-perl 20030502.3-6 Β· MIT
- ubuntu noble: libbio-mage-perl 20030502.3-6 Β· MIT
- ubuntu resolute: libbio-mage-perl 20030502.3-6 Β· MIT
- ubuntu stonking: libbio-mage-perl 20030502.3-6 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms