MAGE::...orValue(3pm)
π NAME π
Bio::MAGE::Experiment::FactorValue β the class for the MAGE-OM API, bestie. And yeah, the manual page is called MAGE::...orValue(3pm) (User Contributed Perl Documentation, if you were wondering who to blame π«Ά).
β¨ SYNOPSIS β¨
okay so here's the whole vibe in code form, no cap:
use Bio::MAGE::Experiment::FactorValue
# creating an empty instance
my $factorvalue = Bio::MAGE::Experiment::FactorValue->new();
# creating an instance with existing data
my $factorvalue = Bio::MAGE::Experiment::FactorValue->new(
name=>$name_val,
identifier=>$identifier_val,
measurement=>$measurement_ref,
value=>$ontologyentry_ref,
auditTrail=>\@audit_list,
propertySets=>\@namevaluetype_list,
experimentalFactor=>$experimentalfactor_ref,
descriptions=>\@description_list,
security=>$security_ref,
);
# 'name' attribute
my $name_val = $factorvalue->name(); # getter
$factorvalue->name($value); # setter
# 'identifier' attribute
my $identifier_val = $factorvalue->identifier(); # getter
$factorvalue->identifier($value); # setter
# 'measurement' association
my $measurement_ref = $factorvalue->measurement(); # getter
$factorvalue->measurement($measurement_ref); # setter
# 'value' association
my $ontologyentry_ref = $factorvalue->value(); # getter
$factorvalue->value($ontologyentry_ref); # setter
# 'auditTrail' association
my $audit_array_ref = $factorvalue->auditTrail(); # getter
$factorvalue->auditTrail(\@audit_list); # setter
# 'propertySets' association
my $namevaluetype_array_ref = $factorvalue->propertySets(); # getter
$factorvalue->propertySets(\@namevaluetype_list); # setter
# 'experimentalFactor' association
my $experimentalfactor_ref = $factorvalue->experimentalFactor(); # getter
$factorvalue->experimentalFactor($experimentalfactor_ref); # setter
# 'descriptions' association
my $description_array_ref = $factorvalue->descriptions(); # getter
$factorvalue->descriptions(\@description_list); # setter
# 'security' association
my $security_ref = $factorvalue->security(); # getter
$factorvalue->security($security_ref); # setter
πΈ DESCRIPTION πΈ
straight from the MAGE-OM documentation for the "FactorValue" class:
The value for a ExperimentalFactor
like. it's giving "the answer to the question the factor is asking." iconic honestly π
π¦ INHERITANCE π¦
Bio::MAGE::Experiment::FactorValue has these superclasses, bestie:
Bio::MAGE::Identifiable
π CLASS METHODS π
okay so all of these can be called without making an instance first β just do the whole Bio::MAGE::Experiment::FactorValue->methodname() thing. periodt.
new()
new(%args)
the object constructor "new()" accepts these optional named-value style arguments (so you pass them like key=>value, you know the drill):
nameβ sets the value of the"name"attribute (this attribute was inherited from class"Bio::MAGE::Identifiable").identifierβ sets the value of the"identifier"attribute (this attribute was inherited from class"Bio::MAGE::Identifiable").valueβ sets the value of the"value"association.
The value must be of type: instance of "Bio::MAGE::Description::OntologyEntry".
measurementβ sets the value of the"measurement"association.
The value must be of type: instance of "Bio::MAGE::Measurement::Measurement".
auditTrailβ sets the value of the"auditTrail"association (this association was inherited from class"Bio::MAGE::Describable").
The value must be of type: array of "Bio::MAGE::AuditAndSecurity::Audit".
propertySetsβ sets the value of the"propertySets"association (this association was inherited from class"Bio::MAGE::Extendable").
The value must be of type: array of "Bio::MAGE::NameValueType".
experimentalFactorβ sets the value of the"experimentalFactor"association.
The value must be of type: instance of "Bio::MAGE::Experiment::ExperimentalFactor".
descriptionsβ sets the value of the"descriptions"association (this association was inherited from class"Bio::MAGE::Describable").
The value must be of type: array of "Bio::MAGE::Description::Description".
securityβ sets the value of the"security"association (this association was inherited from class"Bio::MAGE::Describable").
The value must be of type: instance of "Bio::MAGE::AuditAndSecurity::Security".
$obj = class->new(%parameters)
the "new()" method is the class constructor. main character energy, obviously.
Parameters: if you hand it a list of name/value parameters, the corresponding slots, attributes, or associations get 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's defined by the class.
@names = class->get_slot_names()
the "get_slot_names()" method is how you pull the name of every slot defined in a given class.
NOTE: the list of names does not include attribute or association names. just saying π
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. slay.
@name_list = get_association_names()
returns the list of association data members for this class. also slay.
@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. lowkey useful ngl.
π INSTANCE METHODS π
$obj_copy = $obj->new()
when you invoke it on an existing object reference (not a class name), the "new()" method acts as a copy constructor β the new object's initial values get set to those of the existing object. it's giving clone, it's giving twin π―
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's defined by the class.
$obj->set_slots(%parameters)
$obj->set_slots(\@name_list, \@value_list)
the "set_slots()" method sets 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. pick your fighter π₯
Return value: none.
Side effects: will call "croak()" if a slot_name is used that the class does not define. so like, don't.
@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 undef if 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 yes, two methods per attribute, we love a consistent API).
"Bio::MAGE::Experiment::FactorValue" has these attribute accessor methods:
name
methods for the "name" attribute.
from the MAGE-OM documentation:
The potentially ambiguous common identifier.
$val = $factorvalue->setName($val)β the restricted setter method for the"name"attribute.
Input parameters: the value to which the "name" attribute will be set.
Return value: the current value of the "name" attribute.
Side effects: none.
Exceptions: will call "croak()" if no input parameters are specified, or if too many input parameters are specified. so like, exactly one (1) please π
$val = $factorvalue->getName()β the restricted getter method for the"name"attribute.
Input parameters: none.
Return value: the current value of the "name" attribute.
Side effects: none.
Exceptions: will call "croak()" if any input parameters are specified.
identifier
methods for the "identifier" attribute.
from the MAGE-OM documentation:
An identifier is an unambiguous string that is unique within the scope (i.e. a document, a set of related documents, or a repository) of its use.
$val = $factorvalue->setIdentifier($val)β the restricted setter method for the"identifier"attribute.
Input parameters: the value to which the "identifier" attribute will be set.
Return value: the current value of the "identifier" attribute.
Side effects: none.
Exceptions: will call "croak()" if no input parameters are specified, or if too many input parameters are specified.
$val = $factorvalue->getIdentifier()β the restricted getter method for the"identifier"attribute.
Input parameters: none.
Return value: the current value of the "identifier" attribute.
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 may be included in the association. here's the whole menu, bestie:
- 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.
(more of this page is coming, bestie β don't go anywhere) π«Ά
okay so Bio::MAGE::Experiment::FactorValue has all of these association accessor methods, and we're gonna go through every single one bestie, no skips, no shortcuts π
π value π
Methods for the "value" association, bestie.
From the MAGE-OM documentation:
Allows a more complex value to be specified for a FactorValue than a simple Measurement.
$val = $factorvalue->setValue($val)
The restricted setter method for the "value" association. it's giving "you set it, you get it back" β¨
- Input parameters: the value to which the
"value"association will be set : one of the accepted enumerated values. - Return value: the current value of the
"value"association : 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::Description::OntologyEntry
$val = $factorvalue->getValue()
The restricted getter method for the "value" association. no thoughts, just fetch π«Ά
- Input parameters: none
- Return value: the current value of the
"value"association : an instance of typeBio::MAGE::Description::OntologyEntry. - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
πΈ measurement πΈ
Methods for the "measurement" association, periodt.
From the MAGE-OM documentation:
The measured value for this factor.
$val = $factorvalue->setMeasurement($val)
The restricted setter method for the "measurement" association. the way that this one just... sets the measurement π iconic.
- Input parameters: the value to which the
"measurement"association will be set : one of the accepted enumerated values. - Return value: the current value of the
"measurement"association : 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::Measurement::Measurement
$val = $factorvalue->getMeasurement()
The restricted getter method for the "measurement" association.
- Input parameters: none
- Return value: the current value of the
"measurement"association : an instance of typeBio::MAGE::Measurement::Measurement. - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
π auditTrail π
Methods for the "auditTrail" association. receipts, basically. it keeps receipts π
From the MAGE-OM documentation:
A list of Audit instances that track changes to the instance of Describable.
$array_ref = $factorvalue->setAuditTrail($array_ref)
The restricted setter method for the "auditTrail" association.
- Input parameters: the value to which the
"auditTrail"association will be set : a reference to an array of objects of typeBio::MAGE::AuditAndSecurity::Audit - Return value: the current value of the
"auditTrail"association : a reference to an array of objects of typeBio::MAGE::AuditAndSecurity::Audit - 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::AuditAndSecurity::Auditinstances
$array_ref = $factorvalue->getAuditTrail()
The restricted getter method for the "auditTrail" association.
- Input parameters: none
- Return value: the current value of the
"auditTrail"association : a reference to an array of objects of typeBio::MAGE::AuditAndSecurity::Audit - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
$val = $factorvalue->addAuditTrail(@vals)
Because the auditTrail association has list cardinality, it may store more than one value. This method adds the current list of objects in the auditTrail association. so like, it's a pile, and you're adding to the pile π
- Input parameters: the list of values
@valsto add to the auditTrail 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::AuditAndSecurity::Audit
π¦ propertySets π¦
Methods for the "propertySets" association. this is the "put whatever you want here" corner of the class, and honestly? obsessed.
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 = $factorvalue->setPropertySets($array_ref)
The restricted setter method for the "propertySets" association.
- Input parameters: the value to which the
"propertySets"association will be set : a reference to an array of objects of typeBio::MAGE::NameValueType - Return value: the current value of the
"propertySets"association : 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
$array_ref = $factorvalue->getPropertySets()
The restricted getter method for the "propertySets" association.
- Input parameters: none
- Return value: the current value of the
"propertySets"association : 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 = $factorvalue->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
β experimentalFactor β
Methods for the "experimentalFactor" association. the main-character pairing of this whole thing, fr fr.
From the MAGE-OM documentation:
The pairing of BioAssay FactorValues with the ExperimentDesign ExperimentFactor.
$val = $factorvalue->setExperimentalFactor($val)
The restricted setter method for the "experimentalFactor" association.
- Input parameters: the value to which the
"experimentalFactor"association will be set : one of the accepted enumerated values. - Return value: the current value of the
"experimentalFactor"association : 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::Experiment::ExperimentalFactor
$val = $factorvalue->getExperimentalFactor()
The restricted getter method for the "experimentalFactor" association.
- Input parameters: none
- Return value: the current value of the
"experimentalFactor"association : an instance of typeBio::MAGE::Experiment::ExperimentalFactor. - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
π descriptions π
Methods for the "descriptions" association. freeform text bestie, write a whole essay if you want.
From the MAGE-OM documentation:
Free hand text descriptions. Makes available the associations of Description to an instance of Describable.
$array_ref = $factorvalue->setDescriptions($array_ref)
The restricted setter method for the "descriptions" association.
- Input parameters: the value to which the
"descriptions"association will be set : a reference to an array of objects of typeBio::MAGE::Description::Description - Return value: the current value of the
"descriptions"association : a reference to an array of objects of typeBio::MAGE::Description::Description - 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::Description::Descriptioninstances
$array_ref = $factorvalue->getDescriptions()
The restricted getter method for the "descriptions" association.
- Input parameters: none
- Return value: the current value of the
"descriptions"association : a reference to an array of objects of typeBio::MAGE::Description::Description - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
$val = $factorvalue->addDescriptions(@vals)
Because the descriptions association has list cardinality, it may store more than one value. This method adds the current list of objects in the descriptions association.
- Input parameters: the list of values
@valsto add to the descriptions 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::Description::Description
π₯ security π₯
Methods for the "security" association.
From the MAGE-OM documentation:
Information on the security for the instance of the class.
$val = $factorvalue->setSecurity($val)
The restricted setter method for the "security" association.
okay bestie so the setter for the security association? It's giving "put something here, I'm listening." π
- Input parameters: the value you want to shove into the
securityassociation β and it has to be one of the accepted enumerated values, no freestyling. - Return value: the current value of the
securityassociation β one of the accepted enumerated values. Yes it hands it right back to you, iconic. - Side effects: none. She's low maintenance.
- Exceptions: she will
croak()at you if you pass no input parameters, if you pass too many input parameters, or if$valis not an instance of the classBio::MAGE::AuditAndSecurity::Security. So basically: right amount, right type, or croak city. π
π the getter that minds her own business
$val = $factorvalue->getSecurity()
The restricted getter method for the security association.
- Input parameters: none. Zero. Nada. Don't even try it. π
- Return value: the current value of the
securityassociation β an instance of typeBio::MAGE::AuditAndSecurity::Security. - Side effects: none β¨
- Exceptions: will call
croak()if any input parameters are specified. She said restricted, and she meant it, fr fr.
πΈ the little initialize that could
sub initialize {
my $self = shift;
return 1;
}
That's it. That's the whole thing. She shifts, she returns 1, she goes home. Main character energy, minimal effort, absolute queen. π
π SLOTS, ATTRIBUTES, AND ASSOCIATIONS
So in the Perl implementation of MAGE-OM classes, there are three types of class data members, and you're gonna want to know the difference because the API is very particular about it:
- slots
- attributes
- associations
π SLOTS
This API uses the term "slot" to mean a data member of the class that was not present in the UML model, and it's used for mainly internal purposes. So like β use only if you understand the inner workings of the API. That's the vibe check right there. β οΈ
Most often, slots are used by generic methods, like the ones in the XML writing and reading classes. They're the plumbing, bestie. π°
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 β and the return value is also$new_var. She gives as good as she gets. π@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. None. Zero. You're on your own, bestie, so be careful out there. π
π¦ ATTRIBUTES AND ASSOCIATIONS
The terms "attribute" and "association" indicate data members of the class that were specified directly from the UML model. So these are the real ones, the ones that came from the source material. β¨
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 instead. (Take the hint. π«Ά) - 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.
- 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*β NOTE: Only present in associations with list cardinality.- Appends a list of objects to any values that may already be stored in the association. She's adding, not replacing. Very generous of her. πΈ
- 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. π (iykyk)
π BUGS
Please send bug reports to the project mailing list: (mged-mage 'at' lists 'dot' sf 'dot' net)
Not me begging you to actually report them though. Do it. Be the change. π«Ά
π 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 415:
'=item' outside of any '=over'
- Around line 500:
You forgot a '=back' before '=head2'
- Around line 672:
Expected '=item 2'
- Around line 677:
Expected '=item 3'
- Around line 682:
Expected '=item 4'
and that's the whole page, bestie, you made it to the end π This was documented as perl v5.32.0, dated 2020-11-27, and it's the MAGE::...orValue(3pm) page from the User Contributed Perl Documentation. Go forth and set your associations correctly, mwah π
π
π¦ 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