MAGE::...ntGroup(3pm)

MAGE::...ntGroup(3pm) β€” User Contributed Perl Documentation πŸ’–

✨ NAME ✨

okay so bestie, <pink>Bio::MAGE::ArrayDesign::DesignElementGroup</pink> is the class for the MAGE-OM API. it's giving interface definition energy, fr fr.

🌸 SYNOPSIS 🌸

first up, the vibe check on how you'd use it:

use Bio::MAGE::ArrayDesign::DesignElementGroup

# Bio::MAGE::ArrayDesign::DesignElementGroup is an abstract base class and should not
# be directly instantiated. These examples indicate how subclass
# objects will behave

# 'name' attribute
my $name_val = $designelementgroup->name(); # getter
$designelementgroup->name($value); # setter

# 'identifier' attribute
my $identifier_val = $designelementgroup->identifier(); # getter
$designelementgroup->identifier($value); # setter

# 'types' association
my $ontologyentry_array_ref = $designelementgroup->types(); # getter
$designelementgroup->types(\@ontologyentry_list); # setter

# 'auditTrail' association
my $audit_array_ref = $designelementgroup->auditTrail(); # getter
$designelementgroup->auditTrail(\@audit_list); # setter

# 'species' association
my $ontologyentry_ref = $designelementgroup->species(); # getter
$designelementgroup->species($ontologyentry_ref); # setter

# 'propertySets' association
my $namevaluetype_array_ref = $designelementgroup->propertySets(); # getter
$designelementgroup->propertySets(\@namevaluetype_list); # setter

# 'descriptions' association
my $description_array_ref = $designelementgroup->descriptions(); # getter
$designelementgroup->descriptions(\@description_list); # setter

# 'security' association
my $security_ref = $designelementgroup->security(); # getter
$designelementgroup->security($security_ref); # setter

πŸ’… DESCRIPTION πŸ’…

Straight from the MAGE-OM documentation for the <pink>DesignElementGroup</pink> class:

The DesignElementGroup holds information on either features, reporters, or compositeSequences, particularly that information that is common between all of the DesignElements contained.

So <pink>Bio::MAGE::ArrayDesign::DesignElementGroup</pink> is an abstract base class and should NOT be directly instantiated. Instead it serves as an interface definition for its subclasses. periodt.

πŸ¦‹ INHERITANCE πŸ¦‹

<pink>Bio::MAGE::ArrayDesign::DesignElementGroup</pink> has the following superclasses:

  • <pink>Bio::MAGE::Identifiable</pink>

and it has the following subclasses:

  • <pink>Bio::MAGE::ArrayDesign::ReporterGroup</pink>
  • <pink>Bio::MAGE::ArrayDesign::FeatureGroup</pink>
  • <pink>Bio::MAGE::ArrayDesign::CompositeGroup</pink>

πŸ‘‘ CLASS METHODS πŸ‘‘

The following methods can all be called without first having an instance of the class via the <pink>Bio::MAGE::ArrayDesign::DesignElementGroup->methodname()</pink> syntax. slay.

new(), new(%args)

<pink>Bio::MAGE::ArrayDesign::DesignElementGroup</pink> is an abstract base class and should NOT be directly instantiated using the <pink>new()</pink> constructor. It is listed here to indicate what arguments will be accepted for its subclasses.

The object constructor <pink>new()</pink> accepts the following optional named-value style arguments:

  • name β€” Sets the value of the <pink>name</pink> attribute (this attribute was inherited from class <pink>Bio::MAGE::Identifiable</pink>).
  • identifier β€” Sets the value of the <pink>identifier</pink> attribute (this attribute was inherited from class <pink>Bio::MAGE::Identifiable</pink>).
  • types β€” Sets the value of the <pink>types</pink> association. The value must be of type: array of <pink>Bio::MAGE::Description::OntologyEntry</pink>.
  • auditTrail β€” Sets the value of the <pink>auditTrail</pink> association (this association was inherited from class <pink>Bio::MAGE::Describable</pink>). The value must be of type: array of <pink>Bio::MAGE::AuditAndSecurity::Audit</pink>.
  • propertySets β€” Sets the value of the <pink>propertySets</pink> association (this association was inherited from class <pink>Bio::MAGE::Extendable</pink>). The value must be of type: array of <pink>Bio::MAGE::NameValueType</pink>.
  • species β€” Sets the value of the <pink>species</pink> association. The value must be of type: instance of <pink>Bio::MAGE::Description::OntologyEntry</pink>.
  • descriptions β€” Sets the value of the <pink>descriptions</pink> association (this association was inherited from class <pink>Bio::MAGE::Describable</pink>). The value must be of type: array of <pink>Bio::MAGE::Description::Description</pink>.
  • security β€” Sets the value of the <pink>security</pink> association (this association was inherited from class <pink>Bio::MAGE::Describable</pink>). The value must be of type: instance of <pink>Bio::MAGE::AuditAndSecurity::Security</pink>.

