MAGE::Experiment(3pm)
π MAGE::Experiment π
okay bestie, so this page is from the User Contributed Perl Documentation β it's the manual for MAGE::Experiment, and it's literally the friend group of classes that make up the Experiment package. pull up a chair, we're doing this together π«Ά
β¨ NAME β¨
Bio::MAGE::Experiment β the container module for the classes in the MAGE package called Experiment. it's giving "collective", it's giving "squad", no cap.
β¨ SYNOPSIS β¨
use Bio::MAGE::Experiment;
that's it. that's the whole vibe. π
β¨ DESCRIPTION β¨
so this is a package module β meaning it's the lil container that holds a whole bunch of classes in the Bio::MAGE hierarchy. those classes all belong to the Experiment package of the MAGE-OM object model. she's a mother, basically. π
β¨ CLASSES β¨
the Bio::MAGE::Experiment module contains these Bio::MAGE classes, periodt:
ExperimentExperimentDesignExperimentalFactorFactorValue
four icons. no notes. π
β¨ CLASS METHODS β¨
these are the ones you call on the class itself, not on an instance. very "let's talk to the concept, not the object" of them.
@class_list = Bio::MAGE::Experiment::classes();β hands you back a list of the class names in this package, and ngl, they're not fully qualified β meaning there's no'Bio::MAGE::'prefix glued on the front. short names only, bestie.$obj = class->new(%parameters)β this is the class constructor, the main character of every Perl module honestly.- Parameters: if you hand it a list of name/value pairs, the matching slots, attributes, or associations get their initial values set right there by the constructor. so thoughtful.
- Return value: a reference to an object of the class. β¨
- Side effects: it calls
initialize()if the class defines one.
@names = class->get_slot_names()β used to grab the names of all the slots defined in a given class.
NOTE: the list of names does not include attribute or association names. just slots. don't get it twisted. π
- Return value: a list of the names of all slots defined for this class.
- Side effects: none. zero. nothing. clean.
@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. her ancestors, her lineage. πΈ@class_list = get_subclasses()β returns the list of subclasses for this class. her children, her legacy.$name = class_name()β returns the full class name for this class. the whole thing, no abbreviating.$package_name = package_name()β returns the base package name β like, with no'namespace::'on the front β of the package that contains this class.%assns = associations()β returns the association meta-information as a hash. the keys are the association names, and the values areAssociationobjects that hold the meta-information for that association. very meta, very slay.
β¨ INSTANCE METHODS β¨
now we're talking to actual objects. this is where it gets personal. π
$obj_copy = $obj->new()β plot twist!! when you callnew()on an existing object reference instead of on a class name, it acts as a copy constructor β the new object starts out with all the same initial values as the existing one. she's her own twin. π- Parameters: no input parameters are used in the copy constructor β the initial values come straight from the object being copied.
- Return value: a reference to an object of the class.
- Side effects: it calls
initialize()if the class defines one.
$obj->set_slots(%parameters)$obj->set_slots(\@name_list, \@value_list)βset_slots()sets a bunch of slots at the same time, and it's got two whole invocation styles, because she contains multitudes. option one takes a named parameter list. option two takes two array references.- Return value: none.
- Side effects: it will call
croak()if you use a slot_name that the class doesn't define. so don't be messy. π
@obj_list = $obj->get_slots(@name_list)βget_slots()grabs the values of a bunch of slots all at once. efficiency queen.- Return value: a list of instance objects.
- Side effects: none.
$val = $obj->set_slot($name,$val)βset_slot()sets the slot$nameto the value$val.- 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)β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 hasn't been initialized yet. (that's her "idk her" era. π) - Side effects: none.
- Return value: a single slot value, or
$val = $experiment->xml_lists()$inval = $experiment->xml_lists($inval)β the unified setter/getter for thexml_listsslot. if$invalis specified, the setter runs; with no parameters, the getter runs. one method, two moods.- Input parameters: the optional
$invalwill invoke the setter method. - Return value: for both setter and getter, the current value of the
xml_listsslot. - Side effects: none.
- Exceptions: none.
- Input parameters: the optional
$val = $experiment->tagname()$inval = $experiment->tagname($inval)β the unified setter/getter for thetagnameslot.$invalpresent β setter. no params β getter.- Input parameters: the optional
$invalwill invoke the setter method. - Return value: for both setter and getter, the current value of the
tagnameslot. - Side effects: none.
- Exceptions: none.
- Input parameters: the optional
$val = $experiment->experiment_list()$inval = $experiment->experiment_list($inval)β the unified setter/getter for theexperiment_listslot. same energy:$invalβ setter, nothing β getter.- Input parameters: the optional
$invalwill invoke the setter method. - Return value: for both setter and getter, the current value of the
experiment_listslot. - Side effects: none.
- Exceptions: none.
- Input parameters: the optional
$array_ref = $experiment->getExperiment_list()β this one handles the list for theBio::MAGE::Experiment::Experimentclass. it returns a reference to an array of the class objects that have been associated with the package instance.
it's literally so useful when you're retrieving data from a parsed MAGE-ML file. that's the whole point, bestie. π
$experiment->addExperiment(@vals)β this is the interface for addingBio::MAGE::Experiment::Experimentobjects to theexperiment_listlist. it's generally used by generic methods like the ones in the XMLWriter. she's a helper, a team player. π«Ά- Input parameters: the list of values
@valsto add to the owner association. NOTE: submitting a single value is permitted. yes, one is enough, she's flexible. - Return value: none.
- Side effects: none.
- Exceptions: will call
croak()if no input parameters are specified, or if any of the objects in@valsis not a subclass of the classBio::MAGE::Experiment::Experiment. no fakes allowed. π
- Input parameters: the list of values
$experiment->obj2xml($writer)β writes out this object, and all sub-objects, as XML, using the supplied$writerto actually do the formatting. the writer does the heavy lifting, she just directs.- Input parameters:
$writermust be an XML writer, e.g. an instance ofBio::MAGE::XML::Writer. it must have the methods:write_start_tag(),write_end_tag(), andobj2xml(). - Return value: none.
- Side effects: all writing is delegated to the
$writerβ itswrite_start_tag()andwrite_end_tag()methods get invoked with the appropriate data, and all class sub-objects of theBio::MAGE::Experimentinstance will have theirobj2xml()methods invoked in turn. by letting the$writerdo the actual formatting of the output XML, it enables the user to precisely control the format. that's the whole flex. π₯ - Exceptions: will call
croak()if no identifier has been set for theBio::MAGE::Experimentinstance. she needs a name, okay?!
- Input parameters:
$experiment->register($obj)β stores an object for later writing as XML. putting it on the waitlist, essentially. β¨- Input parameters: the object to be added to the list of registered objects.
- Return value: none.
- Side effects: if
$objneeds to be stored by this class, a reference will be stored in the correct XML list for this class. - Exceptions: none.
β¨ 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". three flavors, all valid. π
πΈ SLOTS πΈ
this API uses the term "slot" for a data member of the class that was not present in the UML model β it's used mainly for internal purposes, so likeβ¦ only touch it if you genuinely understand the inner workings of the API. i'm serious, bestie. π most often, slots are used by generic methods like the ones in the XML writing and reading classes.
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);β stores$new_varin the slot β and the return value is also$new_var. cute, she echoes back.@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. 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. these are the legit ones, the ones with paperwork. π
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: ensures 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 that, you probably should be using the add* methods instead. just saying. π DATA CHECKING: for attributes, ensures that a single value is provided as the argument. for associations, if the association has list cardinality, ensures that the argument is a reference to an array of instances of the correct MAGE-OM class β otherwise, ensures that there's 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: ensures 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. equal opportunity methods, we love to see it. π
$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 on this page for a detailed description of these methods β they're all up in the INSTANCE METHODS section, bestie, go look. π
β¨ BUGS β¨
found a bug? please send bug reports to the project mailing list: (mged-mage 'at' lists 'dot' sf 'dot' net). she's listening, she wants to hear you out. π«Ά
β¨ AUTHOR β¨
Jason E. Stewart (jasons 'at' cpan 'dot' org) β the icon, the legend. π
β¨ SEE ALSO β¨
and that's the whole page, bestie!! π this was MAGE::Experiment(3pm) from perl v5.32.0, dated 2020-11-27. go forth and build your experiments, you absolute main character. slay π
β¨π¦
π¦ 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