MAGE::BioAssay(3pm)
๐ NAME ๐
Bio::MAGE::BioAssay โ okay so this is the container module for all the classes hanging out in the MAGE package: BioAssay. It's the group chat, and every class below is a member of it. ๐ซถ
(Also, for the record, this page is MAGE::BioAssay(3pm) from the User Contributed Perl Documentation. Hi. Welcome. You're gonna do great.) ๐
โจ SYNOPSIS โจ
use Bio::MAGE::BioAssay;
That's it. That's the whole vibe. One line and you're in. ๐
๐ฆ DESCRIPTION ๐ฆ
So like, this is a package module, meaning it's not one class โ it's a whole little friend group of classes that all live together in the Bio::MAGE hierarchy. They belong to the BioAssay package of the MAGE-OM object model. If you're building or parsing MAGE-OM stuff, this is your home base, bestie. ๐ โจ
๐ CLASSES ๐
The Bio::MAGE::BioAssay module contains the following Bio::MAGE classes, and no we're not skipping any of them, they all matter:
PhysicalBioAssayDerivedBioAssayImageBioAssayChannelMeasuredBioAssayBioAssayCreationFeatureExtractionHybridizationImageAcquisitionBioAssayTreatment
Look at them. Eleven whole classes. Iconic behavior honestly. ๐
๐ธ CLASS METHODS ๐ธ
These ones you call on the class itself, not on an object. Class-level energy. Main character, but for the whole package.
๐ @class_list = Bio::MAGE::BioAssay::classes();
This hands you back a list of the non-fully qualified class names in this package โ like, they do not have Bio::MAGE:: glued to the front. Short names only, cuties. โ๏ธ
๐ $obj = class->new(%parameters)
The new() method is the class constructor. The classic. The origin story. ๐ฃ
- 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.
- Return value: a reference to an object of the class. Fresh out of the box. ๐
- Side effects: it invokes the
initialize()method if the class defines one.
๐ @names = class->get_slot_names()
get_slot_names() is how you get the name of every slot defined in a given class.
NOTE: this list of names does not include attribute or association names. Slots only, bestie. Don't @ me.
- Return value: a list of the names of all slots defined for this class.
- Side effects: none. Chill as always. ๐
๐ @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. The ancestors. The ones who came before. ๐
๐ @class_list = get_subclasses()
Returns the list of subclasses for this class. The babies. The heirs. ๐ฃ
๐ $name = class_name()
Returns the full class name for this class.
๐ $package_name = package_name()
Returns the base package name โ and that means no namespace:: prefix on it โ 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 are Association objects that carry the meta-information for that association. Meta. Very meta. ๐ฎ
๐ INSTANCE METHODS ๐
Now we're on the object level. You need an actual instance for these, okay?
๐ซ $obj_copy = $obj->new()
Plot twist: when you call new() on an existing object reference instead of a class name, it acts as a copy constructor โ the brand new object's initial values get set to whatever the existing object's values are. Clone arc. ๐งฌ
- Parameters: no input parameters are used in the copy constructor โ the initial values are taken straight from the object being copied.
- Return value: a reference to an object of the class.
- Side effects: it invokes the
initialize()method if the class defines one.
๐ซ $obj->set_slots(%parameters)
๐ซ $obj->set_slots(\@name_list, \@value_list)
set_slots() is the multitasker โ it sets a whole bunch of slots at the same time. It has two different ways you can invoke it:
- The first takes a named parameter list.
- The second 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 likeโฆ don't make up slots. ๐
๐ซ @obj_list = $obj->get_slots(@name_list)
get_slots() gets the values of a bunch of slots all at once. Bulk retrieve, we love efficiency. โก
- 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 at a time, precise, intentional. ๐
- 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
undefif the slot hasn't been initialized yet. Empty. Void. Nothing. ๐ - Side effects: none.
๐ซ $val = $bioassay->xml_lists()
๐ซ $inval = $bioassay->xml_lists($inval)
This is the unified setter/getter for the xml_lists slot. One method, two moods. โจ
If $inval is specified, the setter method gets invoked. With no parameters, the getter method gets invoked.
- 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.
๐ซ $val = $bioassay->tagname()
๐ซ $inval = $bioassay->tagname($inval)
This is the unified setter/getter for the tagname slot.
If $inval is specified, the setter method gets invoked. With no parameters, the getter method gets invoked.
- 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.
๐ซ $val = $bioassay->channel_list()
๐ซ $inval = $bioassay->channel_list($inval)
This is the unified setter/getter for the channel_list slot.
If $inval is specified, the setter method gets invoked. With no parameters, the getter method gets invoked.
- Input parameters: the optional
$invalwill invoke the setter method. - Return value: for both setter and getter, the current value of the
channel_listslot. - Side effects: none.
- Exceptions: none.
๐ซ $val = $bioassay->bioassay_list()
๐ซ $inval = $bioassay->bioassay_list($inval)
This is the unified setter/getter for the bioassay_list slot.
If $inval is specified, the setter method gets invoked. With no parameters, the getter method gets invoked.
- Input parameters: the optional
$invalwill invoke the setter method. - Return value: for both setter and getter, the current value of the
bioassay_listslot. - Side effects: none.
- Exceptions: none.
๐ซ $array_ref = $bioassay->getChannel_list()
This method handles the list for the Bio::MAGE::BioAssay::Channel class. It returns a reference to an array of the class objects that have been associated with the package instance. ๐
This is genuinely useful when you're pulling data out of a parsed MAGE-ML file. Trust. ๐
๐ซ $bioassay->addChannel(@vals)
This one is the interface for adding Bio::MAGE::BioAssay::Channel objects to the channel_list list. It's generally used by generic methods, like the ones hanging out in the XMLWriter. ๐ ๏ธ
- Input parameters: the list of values
@valsto add to the owner association. NOTE: submitting a single value is permitted. One is fine. One is valid. ๐ซถ - Return value: none.
- Side effects: none.
- Exceptions: it will call
croak()if no input parameters are specified, or if any of the objects in@valsis not a subclass of classBio::MAGE::BioAssay::Channel. So like, check your types before you come in here, bestie. ๐ญ
๐ซ $array_ref = $bioassay->getBioAssay_list()
This method handles the list for the Bio::MAGE::BioAssay::BioAssay class. It returns a reference to an array of the class objects that have been associated with the package instance. ๐ฆ
This is useful when retrieving data from a parsed MAGE-ML file. (Yes, same energy as getChannel_list(). They're siblings.) ๐
๐ซ $bioassay->addBioAssay(@vals)
This is the interface for adding Bio::MAGE::BioAssay::BioAssay objects to the bioassay_list list. It's generally used by generic methods such as those in the XMLWriter. โ๏ธ
- Input parameters: the list of values
@valsto add to the owner association. NOTE: submitting a single value is permitted. - Return value: none.
- Side effects: none.
- Exceptions: it will call
croak()if no input parameters are specified, or if any of the objects in@valsis not a subclass of classBio::MAGE::BioAssay::BioAssay. Again. Types. Check them. ๐
๐ซ $bioassay->obj2xml($writer)
Write out this object, and all of its sub-objects, as XML โ using the $writer you supply to actually do the XML formatting. ๐ช
- Input parameters:
$writermust be an XML writer, e.g. an instance ofBio::MAGE::XML::Writer. It must have these methods:write_start_tag(),write_end_tag(), andobj2xml(). - Return value: none.
- Side effects: literally all the writing gets delegated to the
$writer. Itswrite_start_tag()andwrite_end_tag()methods get invoked with the appropriate data, and every class sub-object of theBio::MAGE::BioAssayinstance will have its ownobj2xml()method invoked in turn. By letting the$writerdo the actual formatting of the output XML, you get to precisely control the format. That's the whole point. That's the power move. ๐ - Exceptions: it will call
croak()if no identifier has been set for theBio::MAGE::BioAssayinstance. So set your identifier, bestie. No identifier, no XML. Periodt. ๐ซ
๐ซ $bioassay->register($obj)
Stores an object so it can be written as XML later. Save it for the future. โณ
- 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 get stored in the correct XML list for this class. Right place, right list. ๐๏ธ - Exceptions: none.
okay that's the first half bestie, don't go anywhere, there's literally more ๐ซถโจ
โจ SLOTS, ATTRIBUTES, AND ASSOCIATIONS โจ
okay so bestie, in the Perl implementation of MAGE-OM classes there are three kinds of class data members, and you gotta know which is which: "slots", "attributes", and "associations". let's break them down one by one ๐ซถ
๐ SLOTS ๐
so "slot" is the API's word for a data member of the class that wasn't in the UML model at all โ it exists for mainly internal purposes. it's giving backstage pass, not front-of-house. only touch these if you genuinely understand the inner workings of the API ๐ most of the time slots get used by generic methods, like the ones hanging out 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's giving echo.@names = $obj->get_slot_names()โ hands you the list of every slot in the class.
๐จ DATA CHECKING: literally no data type checking is made for these methods. none. zero. you're on your own, bestie ๐ญ
๐ฆ ATTRIBUTES AND ASSOCIATIONS ๐ฆ
"attribute" and "association" are the terms for data members of the class that were specified directly from the UML model. these are the main-character data members, fr fr ๐
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, you get back an array reference. keep that in mind or you'll be confused later, iykyk.
- DATA CHECKING: ensures that no argument is provided. so don't be passing stuff in there ๐
set*โ sets the current value, replacing whatever value was already there. it's a full glow-up, out with the old.- NOTE: for associations, if the association has list cardinality, the argument must be an array reference. and because of that whole situation, you probably should be using the
add*methods instead. lowkey just useadd*. - DATA CHECKING: for attributes, it ensures that a single value is provided as the argument. for associations, if the association has list cardinality, it ensures the argument is a reference to an array of instances of the correct MAGE-OM class; otherwise it ensures there's 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. and because of that whole situation, you probably should be using the
add*โ appends a list of objects to any values that may already be stored in the association. it's additive, it's generous, it's the friend who keeps bringing more people to the party โจ- NOTE: this one is only present in associations with list cardinality. if it's not there, that's why, don't come for me.
- 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, serves up a whole set of generic methods that operate on slots, attributes, and associations. one class to rule them all, periodt ๐
$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 โ they're already covered, bestie, go look ๐ธ
๐ BUGS ๐
found a bug? not me manifesting that but okay. 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) โ the author, the icon, the legend ๐
๐ SEE ALSO ๐
perl(1)โ go read it, bestie, it's foundational ๐ซถ
and that's the whole page, bestie!! this little masterpiece is perl v5.32.0 from 2020-11-27, filed under MAGE::BioAssay(3pm) โ go forth and annotate your bioassays with main character energy ๐โจ๐๐ฆ๐ธ
๐ฆ 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