$obj = class->new(%parameters)

The <pink>new()</pink> method is the class constructor.

Parameters: if given a list of name/value parameters the corresponding slots, attributes, or associations will have their initial values set by the constructor.

Return value: It returns a reference to an object of the class.

Side effects: It invokes the <pink>initialize()</pink> method if it is defined by the class.

@names = class->get_slot_names()

The <pink>get_slot_names()</pink> 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.

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.

@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 <pink>Association</pink> objects that provide the meta-information for the association.

πŸ’œ INSTANCE METHODS πŸ’œ

$obj_copy = $obj->new()

When invoked with an existing object reference and not a class name, the <pink>new()</pink> method acts as a copy constructor - with the new object's initial values set to be those of the existing object.

Parameters: No input parameters are used in the copy constructor, the initial values are taken directly from the object to be copied.

Return value: It returns a reference to an object of the class.

Side effects: It invokes the <pink>initialize()</pink> method if it is defined by the class.

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

The <pink>set_slots()</pink> method is used to set a number 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.

Return value: none

Side effects: will call <pink>croak()</pink> if a slot_name is used that the class does not define.

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

The <pink>get_slots()</pink> method is used to get 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)

The <pink>set_slot()</pink> method 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)

The <pink>get_slot()</pink> method 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.

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.

<pink>Bio::MAGE::ArrayDesign::DesignElementGroup</pink> has the following attribute accessor methods:

name

Methods for the <pink>name</pink> attribute.

From the MAGE-OM documentation:

The potentially ambiguous common identifier.
  • $val = $designelementgroup->setName($val) β€” The restricted setter method for the <pink>name</pink> attribute.
    • Input parameters: the value to which the <pink>name</pink> attribute will be set
    • Return value: the current value of the <pink>name</pink> attribute
    • Side effects: none
    • Exceptions: will call <pink>croak()</pink> if no input parameters are specified, or if too many input parameters are specified
  • $val = $designelementgroup->getName() β€” The restricted getter method for the <pink>name</pink> attribute.
    • Input parameters: none
    • Return value: the current value of the <pink>name</pink> attribute
    • Side effects: none
    • Exceptions: will call <pink>croak()</pink> if any input parameters are specified

identifier

Methods for the <pink>identifier</pink> attribute.

From the MAGE-OM documentation:

An identifier is an unambiguous string that is unique within the scope (i.e. a document, a set of related documents, or a repository) of its use.
  • $val = $designelementgroup->setIdentifier($val) β€” The restricted setter method for the <pink>identifier</pink> attribute.
    • Input parameters: the value to which the <pink>identifier</pink> attribute will be set
    • Return value: the current value of the <pink>identifier</pink> attribute
    • Side effects: none
    • Exceptions: will call <pink>croak()</pink> if no input parameters are specified, or if too many input parameters are specified
  • $val = $designelementgroup->getIdentifier() β€” The restricted getter method for the <pink>identifier</pink> attribute.
    • Input parameters: none
    • Return value: the current value of the <pink>identifier</pink> attribute
    • Side effects: none
    • Exceptions: will call <pink>croak()</pink> if any input parameters are specified

πŸ’€ 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 maybe included in the association:

  1. There must be exactly one item in the association, i.e. this is a mandatory data field.
  2. 0..1

There may be one item in the association, i.e. this is an optional data field.

  1. 1..N

There must be one or more items in the association, i.e. this is a mandatory data field, with list cardinality.

  1. 0..N

like, there can totally be one or more items in the association?? yes bestie β€” that means it's an optional data field, with list cardinality. πŸ’…


πŸ’– Bio::MAGE::ArrayDesign::DesignElementGroup has the following association accessor methods πŸ’–


🌸 types 🌸

the methods for the types association, ok bestie listen up 🫢

From the MAGE-OM documentation:

The specific type of a feature, reporter, or composite. A composite type might be a gene while a reporter type might be a cDNA clone or an oligo.
$array_ref = $designelementgroup->setTypes($array_ref)

the restricted setter for the types association β€” she's picky, that's the whole point πŸ’…

  • Input parameters: the value to which the types association will be set : a reference to an array of objects of type Bio::MAGE::Description::OntologyEntry
  • Return value: the current value of the types association : a reference to an array of objects of type Bio::MAGE::Description::OntologyEntry
  • 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 class Bio::MAGE::Description::OntologyEntry instances
$array_ref = $designelementgroup->getTypes()

