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)β theset_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)β theget_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)β theset_slot()method sets the slot$nameto the value$val. one slot, one value, very demure β¨- Return value: the new value of the slot, i.e.
$valπ - Side effects: none πΈ
- Return value: the new value of the slot, i.e.
$val = $obj->get_slot($name)β theget_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
undefif the slot has not been initialized. so like, check forundef, fr fr π«Ά - Side effects: none π
- Return value: a single slot value, or
π 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 π
- Input parameters: the value to which the
$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 β¨
- Input parameters: the value to which the
$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 π«Ά
- There must be exactly one item in the association, i.e. this is a mandatory data field.
- 0..1
There may be one item in the association, i.e. this is an optional data field.
- 1..N
There must be one or more items in the association, i.e. this is a mandatory data field, with list cardinality.
- 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 typeBio::MAGE::NameValueType - Return value: the current value of the
"propertySets"association : a reference to an array of objects of typeBio::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_refis not a reference to an array classBio::MAGE::NameValueTypeinstances π
- Input parameters: the value to which the
$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 typeBio::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
@valsto 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@valsis not an instance of classBio::MAGE::NameValueTypeπ
- Input parameters: the list of values
π 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$valis not an instance of classBio::MAGE::DesignElement::Reporterπ
- Input parameters: the value to which the
$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 typeBio::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 typeBio::MAGE::DesignElement::MismatchInformation - Return value: the current value of the
"mismatchInformation"association : a reference to an array of objects of typeBio::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_refis not a reference to an array classBio::MAGE::DesignElement::MismatchInformationinstances π
- Input parameters: the value to which the
$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 typeBio::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
@valsto 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@valsis not an instance of classBio::MAGE::DesignElement::MismatchInformationπ
- Input parameters: the list of values
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_varin 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 theadd*methods instead. like, seriously, useadd*. π
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'
- You forgot a
- Around line 600:
- Expected
'=item 2'
- Expected
- Around line 605:
- Expected
'=item 3'
- Expected
- Around line 610:
- Expected
'=item 4'
- Expected
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 ππ¦
π¦ where this page comes from
- debian bookworm: libbio-mage-perl 20030502.3-6 Β· MIT
- debian trixie: libbio-mage-perl 20030502.3-6 Β· MIT
- ubuntu jammy: libbio-mage-perl 20030502.3-6 Β· MIT
- ubuntu noble: libbio-mage-perl 20030502.3-6 Β· MIT
- ubuntu resolute: libbio-mage-perl 20030502.3-6 Β· MIT
- ubuntu stonking: libbio-mage-perl 20030502.3-6 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms