MAGE::...eature(3pm)

🌸 MAGE::...eature(3pm) β€” aka Bio::MAGE::DesignElement::Feature 🌸

okay so bestie, welcome to the User Contributed Perl Documentation entry for MAGE::...eature(3pm) β€” which is, and I cannot stress this enough, the manual page for the class Bio::MAGE::DesignElement::Feature. It's giving bioinformatics royalty, it's giving MAGE-OM API realness, and we are going to get through every single bit of it together. No skipping. Not on my watch. πŸ’…


✨ NAME ✨

Bio::MAGE::DesignElement::Feature β€” a whole class for the MAGE-OM API. That's the name, that's the vibe, that's the whole point of this section. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

Here's the whole thing in one glance, and yes, I'm giving it to you exactly as it is, because code is sacred and I don't mess with it:

  use Bio::MAGE::DesignElement::Feature

  # creating an empty instance
  my $feature = Bio::MAGE::DesignElement::Feature->new();

  # creating an instance with existing data
  my $feature = Bio::MAGE::DesignElement::Feature->new(
        name=>$name_val,
        identifier=>$identifier_val,
        controlType=>$ontologyentry_ref,
        zone=>$zone_ref,
        controlledFeatures=>\@feature_list,
        position=>$position_ref,
        auditTrail=>\@audit_list,
        propertySets=>\@namevaluetype_list,
        descriptions=>\@description_list,
        security=>$security_ref,
        featureGroup=>$featuregroup_ref,
        featureLocation=>$featurelocation_ref,
        controlFeatures=>\@feature_list,
  );

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

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

  # 'controlType' association
  my $ontologyentry_ref = $feature->controlType(); # getter
  $feature->controlType($ontologyentry_ref); # setter

  # 'zone' association
  my $zone_ref = $feature->zone(); # getter
  $feature->zone($zone_ref); # setter

  # 'controlledFeatures' association
  my $feature_array_ref = $feature->controlledFeatures(); # getter
  $feature->controlledFeatures(\@feature_list); # setter

  # 'position' association
  my $position_ref = $feature->position(); # getter
  $feature->position($position_ref); # setter

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

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

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

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

  # 'featureGroup' association
  my $featuregroup_ref = $feature->featureGroup(); # getter
  $feature->featureGroup($featuregroup_ref); # setter

  # 'featureLocation' association
  my $featurelocation_ref = $feature->featureLocation(); # getter
  $feature->featureLocation($featurelocation_ref); # setter

  # 'controlFeatures' association
  my $feature_array_ref = $feature->controlFeatures(); # getter
  $feature->controlFeatures(\@feature_list); # setter

the way that this synopsis just hands you the constructor and every getter and every setter in one go?? obsessed. πŸ”₯


πŸ’– DESCRIPTION πŸ’–

Straight from the MAGE-OM documentation for the "Feature" class, and I quote:

An intended position on an array.

That's it. That's the whole description. Short. Iconic. Main character energy in one sentence. 🌟


🌈 INHERITANCE 🌈

Bio::MAGE::DesignElement::Feature has exactly one superclass, and it's:

  • Bio::MAGE::DesignElement::DesignElement

So yeah, it's a DesignElement at heart, and everything that comes with that is coming along for the ride. πŸ‘‘


πŸŽ€ CLASS METHODS πŸŽ€

Okay so here's the tea: every method in this section can be called without ever making an instance first β€” you just hit it with the Bio::MAGE::DesignElement::Feature->methodname() syntax. Class-level, no object needed. πŸ’…

new()

new(%args)

The object constructor new() takes these optional named-value style arguments, and honestly? She's flexible. ✨

  • name β€” sets the value of the name attribute (this attribute was inherited from class Bio::MAGE::Identifiable).
  • identifier β€” sets the value of the identifier attribute (this attribute was inherited from class Bio::MAGE::Identifiable).
  • controlType β€” sets the value of the controlType association (this association was inherited from class Bio::MAGE::DesignElement::DesignElement).

The value must be of type: instance of Bio::MAGE::Description::OntologyEntry.

  • controlledFeatures β€” sets the value of the controlledFeatures association.

