MAGE::...ayData(3pm)

๐Ÿ’– NAME ๐Ÿ’–

Bio::MAGE::BioAssayData โ€” okay bestie, this is the container module for the classes that live in the MAGE package: BioAssayData. That's the whole vibe. It's the group chat that all the BioAssayData classes hang out in. โœจ

This page is MAGE::...ayData(3pm) from the User Contributed Perl Documentation, and yes we're reading it together, hydration check, let's go. ๐Ÿซถ


โœจ SYNOPSIS โœจ

use Bio::MAGE::BioAssayData;

That's it. That's the whole synopsis. Short king. ๐Ÿ’…


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

So like, this is a package module that wraps up a bunch of classes in the Bio::MAGE hierarchy. These classes all belong to the BioAssayData package of the MAGE-OM object model. No cap, that's the entire description. It's giving "I contain multitudes." ๐Ÿ‘‘


๐ŸŽ€ CLASSES ๐ŸŽ€

The Bio::MAGE::BioAssayData module is literally holding all of these Bio::MAGE classes down:

  • BioAssayData
  • QuantitationTypeDimension
  • BioAssayMapping
  • DesignElementDimension
  • BioAssayDatum
  • DerivedBioAssayData
  • MeasuredBioAssayData
  • QuantitationTypeMapping
  • DesignElementMapping
  • BioDataCube
  • BioDataValues
  • BioDataTuples
  • BioAssayDimension
  • QuantitationTypeMap
  • Transformation
  • DesignElementMap
  • BioAssayMap
  • CompositeSequenceDimension
  • ReporterDimension
  • FeatureDimension

Twenty classes. A whole roster. The way this module is carrying an entire friend group on its back. ๐Ÿ˜ญ๐Ÿ’–


๐Ÿ”ฅ CLASS METHODS ๐Ÿ”ฅ

@class_list = Bio::MAGE::BioAssayData::classes();

This one hands you back a list of non-fully qualified class names in this package. Translation: they do not have 'Bio::MAGE::' as a prefix. So just the short names, bestie. ๐ŸŒธ

$obj = class->new(%parameters)

The new() method is the class constructor, aka how you birth an object into existence. ๐ŸŒฑ

  • Parameters: if you hand it a list of name/value parameters, the matching 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, but only if the class actually defines it.

@names = class->get_slot_names()

get_slot_names() is the method you call 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 me when your attribute isn't in there. ๐Ÿ™ˆ
  • 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. โœจ

@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. It's giving "who raised you." ๐Ÿ‘‘

@class_list = get_subclasses()

returns the list of subclasses for this class. Your little ones. ๐Ÿฅน

$name = class_name()

Returns the full class name for this class. Government name and everything. ๐Ÿ’…

$package_name = package_name()

Returns the base package name of the package that contains this class โ€” and by "base" I mean there's no 'namespace::' on it. Just the raw base. ๐ŸŽ€

%assns = associations()

returns the association meta-information as a hash, where the keys are the association names and the values are Association objects that hold the meta-information for the association. Meta on meta. ๐Ÿฆ‹


๐Ÿ’œ INSTANCE METHODS ๐Ÿ’œ

$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 new object's initial values get set to be exactly 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 being copied.
  • Return value: it returns a reference to an object of the class.
  • Side effects: it invokes the initialize() method if the class defines it.

$obj->set_slots(%parameters)

$obj->set_slots(\@name_list, \@value_list)

set_slots() lets you set a bunch of slots all at once, because doing them one by one is not the vibe. 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 you use a slot_name that the class doesn't define. So don't be inventing slots, bestie. ๐Ÿ’€

@obj_list = $obj->get_slots(@name_list)

