MAGE::...ioAssay(3pm)

🌸 NAME 🌸

Bio::MAGE::BioAssay::DerivedBioAssay β€” a class for the MAGE-OM API, bestie. This is the MAGE::...ioAssay(3pm) page, straight outta User Contributed Perl Documentation. πŸ’–


✨ SYNOPSIS ✨

use Bio::MAGE::BioAssay::DerivedBioAssay

# creating an empty instance
my $derivedbioassay = Bio::MAGE::BioAssay::DerivedBioAssay->new();

# creating an instance with existing data
my $derivedbioassay = Bio::MAGE::BioAssay::DerivedBioAssay->new(
      name=>$name_val,
      identifier=>$identifier_val,
      channels=>\@channel_list,
      auditTrail=>\@audit_list,
      propertySets=>\@namevaluetype_list,
      bioAssayFactorValues=>\@factorvalue_list,
      descriptions=>\@description_list,
      security=>$security_ref,
      derivedBioAssayMap=>\@bioassaymap_list,
      type=>$ontologyentry_ref,
      derivedBioAssayData=>\@derivedbioassaydata_list,
);

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

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

# 'channels' association
my $channel_array_ref = $derivedbioassay->channels(); # getter
$derivedbioassay->channels(\@channel_list); # setter

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

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

# 'bioAssayFactorValues' association
my $factorvalue_array_ref = $derivedbioassay->bioAssayFactorValues(); # getter
$derivedbioassay->bioAssayFactorValues(\@factorvalue_list); # setter

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

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

# 'derivedBioAssayMap' association
my $bioassaymap_array_ref = $derivedbioassay->derivedBioAssayMap(); # getter
$derivedbioassay->derivedBioAssayMap(\@bioassaymap_list); # setter

# 'type' association
my $ontologyentry_ref = $derivedbioassay->type(); # getter
$derivedbioassay->type($ontologyentry_ref); # setter

# 'derivedBioAssayData' association
my $derivedbioassaydata_array_ref = $derivedbioassay->derivedBioAssayData(); # getter
$derivedbioassay->derivedBioAssayData(\@derivedbioassaydata_list); # setter

πŸ’œ DESCRIPTION πŸ’œ

okay so, quoting the MAGE-OM documentation for the "DerivedBioAssay" class, fr fr:

A BioAssay that is created by the Transformation BioEvent from one or more MeasuredBioAssays or DerivedBioAssays.

periodt. that's the whole vibe. 🧬


πŸ¦‹ INHERITANCE πŸ¦‹

Bio::MAGE::BioAssay::DerivedBioAssay has these superclasses, and it's giving very "borrowed the whole wardrobe" energy:

  • Bio::MAGE::BioAssay::BioAssay

πŸ‘‘ CLASS METHODS πŸ‘‘

The way that all of these can be called without having an instance first?? iconic. You just go Bio::MAGE::BioAssay::DerivedBioAssay->methodname(). πŸ’…

new()

new(%args)

The object constructor "new()" takes these optional named-value style arguments, and no cap, you can pass them by name:

  • 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").
  • channels β€” sets the value of the "channels" association (this association was inherited from class "Bio::MAGE::BioAssay::BioAssay").

The value must be of type: array of "Bio::MAGE::BioAssay::Channel".

  • 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".

  • 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".

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

The value must be of type: array of "Bio::MAGE::Experiment::FactorValue".

  • 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".

  • derivedBioAssayMap β€” sets the value of the "derivedBioAssayMap" association.

The value must be of type: array of "Bio::MAGE::BioAssayData::BioAssayMap".

  • 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".

  • type β€” sets the value of the "type" association.

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

  • derivedBioAssayData β€” sets the value of the "derivedBioAssayData" association.

The value must be of type: array of "Bio::MAGE::BioAssayData::DerivedBioAssayData".

$obj = class->new(%parameters)

The "new()" method is the class constructor. the main character, honestly.

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.

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()

The "get_slot_names()" method is how you retrieve the name of all slots defined in a given class.

NOTE: the list of names does not include attribute or association names. not even a little. πŸ’€

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. so many. obsessed.

@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. yes, the whole government name. πŸ‘‘

$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 "Association" objects that provide the meta-information for the association. lowkey meta of it all.


🌈 INSTANCE METHODS 🌈

$obj_copy = $obj->new()

When you invoke "new()" with an existing object reference and not a class name, it acts as a copy constructor β€” the new object's initial values are set to be those of the existing object. it's giving twin energy. πŸ‘―

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)

