MAGE::...ayDatum(3pm)
MAGE::...ayDatum(3pm) π
okay bestie so this is a page from the User Contributed Perl Documentation, and the manual name it lives under is literally MAGE::...ayDatum(3pm) β yes the middle got eaten by the truncation gods, that's just how it's filed, don't worry about it. π«Ά This is part 1 of 3, so buckle up, we're not even close to done.
β¨ NAME β¨
Bio::MAGE::BioAssayData::BioAssayDatum β a whole entire Class for the MAGE-OM API. π
β¨ SYNOPSIS β¨
use Bio::MAGE::BioAssayData::BioAssayDatum
# creating an empty instance
my $bioassaydatum = Bio::MAGE::BioAssayData::BioAssayDatum->new();
# creating an instance with existing data
my $bioassaydatum = Bio::MAGE::BioAssayData::BioAssayDatum->new(
value=>$value_val,
bioAssay=>$bioassay_ref,
propertySets=>\@namevaluetype_list,
quantitationType=>$quantitationtype_ref,
designElement=>$designelement_ref,
);
# 'value' attribute
my $value_val = $bioassaydatum->value(); # getter
$bioassaydatum->value($value); # setter
# 'bioAssay' association
my $bioassay_ref = $bioassaydatum->bioAssay(); # getter
$bioassaydatum->bioAssay($bioassay_ref); # setter
# 'propertySets' association
my $namevaluetype_array_ref = $bioassaydatum->propertySets(); # getter
$bioassaydatum->propertySets(\@namevaluetype_list); # setter
# 'quantitationType' association
my $quantitationtype_ref = $bioassaydatum->quantitationType(); # getter
$bioassaydatum->quantitationType($quantitationtype_ref); # setter
# 'designElement' association
my $designelement_ref = $bioassaydatum->designElement(); # getter
$bioassaydatum->designElement($designelement_ref); # setter
β¨ DESCRIPTION β¨
straight from the MAGE-OM documentation for the "BioAssayDatum" class, and I'm quoting the vibe here:
A single cell of the quantitation, bioAssay, designElement matrix.
one (1) cell. that's it. that's the whole girl. a single data point in the matrix, living her little life. πΈ
β¨ INHERITANCE β¨
Bio::MAGE::BioAssayData::BioAssayDatum has the following superclasses:
Bio::MAGE::Extendable
so yeah, she's extendable's daughter, she inherited the good genes π
β¨ CLASS METHODS β¨
the following methods can all be called without first having an instance of the class β you just hit them with the Bio::MAGE::BioAssayData::BioAssayDatum->methodname() syntax and you're golden. β¨
new()
new(%args)
the object constructor new() accepts the following optional named-value style arguments:
valueβ sets the value of the"value"attributepropertySetsβ sets the value of the"propertySets"association (fun fact: this association was inherited from class"Bio::MAGE::Extendable"). the value must be of type: array ofBio::MAGE::NameValueType.bioAssayβ sets the value of the"bioAssay"association. the value must be of type: instance ofBio::MAGE::BioAssay::BioAssay.quantitationTypeβ sets the value of the"quantitationType"association. the value must be of type: instance ofBio::MAGE::QuantitationType::QuantitationType.designElementβ sets the value of the"designElement"association. the value must be of type: instance ofBio::MAGE::DesignElement::DesignElement.
$obj = class->new(%parameters)
the "new()" method is the class constructor. the main character, fr fr. π
Parameters: if you hand it a list of name/value parameters, the corresponding slots, attributes, or associations will get their initial values set by the constructor. cute.
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 how you retrieve the name of all slots defined in a given class.
NOTE: the list of names does not include attribute or association names. okay? okay. don't come for me when they're not in there. π
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.
and that's part 1, bestie β more is literally coming, don't go anywhere π
β¨ INSTANCE METHODS β¨
okay bestie, so now we're in the instance methods zone β these are the ones you call on an actual object, not the class itself. periodt. π
$obj_copy = $obj->new()β When you callnew()on an existing object reference (not a class name), it's giving copy constructor energy β¨ β the new object starts with all the same initial values as the old one.- 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)and$obj->set_slots(\@name_list, \@value_list)β Theset_slots()method is your bestie for setting a bunch 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)β Theget_slots()method grabs the values of a bunch of slots all at once. no cap.- Return value: a list of instance objects
- Side effects: none
$val = $obj->set_slot($name,$val)β Theset_slot()method sets the slot$nameto the value$val. slay.- Return value: the new value of the slot, i.e.
$val - Side effects: none
- Return value: the new value of the slot, i.e.
$val = $obj->get_slot($name)β Theget_slot()method is used to get the values of a number of slots at the same time. (Yes, it says "a number of slots" even though it's one slot β the manpage said it, so I'm keeping it fr fr.) π- Return value: a single slot value, or
undefif the slot has not been initialized. - Side effects: none
- Return value: a single slot value, or
πΈ 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.
Bio::MAGE::BioAssayData::BioAssayDatum has the following attribute accessor methods:
π value
Methods for the value attribute.
From the MAGE-OM documentation:
The datum value.
$val = $bioassaydatum->setValue($val)β The restricted setter method for thevalueattribute.- Input parameters: the value to which the
valueattribute will be set - Return value: the current value of the
valueattribute - 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 = $bioassaydatum->getValue()β The restricted getter method for thevalueattribute.- Input parameters: none
- Return value: the current value of the
valueattribute - 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::BioAssayDatum 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 = $bioassaydatum->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 = $bioassaydatum->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 = $bioassaydatum->addPropertySets(@vals)β Because the propertySets association has list cardinality, it may store more than one value. This method adds the current list of objects in the propertySets association.- Input parameters: the list of values
@valsto add to the propertySets association. 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
π₯ bioAssay
Methods for the bioAssay association.
From the MAGE-OM documentation:
The BioAssay associated with the value of the BioAssayDatum.
$val = $bioassaydatum->setBioAssay($val)β The restricted setter method for thebioAssayassociation.- Input parameters: the value to which the
bioAssayassociation will be set : one of the accepted enumerated values. - Return value: the current value of the
bioAssayassociation : one of the accepted enumerated values. - 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 an instance of classBio::MAGE::BioAssay::BioAssay
- Input parameters: the value to which the
$val = $bioassaydatum->getBioAssay()β The restricted getter method for thebioAssayassociation.- Input parameters: none
- Return value: the current value of the
bioAssayassociation : an instance of typeBio::MAGE::BioAssay::BioAssay. - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
π quantitationType
Methods for the quantitationType association.
From the MAGE-OM documentation:
The QuantitationType associated with the value of the BioAssayDatum.
$val = $bioassaydatum->setQuantitationType($val)β The restricted setter method for thequantitationTypeassociation.- Input parameters: the value to which the
quantitationTypeassociation will be set : one of the accepted enumerated values. - Return value: the current value of the
quantitationTypeassociation : one of the accepted enumerated values. - 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 an instance of classBio::MAGE::QuantitationType::QuantitationType
- Input parameters: the value to which the
$val = $bioassaydatum->getQuantitationType()β The restricted getter method for thequantitationTypeassociation.- Input parameters: none
- Return value: the current value of the
quantitationTypeassociation : an instance of typeBio::MAGE::QuantitationType::QuantitationType. - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
π designElement
Methods for the designElement association.
From the MAGE-OM documentation:
The DesignElement associated with the value of the BioAssayDatum.
$val = $bioassaydatum->setDesignElement($val)β The restricted setter method for thedesignElementassociation.- Input parameters: the value to which the
designElementassociation will be set : one of the accepted enumerated values. - Return value: the current value of the
designElementassociation : one of the accepted enumerated values. - 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 an instance of classBio::MAGE::DesignElement::DesignElement
- Input parameters: the value to which the
$val = $bioassaydatum->getDesignElement()β The restricted getter method for thedesignElementassociation.- Input parameters: none
- Return value: the current value of the
designElementassociation : an instance of typeBio::MAGE::DesignElement::DesignElement. - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
And then there's this little code moment at the end:
sub initialize {
my $self = shift;
return 1;
}
π SLOTS, ATTRIBUTES, AND ASSOCIATIONS π
Okay so in the Perl implementation of MAGE-OM classes, there are three types of class data members: "slots", "attributes", and "associations". That's the whole vibe check. β¨
π SLOTS π
This API uses the term "slot" to indicate a data member of the class that was not present in the UML model and is used for mainly internal purposes β so bestie, use only if you understand the inner workings of the API. Most often slots are used by generic methods such as those 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. π$new_var = $obj->slot_name($new_var);β Store$new_varin the slot β the return value is also$new_var. π@names = $obj->get_slot_names()β Returns the list of all slots in the class. π
DATA CHECKING: No data type checking is made for these methods. π
π¦ ATTRIBUTES AND ASSOCIATIONS π¦
The terms "attribute" and "association" indicate data members of the class that were specified directly from the UML model. No cap.
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. π«
set*β Sets the current value, replacing any existing 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. π 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. π§
add*β NOTE: Only present in associations with list cardinality. Appends a list of objects to any values that may already be stored in the association. β
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:
$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. π
π 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 π
perl(1). π«Ά
π POD ERRORS π
Hey! The above document had some coding errors, which are explained below:
- Around line 365:
'=item' outside of any '=over' - Around line 450:
You forgot a '=back' before '=head2' - Around line 550:
Expected '=item 2' - Around line 555:
Expected '=item 3' - Around line 560:
Expected '=item 4'
That's the whole page, bestie β source/version is perl v5.32.0, date is 2020-11-27, and the manpage id is MAGE::...ayDatum(3pm). Stay iconic. π β¨
π¦ 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