get_slots() gets the values of a number of slots at the same time. Bulk retrieval, iconic. โœจ

  • 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. Simple. Clean. ๐Ÿ’…

  • 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 undef if the slot has not been initialized. (She's empty, your honor. ๐Ÿ˜ญ)
  • Side effects: none.

๐ŸŒธ The unified setter/getter era ๐ŸŒธ

Okay so a whole bunch of these next methods follow the exact same pattern, so let me explain the format once and then we go:

Each one is a unified setter/getter method for its slot. If $inval is specified, the setter method is invoked. With no parameters, the getter method is invoked.

  • Input parameters: the optional $inval will invoke the setter method.
  • Return value: for both setter and getter, the current value of the slot.
  • Side effects: none.
  • Exceptions: none.

Periodt. Now here's every single one of them, no skips, no skimming: ๐Ÿซถ


$val = $bioassaydata->xml_lists()

$inval = $bioassaydata->xml_lists($inval)

Unified setter/getter for the xml_lists slot.

  • Input parameters: the optional $inval will invoke the setter method.
  • Return value: for both setter and getter, the current value of the xml_lists slot.
  • Side effects: none.
  • Exceptions: none.

$val = $bioassaydata->tagname()

$inval = $bioassaydata->tagname($inval)

Unified setter/getter for the tagname slot.

  • Input parameters: the optional $inval will invoke the setter method.
  • Return value: for both setter and getter, the current value of the tagname slot.
  • Side effects: none.
  • Exceptions: none.

$val = $bioassaydata->bioassaydimension_list()

$inval = $bioassaydata->bioassaydimension_list($inval)

Unified setter/getter for the bioassaydimension_list slot.

  • Input parameters: the optional $inval will invoke the setter method.
  • Return value: for both setter and getter, the current value of the bioassaydimension_list slot.
  • Side effects: none.
  • Exceptions: none.

$val = $bioassaydata->designelementdimension_list()

$inval = $bioassaydata->designelementdimension_list($inval)

Unified setter/getter for the designelementdimension_list slot.

  • Input parameters: the optional $inval will invoke the setter method.
  • Return value: for both setter and getter, the current value of the designelementdimension_list slot.
  • Side effects: none.
  • Exceptions: none.

$val = $bioassaydata->quantitationtypedimension_list()

$inval = $bioassaydata->quantitationtypedimension_list($inval)

Unified setter/getter for the quantitationtypedimension_list slot.

  • Input parameters: the optional $inval will invoke the setter method.
  • Return value: for both setter and getter, the current value of the quantitationtypedimension_list slot.
  • Side effects: none.
  • Exceptions: none.

$val = $bioassaydata->bioassaymap_list()

$inval = $bioassaydata->bioassaymap_list($inval)

Unified setter/getter for the bioassaymap_list slot.

  • Input parameters: the optional $inval will invoke the setter method.
  • Return value: for both setter and getter, the current value of the bioassaymap_list slot.
  • Side effects: none.
  • Exceptions: none.

$val = $bioassaydata->quantitationtypemap_list()

$inval = $bioassaydata->quantitationtypemap_list($inval)

Unified setter/getter for the quantitationtypemap_list slot.

  • Input parameters: the optional $inval will invoke the setter method.
  • Return value: for both setter and getter, the current value of the quantitationtypemap_list slot.
  • Side effects: none.
  • Exceptions: none.

$val = $bioassaydata->bioassaydata_list()

$inval = $bioassaydata->bioassaydata_list($inval)

Unified setter/getter for the bioassaydata_list slot.

  • Input parameters: the optional $inval will invoke the setter method.
  • Return value: for both setter and getter, the current value of the bioassaydata_list slot.
  • Side effects: none.
  • Exceptions: none.

$array_ref = $bioassaydata->getBioAssayDimension_list()

This method handles the list for the Bio::MAGE::BioAssayData::BioAssayDimension 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 parsed MAGE-ML file. Iykyk. ๐Ÿ’…

$bioassaydata->addBioAssayDimension(@vals)

This method is an interface for adding Bio::MAGE::BioAssayData::BioAssayDimension objects to the bioassaydimension_list list. It's generally used by generic methods such as those in the XMLWriter. ๐Ÿ› ๏ธ

  • Input parameters: the list of values @vals to add to the owner association.
NOTE: submitting a single value is permitted. One is fine. You're doing great. ๐Ÿฅน
  • Return value: none.
  • Side effects: none.
  • Exceptions: will call croak() if no input parameters are specified, or if any of the objects in @vals is not a subclass of class Bio::MAGE::BioAssayData::BioAssayDimension. So bring the right type or bring nothing. ๐Ÿ’€

$array_ref = $bioassaydata->getDesignElementDimension_list()

This method handles the list for the Bio::MAGE::BioAssayData::DesignElementDimension 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 parsed MAGE-ML file. ๐ŸŒˆ

$bioassaydata->addDesignElementDimension(@vals)

This method is an interface for adding Bio::MAGE::BioAssayData::DesignElementDimension objects to the designelementdimension_list list. It's generally used by generic methods such as those in the XMLWriter. ๐Ÿ› ๏ธ

  • Input parameters: the list of values @vals to add to the owner association.
NOTE: submitting a single value is permitted. Just one is allowed, bestie. ๐Ÿ’–
  • Return value: none.
  • Side effects: none.
  • Exceptions: will call croak() if no input parameters are specified, or if any of the objects in @vals is not a subclass of class Bio::MAGE::BioAssayData::DesignElementDimension. Type check is type checking. ๐Ÿ˜ค

to be continued, bestie โ€” there's more of this page coming ๐Ÿ‘€๐Ÿ’…

  • $array_ref = $bioassaydata->getQuantitationTypeDimension_list() โ€” bestie this one goes and grabs the whole list for the Bio::MAGE::BioAssayData::QuantitationTypeDimension class. You get back a reference to an array stuffed with all the class objects that have been associated with the package instance. ๐Ÿ’–

Super useful when you're pulling data out of a parsed MAGE-ML file, fr fr.

  • $bioassaydata->addQuantitationTypeDimension(@vals) โ€” the interface for adding Bio::MAGE::BioAssayData::QuantitationTypeDimension objects onto the quantitationtypedimension_list list. The generic methods (think the ones over in XMLWriter) are the usual callers. โœจ
    • Input parameters: the list of values @vals to add to the owner association. NOTE: submitting a single value is permitted. ๐Ÿ‘‘
    • Return value: none
    • Side effects: none
    • Exceptions: will call croak() if no input parameters are specified, or if any of the objects in @vals is not a subclass of class Bio::MAGE::BioAssayData::QuantitationTypeDimension ๐Ÿ’€
  • $array_ref = $bioassaydata->getBioAssayMap_list() โ€” this one handles the list for the Bio::MAGE::BioAssayData::BioAssayMap class, handing you back a reference to an array of the class objects that got associated with the package instance. ๐Ÿฆ‹

Again: chef's kiss when you're retrieving data from a parsed MAGE-ML file.

  • $bioassaydata->addBioAssayMap(@vals) โ€” the add-interface for Bio::MAGE::BioAssayData::BioAssayMap objects going onto the bioassaymap_list list. Generic methods like the XMLWriter ones are the main characters here. ๐ŸŒธ
    • Input parameters: the list of values @vals to add to the owner association. NOTE: submitting a single value is permitted. ๐Ÿ‘‘
    • Return value: none
    • Side effects: none
    • Exceptions: will call croak() if no input parameters are specified, or if any of the objects in @vals is not a subclass of class Bio::MAGE::BioAssayData::BioAssayMap ๐Ÿ’€
  • $array_ref = $bioassaydata->getQuantitationTypeMap_list() โ€” handles the list for the Bio::MAGE::BioAssayData::QuantitationTypeMap class, returning a reference to an array of the class objects associated with the package instance. ๐ŸŽ€

And yes, it's useful when retrieving data from parsed MAGE-ML file. iykyk.

  • $bioassaydata->addQuantitationTypeMap(@vals) โ€” the interface for adding Bio::MAGE::BioAssayData::QuantitationTypeMap objects onto the quantitationtypemap_list list. Generally used by generic methods such as those in the XMLWriter. โœจ
    • Input parameters: the list of values @vals to add to the owner association. NOTE: submitting a single value is permitted. ๐Ÿ‘‘
    • Return value: none
    • Side effects: none
    • Exceptions: will call croak() if no input parameters are specified, or if any of the objects in @vals is not a subclass of class Bio::MAGE::BioAssayData::QuantitationTypeMap ๐Ÿ’€
  • $array_ref = $bioassaydata->getBioAssayData_list() โ€” handles the list for the Bio::MAGE::BioAssayData::BioAssayData class, returning a reference to an array of the class objects associated with the package instance. ๐ŸŒˆ

Yep โ€” useful when retrieving data from parsed MAGE-ML file.

  • $bioassaydata->addBioAssayData(@vals) โ€” the interface for adding Bio::MAGE::BioAssayData::BioAssayData objects onto the bioassaydata_list list. Generally used by generic methods such as those in the XMLWriter. ๐Ÿงš
    • Input parameters: the list of values @vals to add to the owner association. NOTE: submitting a single value is permitted. ๐Ÿ‘‘
    • Return value: none
    • Side effects: none
    • Exceptions: will call croak() if no input parameters are specified, or if any of the objects in @vals is not a subclass of class Bio::MAGE::BioAssayData::BioAssayData ๐Ÿ’€
  • $bioassaydata->obj2xml($writer) โ€” writes this object, and literally every sub-object, out as XML, using the $writer you hand it to do the actual XML formatting. ๐Ÿซถ
    • Input parameters: $writer must be an XML writer, e.g. an instance of Bio::MAGE::XML::Writer. It must have the methods: write_start_tag(), write_end_tag(), and obj2xml().
    • Return value: none
    • Side effects: all the writing is delegated to the $writer โ€” its write_start_tag() and write_end_tag() methods get invoked with the appropriate data, and all class sub-objects of the Bio::MAGE::BioAssayData instance will have their obj2xml() methods invoked in turn. By letting the $writer do the actual formatting of the output XML, it lets you precisely control the format. ๐Ÿ’…
    • Exceptions: will call croak() if no identifier has been set for the Bio::MAGE::BioAssayData instance. ๐Ÿ˜ญ
  • $bioassaydata->register($obj) โ€” stores an object so it can be written later as XML. ๐Ÿ“ฅ
    • Input parameters: object to be added to the list of registered objects.
    • Return value: none
    • Side effects: if $obj needs 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. Let's break it down, bestie. ๐Ÿ’œ

๐ŸŽ€ SLOTS ๐ŸŽ€

This API uses the term "slot" to mean a data member of the class that was not present in the UML model and is used for mainly internal purposes โ€” so like, only touch it if you actually understand the inner workings of the API. ๐Ÿ”ฎ Most often, slots get used by generic methods such as those 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_var in the slot; the return value is also $new_var. ๐Ÿ’พ
  • @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. ๐Ÿ™ˆ

๐Ÿฆ‹ 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.
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.
  • add* โ€” appends a list of objects to any values that may already be stored in the association. โž•
NOTE: Only present in associations with list cardinality.
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. ๐Ÿ“–


๐Ÿ› BUGS ๐Ÿ›

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)

๐Ÿ”— SEE ALSO ๐Ÿ”—

perl(1).


perl v5.32.0 ยท 2020-11-27 ยท MAGE::...ayData(3pm)

And that's the whole page, bestie โ€” go forth and slay your MAGE-ML parsing. ๐Ÿ’–โœจ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from