The "set_slots()" method sets a bunch of slots at the same time, efficiency queen. 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 "croak()" if a slot_name is used that the class does not define. 🐸

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

The "get_slots()" method gets 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 "set_slot()" 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 "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. 😭

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. one for giving, one for receiving, we love a healthy relationship. πŸ’–

"Bio::MAGE::BioAssay::DerivedBioAssay" has the following attribute accessor methods:

name

Methods for the "name" attribute.

From the MAGE-OM documentation:

The potentially ambiguous common identifier.

$val = $derivedbioassay->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

$val = $derivedbioassay->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

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.

$val = $derivedbioassay->setIdentifier($val)

The restricted setter method for the "identifier" attribute.

  • Input parameters: the value to which the "identifier" attribute will be set
  • Return value: the current value of the "identifier" attribute
  • Side effects: none
  • $val = $derivedbioassay->getIdentifier() β€” the restricted getter for the identifier attribute, bestie. She's locked down, she only reads. πŸ”’
    • Input parameters: none, literally zero, don't even try it
    • Return value: the current value of the identifier attribute
    • Side effects: none, she's chill
    • Exceptions: will call croak() if any input parameters are specified β€” so keep your hands to yourself πŸ™ˆ

πŸ¦‹ ASSOCIATIONS πŸ¦‹

Okay so, associations are just references to other classes, right? And in MAGE-OM every association has a cardinality β€” that's the rule about how many instances of the other class are allowed in there. It's giving capacity limit, and it goes like this:

  1. There must be exactly one item in the association β€” so this is a mandatory data field. no more, no less, periodt.
  2. 0..1

There may be one item in the association, so it's an optional data field. take it or leave it energy πŸ’…

  1. 1..N

There must be one or more items in the association β€” mandatory data field, but with list cardinality. so like, at least one, but go off queen πŸ‘‘

  1. 0..N

There may be one or more items in the association β€” optional data field, with list cardinality. zero to infinity, no cap.

Bio::MAGE::BioAssay::DerivedBioAssay has the following association accessor methods:


πŸ’– channels πŸ’–

Methods for the channels association.

From the MAGE-OM documentation:

Channels can be non-null for all subclasses. For instance, collapsing across replicate features will create a DerivedBioAssay that will potentially reference channels.
  • $array_ref = $derivedbioassay->setChannels($array_ref) β€” the restricted setter for the channels association. she sets, that's her job 🫢
    • Input parameters: the value to which the channels association will be set β€” a reference to an array of objects of type Bio::MAGE::BioAssay::Channel
    • Return value: the current value of the channels association β€” a reference to an array of objects of type Bio::MAGE::BioAssay::Channel
    • 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 of class Bio::MAGE::BioAssay::Channel instances
  • $array_ref = $derivedbioassay->getChannels() β€” the restricted getter for the channels association.
    • Input parameters: none
    • Return value: the current value of the channels association β€” a reference to an array of objects of type Bio::MAGE::BioAssay::Channel
    • Side effects: none
    • Exceptions: will call croak() if any input parameters are specified
  • $val = $derivedbioassay->addChannels(@vals) β€” because the channels association has list cardinality, it can hold more than one value. This method adds the current list of objects in the channels association. stack 'em up πŸ₯ž
    • Input parameters: the list of values @vals to add to the channels 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::BioAssay::Channel

πŸ’œ 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 = $derivedbioassay->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 of class Bio::MAGE::AuditAndSecurity::Audit instances
  • $array_ref = $derivedbioassay->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 = $derivedbioassay->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: 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 πŸŽ€

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 = $derivedbioassay->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 of class Bio::MAGE::NameValueType instances
  • $array_ref = $derivedbioassay->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 = $derivedbioassay->addPropertySets(@vals) β€” because the propertySets association has list cardinality, it can hold 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

🌸 bioAssayFactorValues 🌸

Methods for the bioAssayFactorValues association.

From the MAGE-OM documentation:

The values that this BioAssay is associated with for the experiment.
  • $array_ref = $derivedbioassay->setBioAssayFactorValues($array_ref) β€” the restricted setter for the bioAssayFactorValues association.
    • Input parameters: the value to which the bioAssayFactorValues association will be set β€” a reference to an array of objects of type Bio::MAGE::Experiment::FactorValue
    • Return value: the current value of the bioAssayFactorValues association β€” a reference to an array of objects of type Bio::MAGE::Experiment::FactorValue
    • 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 of class Bio::MAGE::Experiment::FactorValue instances
  • $array_ref = $derivedbioassay->getBioAssayFactorValues() β€” the restricted getter for the bioAssayFactorValues association.
    • Input parameters: none
    • Return value: the current value of the bioAssayFactorValues association β€” a reference to an array of objects of type Bio::MAGE::Experiment::FactorValue
    • Side effects: none
    • Exceptions: will call croak() if any input parameters are specified
  • $val = $derivedbioassay->addBioAssayFactorValues(@vals) β€” because the bioAssayFactorValues association has list cardinality, it can hold more than one value. This method adds the current list of objects in the bioAssayFactorValues association.
    • Input parameters: the list of values @vals to add to the bioAssayFactorValues 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::Experiment::FactorValue

