MAGE::...apping(3pm)
π MAGE::...apping(3pm) β User Contributed Perl Documentation π
okay bestie, settle in, because we're about to get deep into Bio::MAGE::BioAssayData::DesignElementMapping, and honestly? she's giving quiet-legend energy. this is part one, so hydrate, sit pretty, and let's go πΈ
β¨ NAME β¨
Bio::MAGE::BioAssayData::DesignElementMapping β the class for the MAGE-OM API. that's it, that's the name, slay π
π SYNOPSIS π
here's the vibe in code form, no cap:
use Bio::MAGE::BioAssayData::DesignElementMapping
# creating an empty instance
my $designelementmapping = Bio::MAGE::BioAssayData::DesignElementMapping->new();
# creating an instance with existing data
my $designelementmapping = Bio::MAGE::BioAssayData::DesignElementMapping->new(
propertySets=>\@namevaluetype_list,
designElementMaps=>\@designelementmap_list,
);
# 'propertySets' association
my $namevaluetype_array_ref = $designelementmapping->propertySets(); # getter
$designelementmapping->propertySets(\@namevaluetype_list); # setter
# 'designElementMaps' association
my $designelementmap_array_ref = $designelementmapping->designElementMaps(); # getter
$designelementmapping->designElementMaps(\@designelementmap_list); # setter
likeβ¦ new with no args? iconic. new with args? also iconic. getter and setter for days π«Ά
π DESCRIPTION π
straight from the MAGE-OM documentation for the DesignElementMapping class, and I'm quoting here because the source is the moment:
Container of the mappings of the input DesignElement dimensions to the output DesignElement dimension.
so basically she's the container. the keeper of the mappings. the way that the input DesignElement dimensions get mapped to the output DesignElement dimension?? that's her job. main character energy fr fr π
π¦ INHERITANCE π¦
Bio::MAGE::BioAssayData::DesignElementMapping has the following superclasses (her ancestors, her lineage, her bloodline):
Bio::MAGE::Extendable
one superclass, one legend to thank β¨
π CLASS METHODS π
the tea here is delicious: every single one of these methods can be called without first having an instance of the class. yes bestie, no object required. you just use the
Bio::MAGE::BioAssayData::DesignElementMapping->methodname()
syntax. class-level, no commitment, we love a low-maintenance queen π
π new()
π new(%args)
the object constructor new() accepts the following optional named-value style arguments (and yes, "optional" means you can just⦠not):
propertySetsβ sets the value of thepropertySetsassociation. and get this, this association was inherited from classBio::MAGE::Extendableβ generational wealth π. the value must be of type: array ofBio::MAGE::NameValueType.designElementMapsβ sets the value of thedesignElementMapsassociation. the value must be of type: array ofBio::MAGE::BioAssayData::DesignElementMap.
π $obj = class->new(%parameters)
the new() method is the class constructor. the blueprint. the origin story.
- Parameters: if given a list of name/value parameters, the corresponding slots, attributes, or associations will have their initial values set by the constructor. so you hand her a lil list and she sets everything up accordingly, periodt.
- Return value: it returns a reference to an object of the class. a whole new baby object, yours to raise πΌ
- 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. so don't come for her asking where those are, okay? π
- Return value: a list of the names of all slots defined for this class.
- Side effects: none. zero. nada. she's clean, she's chill, she causes no drama π
π @name_list = get_attribute_names()
returns the list of attribute data members for this class. your attribute roster, bestie π
π @name_list = get_association_names()
returns the list of association data members for this class. the association roster, equally valid, equally slay π
π @class_list = get_superclasses()
returns the list of superclasses for this class. her ancestors, again, in case you forgot who raised her β
π @class_list = get_subclasses()
returns the list of subclasses for this class. her descendants. her legacy. the ones who carry the name forward π
π $name = class_name()
returns the full class name for this class. the whole government name, not the nickname π
π $package_name = package_name()
returns the base package name (i.e. no namespace::) of the package that contains this class. just the base, no namespace, keep it cute β¨
π %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. it's giving receipts, it's giving documentation, it's giving everything π«Ά
okay and that's only part one β more is coming, so don't go anywhere, bestie π
π INSTANCE METHODS π
okay bestie, now we get to the doing stuff, the methods you actually call on a live object. buckle up π
$obj_copy = $obj->new()
When you invoke new() on an existing object reference instead of on a class name, it switches hats and becomes a copy constructor β the brand-new object starts life with all the initial values of the object you copied. it's giving clone era, no cap π
- Parameters: No input parameters are used in the copy constructor β the initial values are taken directly from the object to be copied. literally just vibes and inheritance of state β¨
- 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. so heads up, that hook is gonna fire π
$obj->set_slots(%parameters)
$obj->set_slots(\@name_list, \@value_list)
The set_slots() method is your bulk-set moment β it 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 don't make up slot names, she WILL yell at you π
@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. group chat energy but for values πΈ
- 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. one slot, one value, very demure, very mindful π
- 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. (yes bestie, that's what it says, i'm just the messenger π«Ά)
- Return value: a single slot value, or
undefif the slot has not been initialized. soundefis not a glitch, it's a state β¨ - 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. no shared accessor shenanigans, each one gets her own π
Bio::MAGE::BioAssayData::DesignElementMapping has the following attribute accessor methods:
ngl, the list is empty, so that's the whole bit. iconic of her tbh π
πΈ 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. it's basically the relationship status of your data π
- 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::DesignElementMapping 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.
lowkey the "miscellaneous" drawer of the spec, and honestly? we love her for it ποΈβ¨
$array_ref = $designelementmapping->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_ref is not a reference to an array classBio::MAGE::NameValueTypeinstances. she is strict, bestie, and honestly? respect π
- Input parameters: the value to which the
$array_ref = $designelementmapping->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. hand her nothing and she's happy π«Ά
$val = $designelementmapping->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. it's the "and also these" button π- Input parameters: the list of values
@valsto add to the propertySets association. NOTE: submitting a single value is permitted. (one is a list too, we don't judge πΈ) - 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
designElementMaps
Methods for the designElementMaps association.
From the MAGE-OM documentation:
The maps for the DesignElements.
short and confident, we stan a one-line description π
$array_ref = $designelementmapping->setDesignElementMaps($array_ref)β The restricted setter method for thedesignElementMapsassociation.- Input parameters: the value to which the
designElementMapsassociation will be set : a reference to an array of objects of typeBio::MAGE::BioAssayData::DesignElementMap - Return value: the current value of the
designElementMapsassociation : a reference to an array of objects of typeBio::MAGE::BioAssayData::DesignElementMap - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified, or if $array_ref is not a reference to an array classBio::MAGE::BioAssayData::DesignElementMapinstances
- Input parameters: the value to which the
$array_ref = $designelementmapping->getDesignElementMaps()β The restricted getter method for thedesignElementMapsassociation.- Input parameters: none
- Return value: the current value of the
designElementMapsassociation : a reference to an array of objects of typeBio::MAGE::BioAssayData::DesignElementMap - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
$val = $designelementmapping->addDesignElementMaps(@vals)β Because the designElementMaps association has list cardinality, it may store more than one value. This method adds the current list of objects in the designElementMaps association. stacking them up like a little collection π¦- Input parameters: the list of values
@valsto add to the designElementMaps 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::BioAssayData::DesignElementMap
- Input parameters: the list of values
and then there's this lil guy hanging out at the end, verbatim:
sub initialize {
my $self = shift;
return 1;
}
not me including a whole subroutine definition in the middle of a manpage π slay i guess
π SLOTS, ATTRIBUTES, AND ASSOCIATIONS π
In the Perl implementation of MAGE-OM classes, there are three types of class data members: slots, attributes, and associations. trio of chaos, but in a good way β¨
π§ 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 β 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.
β οΈ fr fr, if you don't know the internals, stay out of the slots. this is the "employees only" door πͺπ
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_var in the slot - the return value is also $new_var. two-for-one, we love efficiency π@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. yeah. none. zero. she trusts you completely π
π ATTRIBUTES AND ASSOCIATIONS π
The terms attribute and association indicate data members of the class that were specified directly from the UML model.
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. (she said it, not me π) - 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. very "and also" 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. (yes, we already covered them up top β scroll back bestie π«Ά)
π BUGS π
Please send bug reports to the project mailing list: (mged-mage 'at' lists 'dot' sf 'dot' net)
not me having to write the email like it's a riddle so the spambots don't find it π classic
π«Ά 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. she's not perfect, she's just like us π
- Around line 290:
'=item' outside of any '=over' - Around line 375:
You forgot a '=back' before '=head2' - Around line 403:
Expected '=item 2' - Around line 408:
Expected '=item 3' - Around line 413:
Expected '=item 4'
and that's the whole page bestie!! πβ¨ this was rendered by perl v5.32.0, dated 2020-11-27, filed under MAGE::...apping(3pm) β go forth and map those DesignElements, you absolute main character ππ
π¦ 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