the restricted getter for the types association, she only gives, never takes ✨

  • Input parameters: none
  • Return value: the current value of the types association : a reference to an array of objects of type Bio::MAGE::Description::OntologyEntry
  • Side effects: none
  • Exceptions: will call croak() if any input parameters are specified
$val = $designelementgroup->addTypes(@vals)

because the types association has list cardinality, she can hold more than one value at a time. this method adds the current list of objects in the types association. πŸ“š

  • Input parameters: the list of values @vals to add to the types 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 @vals is not an instance of class Bio::MAGE::Description::OntologyEntry

πŸ¦‹ auditTrail πŸ¦‹

the 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 = $designelementgroup->setAuditTrail($array_ref)

the restricted setter for the auditTrail association πŸŽ€

  • Input parameters: the value to which the auditTrail association will be set : a reference to an array of objects of type Bio::MAGE::AuditAndSecurity::Audit
  • Return value: the current value of the auditTrail association : a reference to an array of objects of type Bio::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_ref is not a reference to an array class Bio::MAGE::AuditAndSecurity::Audit instances
$array_ref = $designelementgroup->getAuditTrail()

the restricted getter for the auditTrail association πŸ”₯

  • Input parameters: none
  • Return value: the current value of the auditTrail association : a reference to an array of objects of type Bio::MAGE::AuditAndSecurity::Audit
  • Side effects: none
  • Exceptions: will call croak() if any input parameters are specified
$val = $designelementgroup->addAuditTrail(@vals)

because the auditTrail association has list cardinality, she may store more than one value. this method adds the current list of objects in the auditTrail association. πŸ‘‘

  • Input parameters: the list of values @vals to add to the auditTrail 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 @vals is not an instance of class Bio::MAGE::AuditAndSecurity::Audit

πŸŽ€ propertySets πŸŽ€

the methods for the propertySets association, it's giving utility ✨

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 = $designelementgroup->setPropertySets($array_ref)

the restricted setter for the propertySets association 🌸

  • Input parameters: the value to which the propertySets association will be set : a reference to an array of objects of type Bio::MAGE::NameValueType
  • Return value: the current value of the propertySets association : a reference to an array of objects of type Bio::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 class Bio::MAGE::NameValueType instances
$array_ref = $designelementgroup->getPropertySets()

the restricted getter for the propertySets association πŸ’–

  • Input parameters: none
  • Return value: the current value of the propertySets association : a reference to an array of objects of type Bio::MAGE::NameValueType
  • Side effects: none
  • Exceptions: will call croak() if any input parameters are specified
$val = $designelementgroup->addPropertySets(@vals)

because the propertySets association has list cardinality, she may store more than one value. this method adds the current list of objects in the propertySets association. 🧚

  • Input parameters: the list of values @vals to add to the propertySets 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 @vals is not an instance of class Bio::MAGE::NameValueType

πŸ› species πŸ›

the methods for the species association β€” she's single cardinality coded, no list here bestie 🌈

From the MAGE-OM documentation:

The organism from which the biosequences of this group are from.
$val = $designelementgroup->setSpecies($val)

the restricted setter for the species association πŸ’…

  • Input parameters: the value to which the species association will be set : one of the accepted enumerated values.
  • Return value: the current value of the species association : 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 $val is not an instance of class Bio::MAGE::Description::OntologyEntry
$val = $designelementgroup->getSpecies()

the restricted getter for the species association πŸ¦‹

  • Input parameters: none
  • Return value: the current value of the species association : an instance of type Bio::MAGE::Description::OntologyEntry.
  • Side effects: none
  • Exceptions: will call croak() if any input parameters are specified

πŸ“ descriptions πŸ“

the methods for the descriptions association, free-form text bestie, go off ✍️

From the MAGE-OM documentation:

Free hand text descriptions. Makes available the associations of Description to an instance of Describable.
$array_ref = $designelementgroup->setDescriptions($array_ref)

the restricted setter for the descriptions association 🌸

  • Input parameters: the value to which the descriptions association will be set : a reference to an array of objects of type Bio::MAGE::Description::Description
  • Return value: the current value of the descriptions association : a reference to an array of objects of type Bio::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_ref is not a reference to an array class Bio::MAGE::Description::Description instances
$array_ref = $designelementgroup->getDescriptions()

the restricted getter for the descriptions association πŸ’–

  • Input parameters: none
  • Return value: the current value of the descriptions association : a reference to an array of objects of type Bio::MAGE::Description::Description
  • Side effects: none
  • Exceptions: will call croak() if any input parameters are specified
$val = $designelementgroup->addDescriptions(@vals)

because the descriptions association has list cardinality, she may store more than one value. this method adds the current list of objects in the descriptions association. πŸ“

  • Input parameters: the list of values @vals to 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 @vals is not an instance of class Bio::MAGE::Description::Description