🧚 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 = $derivedbioassay->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, we stay unbothered πŸ’…

Exceptions: it will croak() at you if you pass no input parameters, if you pass too many, or if $array_ref isn't actually a reference to an array of Bio::MAGE::Description::Description instances πŸ’€ like bestie it checks, it's not playing

  • $array_ref = $derivedbioassay->getDescriptions() β€” the restricted getter method for the descriptions association. Read-only era. πŸ“–
    • Input parameters: none, don't even try πŸ™…
    • 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 croak() if any input parameters are specified at all 😭 zero tolerance
  • $val = $derivedbioassay->addDescriptions(@vals) β€” because the descriptions association has list cardinality, it can hold more than one value (it's poly, it's generous 🫢). This method adds the current list of objects into the descriptions association.
    • Input parameters: the list of values @vals to add to the descriptions association. NOTE: submitting a single value is permitted β€” one is a valid list length, no gatekeeping πŸ‘‘
    • Return value: the number of items stored in the slot after adding @vals πŸ”’
    • Side effects: none
    • Exceptions: it will 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 πŸ’€

🌸 derivedBioAssayMap 🌸

Methods for the derivedBioAssayMap association.

From the MAGE-OM documentation:

The DerivedBioAssay that is produced by the sources of the BioAssayMap.
  • $array_ref = $derivedbioassay->setDerivedBioAssayMap($array_ref) β€” the restricted setter method for the derivedBioAssayMap association.
    • Input parameters: the value to which the derivedBioAssayMap association will be set β€” a reference to an array of objects of type Bio::MAGE::BioAssayData::BioAssayMap ✨
    • Return value: the current value of the derivedBioAssayMap association β€” a reference to an array of objects of type Bio::MAGE::BioAssayData::BioAssayMap
    • Side effects: none
    • Exceptions: it will croak() if no input parameters are specified, if too many input parameters are specified, or if $array_ref is not a reference to an array of Bio::MAGE::BioAssayData::BioAssayMap instances 😀
  • $array_ref = $derivedbioassay->getDerivedBioAssayMap() β€” the restricted getter method for the derivedBioAssayMap association.
    • Input parameters: none 🚫
    • Return value: the current value of the derivedBioAssayMap association β€” a reference to an array of objects of type Bio::MAGE::BioAssayData::BioAssayMap
    • Side effects: none
    • Exceptions: it will croak() if any input parameters are specified 🫠
  • $val = $derivedbioassay->addDerivedBioAssayMap(@vals) β€” because the derivedBioAssayMap association has list cardinality, it may store more than one value. This method adds the current list of objects in the derivedBioAssayMap association.
    • Input parameters: the list of values @vals to add to the derivedBioAssayMap 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 croak() if no input parameters are specified, or if any of the objects in @vals is not an instance of class Bio::MAGE::BioAssayData::BioAssayMap πŸ’€

πŸ” security πŸ”

Methods for the security association.

From the MAGE-OM documentation:

Information on the security for the instance of the class.
  • $val = $derivedbioassay->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 croak() if no input parameters are specified, if too many input parameters are specified, or if $val is not an instance of class Bio::MAGE::AuditAndSecurity::Security 😭
  • $val = $derivedbioassay->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 croak() if any input parameters are specified

πŸ¦‹ type πŸ¦‹

Methods for the type association.

From the MAGE-OM documentation:

The derivation type, for instance collapsed spot replicate, ratio, averaged intensity, bioassay replicates, etc.
  • $val = $derivedbioassay->setType($val) β€” the restricted setter method for the type association.
    • Input parameters: the value to which the type association will be set β€” one of the accepted enumerated values πŸ‘‘
    • Return value: the current value of the type association β€” one of the accepted enumerated values
    • Side effects: none
    • Exceptions: it will croak() if no input parameters are specified, if too many input parameters are specified, or if $val is not an instance of class Bio::MAGE::Description::OntologyEntry πŸ’€
  • $val = $derivedbioassay->getType() β€” the restricted getter method for the type association.
    • Input parameters: none 🚫
    • Return value: the current value of the type association β€” an instance of type Bio::MAGE::Description::OntologyEntry 🌈
    • Side effects: none
    • Exceptions: it will croak() if any input parameters are specified

