MAGE::...osition(3pm)

πŸ’– Bio::MAGE::DesignElement::ReporterPosition β€” from the MAGE::...osition(3pm) page πŸ’–

User Contributed Perl Documentation Β· MAGE::...osition(3pm)

okay bestie sit DOWN because we're doing MAGE-OM Perl modules and honestly? it's giving very demure, very mindful, very object-oriented. this is the page for Bio::MAGE::DesignElement::ReporterPosition, and yes the manual name got chopped up all cute like MAGE::...osition(3pm) because the full class name is a whole entire novel. we move. πŸ¦‹


✨ NAME ✨

Bio::MAGE::DesignElement::ReporterPosition β€” the class for the MAGE-OM API. that's it, that's the name, slay. πŸ‘‘


🌸 SYNOPSIS 🌸

here's the whole vibe, copy-paste ready, no cap:

use Bio::MAGE::DesignElement::ReporterPosition

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

# creating an instance with existing data
my $reporterposition = Bio::MAGE::DesignElement::ReporterPosition->new(
      end=>$end_val,
      start=>$start_val,
      propertySets=>\@namevaluetype_list,
      reporter=>$reporter_ref,
      mismatchInformation=>\@mismatchinformation_list,
);

# 'end' attribute
my $end_val = $reporterposition->end(); # getter
$reporterposition->end($value); # setter

# 'start' attribute
my $start_val = $reporterposition->start(); # getter
$reporterposition->start($value); # setter

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

# 'reporter' association
my $reporter_ref = $reporterposition->reporter(); # getter
$reporterposition->reporter($reporter_ref); # setter

# 'mismatchInformation' association
my $mismatchinformation_array_ref = $reporterposition->mismatchInformation(); # getter
$reporterposition->mismatchInformation(\@mismatchinformation_list); # setter

like. look at it. getters AND setters in one method each, the duality, the range, the versatility. iconic behavior honestly. πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

straight from the MAGE-OM documentation for the "ReporterPosition" class, and I'm quoting the lore directly:

The location in the composite target's sequence to which a source reporter maps. The association to MismatchInformation allows the specification, usually for control purposes, of deviations from the CompositeSequence's BioMaterial.

so yeah. it's the coordinates, bestie. where the reporter maps. and the MismatchInformation association is there so you can clock the deviations from the CompositeSequence's BioMaterial β€” usually for control purposes, iykyk. 🧚


🌈 INHERITANCE 🌈

Bio::MAGE::DesignElement::ReporterPosition has the following superclasses β€” its whole ancestry, its bloodline, its main character lineage:

  • Bio::MAGE::BioSequence::SequencePosition

that's the one. it's giving "everything you have, you got from your parent class". πŸ’œ


⭐ CLASS METHODS ⭐

the following methods can all be called without first having an instance of the class, using this exact syntax:

Bio::MAGE::DesignElement::ReporterPosition->methodname()

no object required. class methods said "I don't need a plus-one". periodt.

🌸 new()

🌸 new(%args)

the object constructor "new()" accepts the following optional named-value style arguments β€” every single one, no skips:

  • end β€” sets the value of the "end" attribute. (this attribute was inherited from class "Bio::MAGE::BioSequence::SequencePosition".)
  • start β€” sets the value of the "start" attribute. (this attribute was inherited from class "Bio::MAGE::BioSequence::SequencePosition".)
  • 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".
  • reporter β€” sets the value of the "reporter" association. the value must be of type: instance of "Bio::MAGE::DesignElement::Reporter".
  • mismatchInformation β€” sets the value of the "mismatchInformation" association. the value must be of type: array of "Bio::MAGE::DesignElement::MismatchInformation".

πŸ’« $obj = class->new(%parameters)

the "new()" method is the class constructor. the big one. the builder.

  • 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 "initialize()" method if it is defined by the class.
note the side effect bestie, initialize() sneaks in there if the class defines it. no surprises later, ok? πŸ™ˆ

πŸ¦‹ @names = class->get_slot_names()

the "get_slot_names()" 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

clean. zero side effects. the calm one in the group chat. 😌

✨ @name_list = get_attribute_names()

returns the list of attribute data members for this class. that's the attributes, not the associations, don't get it twisted.

✨ @name_list = get_association_names()

returns the list of association data members for this class. and this is the associations. they're different lists, bestie, respect the separation. πŸ’…

πŸ‘‘ @class_list = get_superclasses()

returns the list of superclasses for this class. the ancestors. the elders. the ones who came before.

πŸ‘‘ @class_list = get_subclasses()

returns the list of subclasses for this class. the descendants. the legacy. the heirs to the throne.

πŸ’œ $name = class_name()

returns the full class name for this class. the whole government name, middle names included.

πŸ’œ $package_name = package_name()

returns the base package name (i.e. no 'namespace::') of the package that contains this class. so like, the name without the dramatic prefix. the nickname version. πŸŽ€

🌈 %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.