πŸ” security πŸ”

the methods for the security association β€” she's the gatekeeper fr fr 🫢

From the MAGE-OM documentation:

Information on the security for the instance of the class.
$val = $designelementgroup->setSecurity($val)

the restricted setter for the security association πŸ’…

  • Input parameters: the value to which the security association will be set : one of the accepted enumerated values.
  • Return value: the current value of the security association : one of the accepted enumerated values.
  • Side effects: none
  • setSecurity β€” the restricted setter for the security association. Basically you're the one sliding the Security object into place.

Input: a single value β€” and it has to be an instance of the class Bio::MAGE::AuditAndSecurity::Security. Just the one, bestie.

Returns: the value you just set, boomeranged right back at you.

Side effects: nope, none, we're chill.

Exceptions: it will yell croak() at you if you pass no input parameters at all, if you pass too many input parameters, or if $val isn't an instance of Bio::MAGE::AuditAndSecurity::Security. So like… read the room before you call it. πŸ’€
  • $val = $designelementgroup->getSecurity() β€” the restricted getter for that same security association. You want it, you get it. ✨

Input parameters: literally none. Zero. Nada.

Return value: whatever the security association is holding right now β€” an instance of type Bio::MAGE::AuditAndSecurity::Security.

Side effects: none, she's well-behaved.

Exceptions: will call croak() if you go and specify any input parameters. It's a no-args zone, babes.

And then there's this absolute icon of a method, sitting there doing nothing on purpose:

sub initialize {

  carp __PACKAGE__ . "::initialize: abstract base classes should not be instantiated";

}

🌈 SLOTS, ATTRIBUTES, AND ASSOCIATIONS 🌈

Okay so real talk β€” in the Perl implementation of MAGE-OM classes, there are three whole flavors of class data members: slots, attributes, and associations. Let's break each one down, no gatekeeping here. 🫢

πŸŽ€ SLOTS

So this API uses the word "slot" to mean a data member of the class that wasn't even in the UML model β€” it's there for mostly internal stuff. Translation: only touch these if you genuinely understand the inner workings of the API, iykyk. Most of the time, slots get used by generic methods, like the ones chilling inside the XML writing and reading classes.

Slots are built using unified getter/setter methods, which is honestly so efficient of them:

  • $var = $obj->slot_name(); β€” grabs the current value of the slot. Simple. Clean.
  • $new_var = $obj->slot_name($new_var); β€” stores $new_var in the slot, and the return value is also $new_var. It gives back what you gave it. Iconic behavior, honestly. πŸ’…
  • @names = $obj->get_slot_names() β€” returns the list of all the slots in the class. The full roster.
DATA CHECKING: literally none. No data type checking is made for these methods. It's the wild west out here, so be careful. 😭

πŸ’œ ATTRIBUTES AND ASSOCIATIONS

Now β€” "attribute" and "association" mean data members of the class that were specified directly from the UML model. So these are the official ones, the ones with paperwork.

In the Perl implementation of MAGE-OM classes, association and attribute accessors are implemented using three separate methods. Three! Because why do one thing when three can do it cuter. 🌸

  • 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. Come empty-handed or don't come at all. πŸ™ˆ
  • set* β€” sets the current value, replacing any existing value. Out with the old, in with the new, periodt.
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, genuinely, just use add*, bestie.
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. So it's checking your vibe and your types. πŸ’…
  • 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. If you don't see it, that's why. Not a bug, just the rules.
DATA CHECKING: ensures that all arguments are of the correct MAGE-OM class. Every single one. No stragglers. πŸ‘‘

⭐ GENERIC METHODS

The unified base class of all MAGE-OM classes, Bio::MAGE::Base, hands you a whole set of generic methods that will operate on slots, attributes, and associations. One base class to rule them all:

$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 fully documented, go look. ✨


πŸ’€ BUGS πŸ’€

Found something cursed? 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 main character who wrote this. Respect. 🫢


πŸ¦‹ SEE ALSO πŸ¦‹


πŸ™ˆ POD ERRORS πŸ™ˆ

Hey! The above document had some coding errors, which are explained below. Not me snitching on the doc, but the pod checker literally said so:

  • Around line 398:
    • '=item' outside of any '=over'
  • Around line 483:
    • You forgot a '=back' before a '=head2'
  • Around line 655:
    • Expected '=item 2'
  • Around line 660:
    • Expected '=item 3'
  • Around line 665:
    • Expected '=item 4'

okay that's the whole page bestie, we did it, we survived the MAGE::...ntGroup(3pm) lore drop πŸ’–βœ¨

That was from perl v5.32.0, dated 2020-11-27, and the footer says MAGE::...ntGroup(3pm) β€” so like, it's giving very much vintage Perl energy. Slay. πŸŽ€