MAGE::...ontents(3pm)
π MAGE::...ontents(3pm) π
okay so the page you're reading is MAGE::...ontents(3pm) from the User Contributed Perl Documentation crowd, and the class it's actually about is Bio::MAGE::HigherLevelAnalysis::NodeContents. bestie, it is a whole thing. this is part 1 of 3, so we are not even close to done, stay with me π«Ά
β¨ NAME β¨
Bio::MAGE::HigherLevelAnalysis::NodeContents β a class for the MAGE-OM API. that's it, that's the name, iconic behavior honestly π
π SYNOPSIS π
here's the vibe check on how you'd actually use it, verbatim:
use Bio::MAGE::HigherLevelAnalysis::NodeContents
# creating an empty instance
my $nodecontents = Bio::MAGE::HigherLevelAnalysis::NodeContents->new();
# creating an instance with existing data
my $nodecontents = Bio::MAGE::HigherLevelAnalysis::NodeContents->new(
designElementDimension=>$designelementdimension_ref,
bioAssayDimension=>$bioassaydimension_ref,
descriptions=>\@description_list,
auditTrail=>\@audit_list,
security=>$security_ref,
propertySets=>\@namevaluetype_list,
quantitationDimension=>$quantitationtypedimension_ref,
);
# 'designElementDimension' association
my $designelementdimension_ref = $nodecontents->designElementDimension(); # getter
$nodecontents->designElementDimension($designelementdimension_ref); # setter
# 'bioAssayDimension' association
my $bioassaydimension_ref = $nodecontents->bioAssayDimension(); # getter
$nodecontents->bioAssayDimension($bioassaydimension_ref); # setter
# 'descriptions' association
my $description_array_ref = $nodecontents->descriptions(); # getter
$nodecontents->descriptions(\@description_list); # setter
# 'auditTrail' association
my $audit_array_ref = $nodecontents->auditTrail(); # getter
$nodecontents->auditTrail(\@audit_list); # setter
# 'security' association
my $security_ref = $nodecontents->security(); # getter
$nodecontents->security($security_ref); # setter
# 'propertySets' association
my $namevaluetype_array_ref = $nodecontents->propertySets(); # getter
$nodecontents->propertySets(\@namevaluetype_list); # setter
# 'quantitationDimension' association
my $quantitationtypedimension_ref = $nodecontents->quantitationDimension(); # getter
$nodecontents->quantitationDimension($quantitationtypedimension_ref); # setter
see how every association gets a getter and a setter? yeah. that's the whole pattern. getters read, setters write, we love a consistent queen π
π¦ DESCRIPTION π¦
straight from the MAGE-OM documentation for the NodeContents class, and I am quoting here so nobody comes for me:
The contents of a node for any or all of the three Dimensions. If a node only contained genes just the DesignElementDimension would be defined.
lowkey that's the entire concept. a node can hold stuff from any of the three Dimensions, or all of them, and if it's just genes then only DesignElementDimension gets filled in. flexible, honestly πΈ
π INHERITANCE π
Bio::MAGE::HigherLevelAnalysis::NodeContents has these superclasses, i.e. the family it came from:
Bio::MAGE::Describable
so everything Describable can do? yeah, this class inherits that energy. it's giving nepotism but make it object-oriented π§
β¨ CLASS METHODS β¨
okay so here's the cute part β all of these can be called without an instance first, using the Bio::MAGE::HigherLevelAnalysis::NodeContents->methodname() syntax. no new required, no waiting around π
new(), new(%args)
the object constructor new() takes these optional named-value style arguments, and yes, they're all optional, live your truth:
descriptionsβ sets the value of thedescriptionsassociation (this one was inherited fromBio::MAGE::Describable, a little hand-me-down but make it fashion).- the value must be of type: array of
Bio::MAGE::Description::Description.
- the value must be of type: array of
bioAssayDimensionβ sets the value of thebioAssayDimensionassociation.- the value must be of type: instance of
Bio::MAGE::BioAssayData::BioAssayDimension.
- the value must be of type: instance of
designElementDimensionβ sets the value of thedesignElementDimensionassociation.- the value must be of type: instance of
Bio::MAGE::BioAssayData::DesignElementDimension.
- the value must be of type: instance of
securityβ sets the value of thesecurityassociation (inherited fromBio::MAGE::Describable).- the value must be of type: instance of
Bio::MAGE::AuditAndSecurity::Security.
- the value must be of type: instance of
auditTrailβ sets the value of theauditTrailassociation (also inherited fromBio::MAGE::Describable).- the value must be of type: array of
Bio::MAGE::AuditAndSecurity::Audit.
- the value must be of type: array of
propertySetsβ sets the value of thepropertySetsassociation (inherited fromBio::MAGE::Extendable).- the value must be of type: array of
Bio::MAGE::NameValueType.
- the value must be of type: array of
quantitationDimensionβ sets the value of thequantitationDimensionassociation.- the value must be of type: instance of
Bio::MAGE::BioAssayData::QuantitationTypeDimension.
- the value must be of type: instance of
$obj = class->new(%parameters)
new() 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 right there by the constructor. one-stop shopping β¨
- Return value: a reference to an object of the class.
- Side effects: it invokes the
initialize()method if the class defines one.
@names = class->get_slot_names()
get_slot_names() grabs the name of every slot defined in a given class.
NOTE: the list of names does not include attribute or association names. don't get it twisted π
- Return value: a list of the names of all slots defined for this class.
- Side effects: none. zero. nada.
@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. very meta, very chic π
π«Ά INSTANCE METHODS π«Ά
$obj_copy = $obj->new()
when you invoke new() on an existing object reference and not on a class name, it acts as a copy constructor β the new object's initial values get set to those of the existing object. clone era π
- Parameters: no input parameters are used in the copy constructor, the initial values are taken directly from the object to be copied.
- Return value: 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)
set_slots() 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 make up slot names. it will notice. π
@obj_list = $obj->get_slots(@name_list)
get_slots() gets 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)
set_slot() 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)
get_slot() 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 β one to write, one to read, no multitasking π¦
Bio::MAGE::HigherLevelAnalysis::NodeContents has the following attribute accessor methods:
(and that's it. that's the list. this class has none. slay, an empty list, iconic minimalism π )
πΈ ASSOCIATIONS πΈ
associations are references to other classes. every association in MAGE-OM has 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 decoder ring:
1β 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::HigherLevelAnalysis::NodeContents has the following association accessor methods:
descriptions
methods for the descriptions association.
from the MAGE-OM documentation:
Free hand text descriptions. Makes available the associations of Description to an instance of Describable.
$array_ref = $nodecontents->setDescriptions($array_ref)
the restricted setter method for the descriptions association.
- Input parameters: the value to which the
descriptionsassociation will be set : a reference to an array of objects of typeBio::MAGE::Description::Description. - Return value: the current value of the
descriptionsassociation : 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. so like, get it right or get croaked π
$array_ref = $nodecontents->getDescriptions()
the restricted getter method for the descriptions association.
- Input parameters: none.
- Return value: the current value of the
descriptionsassociation : 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. yeah, zero arguments only, it's not negotiable π
$val = $nodecontents->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
𧬠bioAssayDimension π§¬
Methods for the bioAssayDimension association.
From the MAGE-OM documentation:
The relevant BioAssays for this NodeContents from the BioAssayData.
$val = $nodecontents->setBioAssayDimension($val)β the restricted setter method for thebioAssayDimensionassociation.- Input parameters: the value to which the
bioAssayDimensionassociation will be set : one of the accepted enumerated values. - Return value: the current value of the
bioAssayDimensionassociation : 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::BioAssayData::BioAssayDimension
- Input parameters: the value to which the
$val = $nodecontents->getBioAssayDimension()β the restricted getter method for thebioAssayDimensionassociation.- Input parameters: none
- Return value: the current value of the
bioAssayDimensionassociation : an instance of typeBio::MAGE::BioAssayData::BioAssayDimension. - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
π designElementDimension π
Methods for the designElementDimension association.
From the MAGE-OM documentation:
The relevant DesignElements for this NodeContents from the BioAssayData.
$val = $nodecontents->setDesignElementDimension($val)β the restricted setter method for thedesignElementDimensionassociation.- Input parameters: the value to which the
designElementDimensionassociation will be set : one of the accepted enumerated values. - Return value: the current value of the
designElementDimensionassociation : 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::BioAssayData::DesignElementDimension
- Input parameters: the value to which the
$val = $nodecontents->getDesignElementDimension()β the restricted getter method for thedesignElementDimensionassociation.- Input parameters: none
- Return value: the current value of the
designElementDimensionassociation : an instance of typeBio::MAGE::BioAssayData::DesignElementDimension. - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
π security π
Methods for the security association.
From the MAGE-OM documentation:
Information on the security for the instance of the class.
$val = $nodecontents->setSecurity($val)β the restricted setter method for thesecurityassociation.- Input parameters: the value to which the
securityassociation will be set : one of the accepted enumerated values. - Return value: the current value of the
securityassociation : 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::AuditAndSecurity::Security
- Input parameters: the value to which the
$val = $nodecontents->getSecurity()β the restricted getter method for thesecurityassociation.- Input parameters: none
- 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
π΅οΈ auditTrail π΅οΈ
Methods for the auditTrail association.
From the MAGE-OM documentation:
A list of Audit instances that track changes to the instance of Describable.
$array_ref = $nodecontents->setAuditTrail($array_ref)β the restricted setter method for theauditTrailassociation.- Input parameters: the value to which the
auditTrailassociation will be set : a reference to an array of objects of typeBio::MAGE::AuditAndSecurity::Audit - Return value: the current value of the
auditTrailassociation : 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
- Input parameters: the value to which the
$array_ref = $nodecontents->getAuditTrail()β the restricted getter method for theauditTrailassociation.- Input parameters: none
- Return value: the current value of the
auditTrailassociation : 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 = $nodecontents->addAuditTrail(@vals)β because theauditTrailassociation has list cardinality, it may store more than one value. This method adds the current list of objects in theauditTrailassociation.- Input parameters: the list of values
@valsto add to theauditTrailassociation. 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
- Input parameters: the list of values
π 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 = $nodecontents->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 = $nodecontents->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 = $nodecontents->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
π quantitationDimension π
Methods for the quantitationDimension association.
From the MAGE-OM documentation:
The relevant QuantitationTypes for this NodeContents from the BioAssayData.
$val = $nodecontents->setQuantitationDimension($val)β the restricted setter method for thequantitationDimensionassociation.- Input parameters: the value to which the
quantitationDimensionassociation will be set : one of the accepted enumerated values. - Return value: the current value of the
quantitationDimensionassociation : 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::BioAssayData::QuantitationTypeDimension
- Input parameters: the value to which the
$val = $nodecontents->getQuantitationDimension()β the restricted getter method for thequantitationDimensionassociation.- Input parameters: none
- Return value: the current value of the
quantitationDimensionassociation : an instance of typeBio::MAGE::BioAssayData::QuantitationTypeDimension. - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
And then, bestie, there's this lil guy just vibing at the end of the method list β no docs, no drama, just a classic Perl constructor doing its thing π«Ά
sub initialize {
my $self = shift;
return 1;
}
π SLOTS, ATTRIBUTES, AND ASSOCIATIONS π
okay bestie so in the Perl implementation of MAGE-OM classes, there are literally three types of class data members, and you need to know all of them: "slots", "attributes", and "associations". that's the whole trio, no more no less π
β¨ SLOTS β¨
so this API uses the term "slot" to mean a data member of the class that was NOT present in the UML model. it's there for mainly internal purposes, so β and I need you to hear me on this β use only if you understand the inner workings of the API. like, fr fr. most of the time slots get used by generic methods, the kind you'd find in the XML writing and reading classes π«Ά
slots are implemented using unified getter/setter methods:
$var = $obj->slot_name();β grabs the current value of the slot.$new_var = $obj->slot_name($new_var);β stores$new_varin the slot, and the return value is also$new_var. cute, right? it gives you back what you put in β¨@names = $obj->get_slot_names()β returns the list of all slots in the class.
DATA CHECKING: nope, zero. no data type checking is made for these methods. none. nada. π
πΈ ATTRIBUTES AND ASSOCIATIONS πΈ
the terms "attribute" and "association" mean data members of the class that were specified directly from the UML model. so these are the real ones, the ones the model actually asked for π
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. like, that's the vibe check it's giving. - 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.- 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)
like, tell them everything bestie, they wanna know π
π AUTHOR π
Jason E. Stewart (jasons 'at' cpan 'dot' org)
we stan π«Ά
π SEE ALSO π
π POD ERRORS π
hey! the above document had some coding errors, which are explained below:
- around line 395:
'=item' outside of any '=over'
- around line 480:
- you forgot a
'=back'before a'=head2'
- you forgot a
- around line 508:
- expected
'=item 2'
- expected
- around line 513:
- expected
'=item 3'
- expected
- around line 518:
- expected
'=item 4'
- expected
not the POD errors catching strays π but honestly, iconic that they just... tell you. transparency queen.
and that's the whole page, bestie!! β¨ this doc ships with perl v5.32.0 and was dated 2020-11-27, so if you're reading this from some dusty archive, that's why. go forth and subclass responsibly ππ¦π
π¦ 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