so: keys = association names, values = "Association" objects with the meta-info. it's a whole lookup table of lore and honestly I'm obsessed. πŸ“

πŸ’… INSTANCE METHODS πŸ’…

bestie these are the instance girlies β€” you call them on an actual object, not on the class itself. main character methods only πŸ’–

  • $obj_copy = $obj->new() β€” when you invoke this on an existing object reference and not a class name, new() stops being a constructor and starts being a copy constructor πŸͺž β€” the new object's initial values get set to be those of the existing object. it's giving clone, but make it classy ✨
    • Parameters: no input parameters are used in the copy constructor, the initial values are taken directly from the object to be copied. zero args, zero notes πŸ™ˆ
    • 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. so yeah, that happens, just so you know. ⚠️
  • $obj->set_slots(%parameters) $obj->set_slots(\@name_list, \@value_list) β€” the set_slots() method is your "set a bunch of slots at once" button πŸ”₯ and it has two whole invocation methods. method one takes a named parameter list, method two takes two array references. pick your fighter, both slay.
    • Return value: none πŸ«₯
    • Side effects: will call croak() if a slot_name is used that the class does not define. so like, don't make up slot names, bestie, it will yell at you πŸ’€
  • @obj_list = $obj->get_slots(@name_list) β€” the get_slots() method grabs the values of a bunch of slots at the same time. bulk haul, no cap πŸ›οΈ
    • Return value: a list of instance objects πŸ‘‘
    • Side effects: none 🧚
  • $val = $obj->set_slot($name,$val) β€” the set_slot() method sets the slot $name to the value $val. one slot, one value, very demure ✨
    • 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. (yes, the docs say "a number of slots" for the single slot getter. i don't make the rules, i just report them faithfully 😭)
    • Return value: a single slot value, or undef if the slot has not been initialized. so like, check for undef, fr fr 🫢
    • 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 β€” no shortcuts, we do it properly here πŸ’–

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

πŸ“ end πŸ“

Methods for the "end" attribute.

from the MAGE-OM documentation:

the location of the base, for nucleotides, that the SeqFeature ends. 🧬
  • $val = $reporterposition->setEnd($val) β€” the restricted setter method for the "end" attribute. πŸ”’
    • Input parameters: the value to which the "end" attribute will be set
    • Return value: the current value of the "end" attribute
    • Side effects: none
    • Exceptions: will call croak() if no input parameters are specified, or if too many input parameters are specified. so like, exactly one value, no more no less πŸ‘‘
  • $val = $reporterposition->getEnd() β€” the restricted getter method for the "end" attribute. πŸ”’
    • Input parameters: none
    • Return value: the current value of the "end" attribute
    • Side effects: none
    • Exceptions: will call croak() if any input parameters are specified. hands off, it takes literally nothing πŸ™…

πŸ¦‹ start πŸ¦‹

Methods for the "start" attribute.

from the MAGE-OM documentation:

the location of the base, for nucleotides, that the SeqFeature starts. 🧬
  • $val = $reporterposition->setStart($val) β€” the restricted setter method for the "start" attribute. πŸ”’
    • Input parameters: the value to which the "start" attribute will be set
    • Return value: the current value of the "start" attribute
    • Side effects: none
    • Exceptions: will call croak() if no input parameters are specified, or if too many input parameters are specified. one value bestie, that's the whole vibe ✨
  • $val = $reporterposition->getStart() β€” the restricted getter method for the "start" attribute. πŸ”’
    • Input parameters: none
    • Return value: the current value of the "start" attribute
    • Side effects: none
    • Exceptions: will call croak() if any input parameters are specified. it wants zero, and it means zero πŸ’…

🌈 ASSOCIATIONS 🌈

associations are references to other classes. and here's the tea: 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. so like, how many friends is this slot allowed to have 🫢

  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

There may be one or more items in the association, i.e. this is an optional data field, with list cardinality.

Bio::MAGE::DesignElement::ReporterPosition has the following association accessor methods:

🧚 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 = $reporterposition->setPropertySets($array_ref) β€” the restricted setter method 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 = $reporterposition->getPropertySets() β€” the restricted getter method 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 = $reporterposition->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: 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 πŸ’€

πŸ‘‘ reporter πŸ‘‘

Methods for the "reporter" association.

from the MAGE-OM documentation:

a reporter that comprises part of a CompositeSequence. 🧬
  • $val = $reporterposition->setReporter($val) β€” the restricted setter method for the "reporter" association. πŸ”’
    • Input parameters: the value to which the "reporter" association will be set : one of the accepted enumerated values.
    • Return value: the current value of the "reporter" 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::DesignElement::Reporter πŸ’€
  • $val = $reporterposition->getReporter() β€” the restricted getter method for the "reporter" association. πŸ”’
    • Input parameters: none
    • Return value: the current value of the "reporter" association : an instance of type Bio::MAGE::DesignElement::Reporter.
    • Side effects: none
    • Exceptions: will call croak() if any input parameters are specified πŸ™…

πŸ’œ mismatchInformation πŸ’œ

Methods for the "mismatchInformation" association.

from the MAGE-OM documentation:

differences in how the reporter matches its compositeSequence's sequence. πŸ”
  • $array_ref = $reporterposition->setMismatchInformation($array_ref) β€” the restricted setter method for the "mismatchInformation" association. πŸ”’
    • Input parameters: the value to which the "mismatchInformation" association will be set : a reference to an array of objects of type Bio::MAGE::DesignElement::MismatchInformation
    • Return value: the current value of the "mismatchInformation" association : a reference to an array of objects of type Bio::MAGE::DesignElement::MismatchInformation
    • 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::DesignElement::MismatchInformation instances πŸ’€
  • $array_ref = $reporterposition->getMismatchInformation() β€” the restricted getter method for the "mismatchInformation" association. πŸ”’
    • Input parameters: none
    • Return value: the current value of the "mismatchInformation" association : a reference to an array of objects of type Bio::MAGE::DesignElement::MismatchInformation
    • Side effects: none
    • Exceptions: will call croak() if any input parameters are specified πŸ™…
  • $val = $reporterposition->addMismatchInformation(@vals) β€” because the mismatchInformation association has list cardinality, it may store more than one value. this method adds the current list of objects in the mismatchInformation association. ✨
    • Input parameters: the list of values @vals to add to the mismatchInformation 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::DesignElement::MismatchInformation πŸ’€

and then there's this lil snippet sitting right there at the end, exactly as it appears:

sub initialize {

  my $self = shift;
  return 1;

}

no notes. it's just vibing there. 🌸

✨ SLOTS, ATTRIBUTES, AND ASSOCIATIONS ✨

ok so bestie, in the Perl implementation of MAGE-OM classes there are literally three types of class data members and you're gonna meet all three: "slots", "attributes", and "associations". πŸ’…


πŸŽ€ SLOTS πŸŽ€

so this API uses the term "slot" for a data member of the class that was not present in the UML model β€” it's there for mainly internal purposes. translation: use only if you understand the inner workings of the API. no cap. 🫠

most of the time slots get used by generic methods, like the ones hanging out in the XML writing and reading classes.

slots are implemented with unified getter/setter methods, and they're giving very much dual-purpose:

  • $var = $obj->slot_name(); β€” grabs the current value of the slot, periodt.
  • $new_var = $obj->slot_name($new_var); β€” stores $new_var in the slot, and the return value is also $new_var. it's giving two-for-one. ✨
  • @names = $obj->get_slot_names() β€” returns the list of all slots in the class. all of them. the whole roster. πŸ‘‘
DATA CHECKING: nope, none, zero. No data type checking is made for these methods. πŸ’€

🌸 ATTRIBUTES AND ASSOCIATIONS 🌸

now "attribute" and "association" are the terms for data members of the class that were specified directly from the UML model β€” so like, the official ones.

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. so expect a ref, not a plain list, bestie.
DATA CHECKING: ensure that no argument is provided. none. nada. don't even think about it. πŸ™ˆ
  • set* β€” sets the current value, replacing any existing value. out with the old, in with the new. πŸ’…
NOTE: for associations, if the association has list cardinality, the argument must be an array reference. and because of that, you probably should be using the add* methods instead. like, seriously, use add*. πŸŽ€
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. the class has to be right, okay? no wrong vibes allowed. 🌈
  • add* β€” the icon, the moment, the one you actually want.
NOTE: only present in associations with list cardinality. if it's not there, that's why, don't come for me. πŸ¦‹

appends a list of objects to any values that may already be stored in the association. it adds, it doesn't replace. main character behaviour. πŸ‘‘

DATA CHECKING: ensure that all arguments are of the correct MAGE-OM class. all of them. fr fr.

πŸ’œ GENERIC METHODS πŸ’œ

the unified base class of all MAGE-OM classes, Bio::MAGE::Base, provides a whole set of generic methods that will operate on slots, attributes, and associations. it's giving universal. it's giving works-everywhere. ✨

$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. πŸ‘€ (iykyk)


πŸ› BUGS πŸ›

please send bug reports to the project mailing list: (mged-mage 'at' lists 'dot' sf 'dot' net)

do it. be the change. 🫢


🌟 AUTHOR 🌟

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

the legend themselves. πŸ’–


πŸ‘€ SEE ALSO πŸ‘€


😭 POD ERRORS 😭

hey! the above document had some coding errors, which are explained below:

  • Around line 343:
    • '=item' outside of any '=over'
  • Around line 428:
    • You forgot a '=back' before a '=head2'
  • Around line 600:
    • Expected '=item 2'
  • Around line 605:
    • Expected '=item 3'
  • Around line 610:
    • Expected '=item 4'

and that's a wrap on part 3, bestie!! πŸ’…βœ¨ this whole thing was generated by perl v5.32.0 and dated 2020-11-27, so if you're reading this in the future, hi, you're iconic, go fix those POD errors for us πŸŽ€πŸ¦‹