The value must be of type: array of Bio::MAGE::DesignElement::Feature.

  • zone β€” sets the value of the zone association.

The value must be of type: instance of Bio::MAGE::ArrayDesign::Zone.

  • auditTrail β€” sets the value of the auditTrail association (this association was inherited from class Bio::MAGE::Describable).

The value must be of type: array of Bio::MAGE::AuditAndSecurity::Audit.

  • position β€” sets the value of the position association.

The value must be of type: instance of Bio::MAGE::DesignElement::Position.

  • propertySets β€” sets the value of the propertySets association (this association was inherited from class Bio::MAGE::Extendable).

The value must be of type: array of Bio::MAGE::NameValueType.

  • descriptions β€” sets the value of the descriptions association (this association was inherited from class Bio::MAGE::Describable).

The value must be of type: array of Bio::MAGE::Description::Description.

  • security β€” sets the value of the security association (this association was inherited from class Bio::MAGE::Describable).

The value must be of type: instance of Bio::MAGE::AuditAndSecurity::Security.

  • featureGroup β€” sets the value of the featureGroup association.

The value must be of type: instance of Bio::MAGE::ArrayDesign::FeatureGroup.

  • featureLocation β€” sets the value of the featureLocation association.

The value must be of type: instance of Bio::MAGE::DesignElement::FeatureLocation.

  • controlFeatures β€” sets the value of the controlFeatures association.

The value must be of type: array of Bio::MAGE::DesignElement::Feature.

$obj = class->new(%parameters)

The new() method is the class constructor. The one. The blueprint. 🫢

  • Parameters: if you hand it a list of name/value parameters, the corresponding slots, attributes, or associations get their initial values set by the constructor. Cute, right?
  • 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.

@names = class->get_slot_names()

get_slot_names() is how you pull the name of every slot defined in a given class. πŸŽ€

NOTE: the list of names does not include attribute or association names. Just so we're clear, bestie.
  • Return value: a list of the names of all slots defined for this class.
  • Side effects: none. Chill. 😌

@name_list = get_attribute_names()

Returns the list of attribute data members for this class. That's the whole job. Slay. πŸ’…

@name_list = get_association_names()

Returns the list of association data members for this class. Also just doing her little job. ✨

@class_list = get_superclasses()

Returns the list of superclasses for this class. The family tree, upward. 🌳

@class_list = get_subclasses()

Returns the list of subclasses for this class. The family tree, downward. 🌱

$name = class_name()

Returns the full class name for this class. No surprises, just the whole thing. πŸ‘‘

$package_name = package_name()

Returns the base package name (i.e. no 'namespace::') of the package that contains this class. So, like, the last name only. πŸ™ˆ

%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. Very meta. Very fetch. πŸ’œ


πŸ¦„ INSTANCE METHODS πŸ¦„

Now we're in object territory, bestie. Things you call on an actual $feature. Let's goooo. πŸš€

$obj_copy = $obj->new()

When you invoke it with an existing object reference and not a class name, the new() method acts as a copy constructor β€” the new object's initial values get set to be those of the existing object. It's literally "new object, who dis, but same data". πŸͺž

  • 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 initialize() method if it is defined by the class.

$obj->set_slots(%parameters)

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

set_slots() sets a bunch of slots all at once, because why do one when you can do many. πŸ’… It has two different invocation methods:

  1. The first takes a named parameter list.
  2. The second takes two array references.
  • Return value: none.
  • Side effects: will call croak() if a slot_name is used that the class does not define. ⚠️ So don't be out here inventing slot names, fr fr.

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

get_slots() grabs the values of a bunch of slots at the same time. Bulk actions only. πŸ›οΈ

  • 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. Precise. Direct. 🎯

  • 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 undef if the slot has not been initialized. 😭 (she's empty, it happens)
  • Side effects: none.

🌸 ATTRIBUTES 🌸

Okay so, 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. Two methods per attribute. That's the deal. πŸŽ€

Bio::MAGE::DesignElement::Feature has the following attribute accessor methods:

🌟 name

Methods for the name attribute.

From the MAGE-OM documentation:

The potentially ambiguous common identifier.
  • $val = $feature->setName($val) β€” the restricted setter method for the name attribute.
    • Input parameters: the value to which the name attribute will be set.
    • Return value: the current value of the name attribute.
    • Side effects: none.
    • Exceptions: will call croak() if no input parameters are specified, or if too many input parameters are specified. ⚠️ Goldilocks rules: not too few, not too many.
  • $val = $feature->getName() β€” the restricted getter method for the name attribute.
    • Input parameters: none.
    • Return value: the current value of the name attribute.
    • Side effects: none.
    • Exceptions: will call croak() if any input parameters are specified. 🚫 Don't hand her arguments, she didn't ask.

🌟 identifier

Methods for the identifier 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.

the way that uniqueness is scoped like that?? very "know your context" of it. πŸ’œ

(and bestie, we are so not done β€” there is more of this page, so hold that thought 🫢)

  • $val = $feature->setIdentifier($val) β€” the restricted setter for the identifier attribute, bestie. ✨

Input parameters: the value you're setting the identifier attribute to.

Return value: whatever the identifier attribute is currently sitting at.

Side effects: literally none, we stay unbothered. πŸ’…

Exceptions: calls croak() if you hand over zero input parameters, or if you're extra and pass too many. 🫠

  • $val = $feature->getIdentifier() β€” the restricted getter for the identifier attribute. 🌸

Input parameters: none, she takes nothing.

Return value: the current value of the identifier attribute.

Side effects: none.

Exceptions: calls croak() if you pass it any input parameters at all. Not a single one. 🚫


πŸ¦‹ ASSOCIATIONS πŸ¦‹

Okay so associations are just references to other classes, periodt. In MAGE-OM every association has a cardinality β€” that's the thing that decides the min and max number of instances of the 'other' class that can be in the association. Let's break it down:

  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.
  3. 1..N β€” there must be one or more items in the association, i.e. this is a mandatory data field, with list cardinality.
  4. 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::DesignElement::Feature has the following association accessor methods, no cap:

controlType

Methods for the controlType association.

From the MAGE-OM documentation:

If the design element represents a control, the type of control it is (normalization, deletion, negative, positive, etc.)
  • $val = $feature->setControlType($val) β€” the restricted setter for the controlType association. πŸŽ€

Input parameters: the value to which the controlType association will be set : one of the accepted enumerated values.

Return value: the current value of the controlType association : one of the accepted enumerated values.

Side effects: none.

Exceptions: calls 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 = $feature->getControlType() β€” the restricted getter for the controlType association. ✨

Input parameters: none.

Return value: the current value of the controlType association : an instance of type Bio::MAGE::Description::OntologyEntry.

Side effects: none.

Exceptions: calls croak() if any input parameters are specified.

controlledFeatures

Methods for the controlledFeatures association.

From the MAGE-OM documentation:

Associates features with their control features.
  • $array_ref = $feature->setControlledFeatures($array_ref) β€” the restricted setter for the controlledFeatures association. πŸ’–

Input parameters: the value to which the controlledFeatures association will be set : a reference to an array of objects of type Bio::MAGE::DesignElement::Feature.

Return value: the current value of the controlledFeatures association : a reference to an array of objects of type Bio::MAGE::DesignElement::Feature.

Side effects: none.

Exceptions: calls 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::DesignElement::Feature instances. πŸ™ˆ

  • $array_ref = $feature->getControlledFeatures() β€” the restricted getter for the controlledFeatures association. πŸ¦‹

Input parameters: none.

Return value: the current value of the controlledFeatures association : a reference to an array of objects of type Bio::MAGE::DesignElement::Feature.

Side effects: none.

Exceptions: calls croak() if any input parameters are specified.

  • $val = $feature->addControlledFeatures(@vals) β€” because the controlledFeatures association has list cardinality, it can hold more than one value. This method adds the current list of objects in the controlledFeatures association. πŸ”₯

Input parameters: the list of values @vals to add to the controlledFeatures 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: calls croak() if no input parameters are specified, or if any of the objects in @vals is not an instance of class Bio::MAGE::DesignElement::Feature.

zone

Methods for the zone association.

From the MAGE-OM documentation:

A reference to the zone this feature is in.
  • $val = $feature->setZone($val) β€” the restricted setter for the zone association. 🌸

Input parameters: the value to which the zone association will be set : one of the accepted enumerated values.

Return value: the current value of the zone association : one of the accepted enumerated values.

Side effects: none.

Exceptions: calls 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::ArrayDesign::Zone. 🫠

  • $val = $feature->getZone() β€” the restricted getter for the zone association. ⭐

Input parameters: none.

Return value: the current value of the zone association : an instance of type Bio::MAGE::ArrayDesign::Zone.

Side effects: none.

Exceptions: calls croak() if any input parameters are specified.

auditTrail

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 = $feature->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: calls 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 = $feature->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: calls croak() if any input parameters are specified.

  • $val = $feature->addAuditTrail(@vals) β€” because the auditTrail association has list cardinality, it can hold 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: calls 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.

position

Methods for the position association.

From the MAGE-OM documentation:

The position of the feature on the array, relative to the top, left corner.
  • $val = $feature->setPosition($val) β€” the restricted setter for the position association. ✨

Input parameters: the value to which the position association will be set : one of the accepted enumerated values.

Return value: the current value of the position association : one of the accepted enumerated values.

Side effects: none.

Exceptions: calls 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::DesignElement::Position. πŸ™ˆ

  • $val = $feature->getPosition() β€” the restricted getter for the position association. 🌈

Input parameters: none.

Return value: the current value of the position association : an instance of type Bio::MAGE::DesignElement::Position.

Side effects: none.

Exceptions: calls croak() if any input parameters are specified.

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.
  • $array_ref = $feature->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: calls 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 = $feature->getPropertySets() β€” the restricted getter for the propertySets association. πŸ’…

Input parameters: none.

The return value? It's the current value of the propertySets association β€” a reference to an array of objects of type Bio::MAGE::NameValueType. πŸ’–

Side effects: none, we stay unbothered. ✨

Exceptions: it will call croak() if any input parameters are specified. So hand it nothing, bestie, it's not the vibe.

  • $val = $feature->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. 🫢
    • 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: it 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.

descriptions πŸ’œ

Methods for the descriptions association.

From the MAGE-OM documentation:

Free hand text descriptions. Makes available the associations of Description to an instance of Describable.
  • $array_ref = $feature->setDescriptions($array_ref) β€” the restricted setter method for the descriptions association. restricted meaning it's gonna check your work, okay? πŸ‘€
    • 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: it 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 = $feature->getDescriptions() β€” the restricted getter method for the descriptions association. Just reading, no touching. πŸ’…
    • 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: it will call croak() if any input parameters are specified
  • $val = $feature->addDescriptions(@vals) β€” because the descriptions association has list cardinality, it 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: it 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 πŸ”

Methods for the security association.

From the MAGE-OM documentation:

Information on the security for the instance of the class.
  • $val = $feature->setSecurity($val) β€” the restricted setter method 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
    • Exceptions: it 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::AuditAndSecurity::Security
  • $val = $feature->getSecurity() β€” the restricted getter method for the security association.
    • Input parameters: none
    • Return value: the current value of the security association : an instance of type Bio::MAGE::AuditAndSecurity::Security.
    • Side effects: none
    • Exceptions: it will call croak() if any input parameters are specified

featureGroup πŸŽ€

Methods for the featureGroup association.

From the MAGE-OM documentation:

The features that belong to this group.
  • $val = $feature->setFeatureGroup($val) β€” the restricted setter method for the featureGroup association.
    • Input parameters: the value to which the featureGroup association will be set : one of the accepted enumerated values.
    • Return value: the current value of the featureGroup association : one of the accepted enumerated values.
    • Side effects: none
    • Exceptions: it 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::ArrayDesign::FeatureGroup
  • $val = $feature->getFeatureGroup() β€” the restricted getter method for the featureGroup association.
    • Input parameters: none
    • Return value: the current value of the featureGroup association : an instance of type Bio::MAGE::ArrayDesign::FeatureGroup.
    • Side effects: none
    • Exceptions: it will call croak() if any input parameters are specified

featureLocation πŸ“

Methods for the featureLocation association.

From the MAGE-OM documentation:

Location of this feature relative to a grid.
  • $val = $feature->setFeatureLocation($val) β€” the restricted setter method for the featureLocation association.
    • Input parameters: the value to which the featureLocation association will be set : one of the accepted enumerated values.
    • Return value: the current value of the featureLocation association : one of the accepted enumerated values.
    • Side effects: none
    • Exceptions: it 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::DesignElement::FeatureLocation
  • $val = $feature->getFeatureLocation() β€” the restricted getter method for the featureLocation association.
    • Input parameters: none
    • Return value: the current value of the featureLocation association : an instance of type Bio::MAGE::DesignElement::FeatureLocation.
    • Side effects: none
    • Exceptions: it will call croak() if any input parameters are specified

controlFeatures 🧚

Methods for the controlFeatures association.

From the MAGE-OM documentation:

Associates features with their control features.
  • $array_ref = $feature->setControlFeatures($array_ref) β€” the restricted setter method for the controlFeatures association.
    • Input parameters: the value to which the controlFeatures association will be set : a reference to an array of objects of type Bio::MAGE::DesignElement::Feature
    • Return value: the current value of the controlFeatures association : a reference to an array of objects of type Bio::MAGE::DesignElement::Feature
    • Side effects: none
    • Exceptions: it 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::DesignElement::Feature instances
  • $array_ref = $feature->getControlFeatures() β€” the restricted getter method for the controlFeatures association. No cap, it just reads. πŸ‘‘
    • Input parameters: none
    • Return value: the current value of the controlFeatures association : a reference to an array of objects of type Bio::MAGE::DesignElement::Feature
    • Side effects: none
    • Exceptions: it will call croak() if any input parameters are specified
  • $val = $feature->addControlFeatures(@vals) β€” because the controlFeatures association has list cardinality, it may store more than one value. This method adds the current list of objects in the controlFeatures association. ✨
    • Input parameters: the list of values @vals to add to the controlFeatures 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: it 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::DesignElement::Feature

And then there's this lil initialize sub just vibing in the source, doing its one (1) job, no notes: πŸ’–

sub initialize {

  my $self = shift;
  return 1;

}

✨ SLOTS, ATTRIBUTES, AND ASSOCIATIONS ✨

okay bestie, in the Perl implementation of MAGE-OM classes there are three types of class data members: "slots", "attributes", and "associations". πŸ’…


🌸 SLOTS 🌸

This API uses the term "slot" to mean a data member of the class that was not present in the UML model, and it's mainly for internal purposes β€” so only touch it if you truly understand the inner workings of the API, fr fr. Most often slots get used by generic methods like the ones in the XML writing and reading classes.

Slots are implemented with 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 β€” and the return value is also $new_var. cute.

@names = $obj->get_slot_names()

Returns the list of all slots in the class. periodt.

DATA CHECKING: No data type checking is made for these methods. 🫠


πŸŽ€ ATTRIBUTES AND ASSOCIATIONS πŸŽ€

The terms "attribute" and "association" mean 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*
    • 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: 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) β€” they're waiting bestie. 🫢


πŸ‘‘ AUTHOR πŸ‘‘

Jason E. Stewart (jasons 'at' cpan 'dot' org)


🌟 SEE ALSO 🌟

perl(1).


🚨 POD ERRORS 🚨

Hey! The above document had some coding errors, which are explained below:

  • Around line 528:
    • '=item' outside of any '=over'
  • Around line 613:
    • You forgot a '=back' before '=head2'
  • Around line 785:
    • Expected '=item 2'
  • Around line 790:
    • Expected '=item 3'
  • Around line 795:
    • Expected '=item 4'

this page is from perl v5.32.0, dated 2020-11-27, and it's MAGE::...eature(3pm) β€” slay, bye bestie πŸ’…βœ¨