πŸ’œ derivedBioAssayData πŸ’œ

Methods for the derivedBioAssayData association.

From the MAGE-OM documentation:

The data associated with the DerivedBioAssay.
  • $array_ref = $derivedbioassay->setDerivedBioAssayData($array_ref) β€” the restricted setter method for the derivedBioAssayData association.
    • Input parameters: the value to which the derivedBioAssayData association will be set β€” a reference to an array of objects of type Bio::MAGE::BioAssayData::DerivedBioAssayData ✨
    • Return value: the current value of the derivedBioAssayData association β€” a reference to an array of objects of type Bio::MAGE::BioAssayData::DerivedBioAssayData
    • Side effects: none
    • Exceptions: it will croak() if no input parameters are specified, if too many input parameters are specified, or if $array_ref is not a reference to an array of Bio::MAGE::BioAssayData::DerivedBioAssayData instances 😀
  • $array_ref = $derivedbioassay->getDerivedBioAssayData() β€” the restricted getter method for the derivedBioAssayData association.
    • Input parameters: none πŸ™…
    • Return value: the current value of the derivedBioAssayData association β€” a reference to an array of objects of type Bio::MAGE::BioAssayData::DerivedBioAssayData
    • Side effects: none
    • Exceptions: it will croak() if any input parameters are specified 🫠
  • $val = $derivedbioassay->addDerivedBioAssayData(@vals) β€” because the derivedBioAssayData association has list cardinality, it may store more than one value (it's got range, we love that for it πŸ’…). This method adds the current list of objects in the derivedBioAssayData association.
    • Input parameters: the list of values @vals to add to the derivedBioAssayData 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 croak() if no input parameters are specified, or if any of the objects in @vals is not an instance of class Bio::MAGE::BioAssayData::DerivedBioAssayData πŸ’€

And then, the moment of truth, the little baby subroutine that just… vibes ✨

  sub initialize {

    my $self = shift;
    return 1;

  }

That's it, that's the whole thing. initialize takes $self, shifts it off the arg list, and returns 1. No notes, no drama, it just is πŸŽ€

✨ SLOTS, ATTRIBUTES, AND ASSOCIATIONS ✨

ok so bestie, in the Perl implementation of MAGE-OM classes there are three kinds of class data members and you gotta know the difference: slots, attributes, and associations. let's go πŸ’…

🌸 SLOTS 🌸

so this API uses the word "slot" to mean a data member of the class that wasn't in the UML model β€” it's there for mainly internal purposes, so like, only touch it if you genuinely understand the inner workings of the API. no cap. most of the time slots get used by generic methods, like the ones in the XML writing and reading classes. iykyk 🫢

slots are implemented with unified getter/setter methods, which is giving very convenient:

  • $var = $obj->slot_name(); β€” grabs 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 πŸ’–
  • @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. literally none. it's giving "we trust you". 😭

πŸ¦‹ ATTRIBUTES AND ASSOCIATIONS πŸ¦‹

ok so the terms "attribute" and "association" mean data members of the class that were specified directly from the UML model. those ones are official, bestie.

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. 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. fr fr.
    • 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. slay.
    • 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. main character energy honestly:

$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 πŸ›

found a bug? bestie please send bug reports to the project mailing list: (mged-mage 'at' lists 'dot' sf 'dot' net) β€” we wanna hear it, no judgement πŸ’–

πŸ‘‘ AUTHOR πŸ‘‘

Jason E. Stewart β€” (jasons 'at' cpan 'dot' org) 🌟

🌈 SEE ALSO 🌈

perl(1). that's it, that's the list πŸ’…


πŸ™ˆ POD ERRORS πŸ™ˆ

hey! so the above document had some coding errors, which are explained below β€” not me being messy, this is literally what the doc says:

Around line 441:

'=item' outside of any '=over'

Around line 526:

You forgot a '=back' before any '=head2'

Around line 698:

Expected '=item 2'

Around line 703:

Expected '=item 3'

Around line 708:

Expected '=item 4'
ngl these little POD oopsies are lowkey iconic at this point 😭 the doc just had some =item and =back drama. we move. 🧚

and that's a wrap on this whole page, bestie! πŸŽ€ this beauty is perl v5.32.0, dated 2020-11-27, and it lives at MAGE::...ioAssay(3pm). go forth and read your objects, you absolute legend πŸŒΈπŸ’–βœ¨