MAGE::...mation(3pm)
MAGE::...mation(3pm) π
okay bestie, so this is Bio::MAGE::DesignElement::MismatchInformation β a page from the User Contributed Perl Documentation and it lives in section 3pm of your man pages. it's a whole class for the MAGE-OM API. buckle up, we're doing this together π«Ά
β¨ NAME β¨
Bio::MAGE::DesignElement::MismatchInformation β bestie it's a Class for the MAGE-OM API. that's the whole vibe. π
π¦ SYNOPSIS π¦
so this is how you actually talk to it, no cap:
use Bio::MAGE::DesignElement::MismatchInformation
# creating an empty instance
my $mismatchinformation = Bio::MAGE::DesignElement::MismatchInformation->new();
# creating an instance with existing data
my $mismatchinformation = Bio::MAGE::DesignElement::MismatchInformation->new(
startCoord=>$startcoord_val,
newSequence=>$newsequence_val,
replacedLength=>$replacedlength_val,
propertySets=>\@namevaluetype_list,
);
# 'startCoord' attribute
my $startCoord_val = $mismatchinformation->startCoord(); # getter
$mismatchinformation->startCoord($value); # setter
# 'newSequence' attribute
my $newSequence_val = $mismatchinformation->newSequence(); # getter
$mismatchinformation->newSequence($value); # setter
# 'replacedLength' attribute
my $replacedLength_val = $mismatchinformation->replacedLength(); # getter
$mismatchinformation->replacedLength($value); # setter
# 'propertySets' association
my $namevaluetype_array_ref = $mismatchinformation->propertySets(); # getter
$mismatchinformation->propertySets(\@namevaluetype_list); # setter
see how the getter/setter situation is just... the same method name, different args? it's giving duality, it's giving iconic. π
πΈ DESCRIPTION πΈ
straight from the MAGE-OM documentation for the "MismatchInformation" class, and I'm quoting here:
Describes how a reporter varies from its ReporterCharacteristics sequence(s) or how a Feature varies from its Reporter sequence.
so yeah, it's the "hey, this thing is different from that thing" class. fr fr. β¨
π INHERITANCE π
Bio::MAGE::DesignElement::MismatchInformation has the following superclasses, bestie, and you will respect the family tree:
- Bio::MAGE::Extendable
π CLASS METHODS π
okay so the following methods can all be called without first having an instance of the class β you just hit them with the
Bio::MAGE::DesignElement::MismatchInformation->methodname()
syntax. no object required, we're calling it like that. periodt. π«Ά
new()
new(%args)
The object constructor "new()" accepts the following optional named-value style arguments β all optional, so no pressure, queen:
startCoordβ sets the value of the"startCoord"attribute. β¨newSequenceβ sets the value of the"newSequence"attribute. β¨replacedLengthβ sets the value of the"replacedLength"attribute. β¨propertySetsβ sets the value of the"propertySets"association (and psst, this association was inherited from class"Bio::MAGE::Extendable").- The value must be of type: array of
"Bio::MAGE::NameValueType".
- The value must be of type: array of
$obj = class->new(%parameters)
The "new()" method is the class constructor. it makes the thing. that's its job. π§
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.
@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. π don't get it twisted.
Return value: A list of the names of all slots defined for this class.
Side effects: none. blessed, no side quests. π
@name_list = get_attribute_names()
returns the list of attribute data members for this class.
@name_list = get_association_names()
returns the list of association data members for this class.
@class_list = get_superclasses()
returns the list of superclasses for this class.
@class_list = get_subclasses()
returns the list of subclasses for this class.
$name = class_name()
Returns the full class name for this class.
$package_name = package_name()
Returns the base package name (i.e. no 'namespace::') of the package that contains this class.
%assns = associations()
returns the association meta-information in a hash where the keys are the association names and the values are "Association" objects that provide the meta-information for the association.
okay that's the end of part one bestie, keep reading, there's more π
π INSTANCE METHODS π
β¨ $obj_copy = $obj->new() β¨
Okay so plot twist β when you call new() on an existing object reference instead of on a class name, it stops being a constructor and becomes a copy constructor. The new object's initial values get set to be those of the existing object. Copy-paste but make it β¨elegantβ¨.
- 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 is your "set a whole bunch of slots at once" bestie. She's got two whole invocation methods, because she contains multitudes:
- 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. So don't try it. She will find out.
β¨ @obj_list = $obj->get_slots(@name_list) β¨
The get_slots() method grabs the values of a number of slots all at the same time. Batch retrieval, 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, one vibe. π
- 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 bestie, that is literally what the docs say for the single slot getter β we're keeping it exactly as written, no notes π)
- Return value: a single slot value, or
undefif 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. No direct field access, we do it properly here. π«Ά
Bio::MAGE::DesignElement::MismatchInformation has the following attribute accessor methods:
πΈ startCoord
Methods for the startCoord attribute.
From the MAGE-OM documentation:
Offset into the sequence that the mismatch occurs.
$val = $mismatchinformation->setStartCoord($val)
The restricted setter method for the startCoord attribute.
- Input parameters: the value to which the
startCoordattribute will be set - Return value: the current value of the
startCoordattribute - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified
$val = $mismatchinformation->getStartCoord()
The restricted getter method for the startCoord attribute.
- Input parameters: none
- Return value: the current value of the
startCoordattribute - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
πΈ newSequence
Methods for the newSequence attribute.
From the MAGE-OM documentation:
The sequence that replaces the specified sequence starting at start_coord.
$val = $mismatchinformation->setNewSequence($val)
The restricted setter method for the newSequence attribute.
- Input parameters: the value to which the
newSequenceattribute will be set - Return value: the current value of the
newSequenceattribute - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified
$val = $mismatchinformation->getNewSequence()
The restricted getter method for the newSequence attribute.
- Input parameters: none
- Return value: the current value of the
newSequenceattribute - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
πΈ replacedLength
Methods for the replacedLength attribute.
From the MAGE-OM documentation:
Length of the original sequence that is replaced. A deletion is specified when the length of the newSequence is less than the replacedLength.
$val = $mismatchinformation->setReplacedLength($val)
The restricted setter method for the replacedLength attribute.
- Input parameters: the value to which the
replacedLengthattribute will be set - Return value: the current value of the
replacedLengthattribute - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified
$val = $mismatchinformation->getReplacedLength()
The restricted getter method for the replacedLength attribute.
- Input parameters: none
- Return value: the current value of the
replacedLengthattribute - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
π¦ ASSOCIATIONS π¦
Associations are references to other classes. Associations in MAGE-OM have a cardinality that determines the minimum and maximum number of instances of the 'other' class that maybe included in the association. Cardinality check incoming, and it's giving very strict. β
- exactly one β 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::MismatchInformation 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 = $mismatchinformation->setPropertySets($array_ref)
The restricted setter method for the propertySets association.
- Input parameters: the value to which the
propertySetsassociation will be set : a reference to an array of objects of typeBio::MAGE::NameValueType - Return value: the current value of the
propertySetsassociation : 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_ref is not a reference to an array classBio::MAGE::NameValueTypeinstances
$array_ref = $mismatchinformation->getPropertySets()
The restricted getter method for the propertySets association.
- Input parameters: none
- Return value: the current value of the
propertySetsassociation : 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 = $mismatchinformation->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. Stack 'em up bestie, she can hold them all. π
- Input parameters: the list of values @vals to add to the
propertySetsassociation. 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 classBio::MAGE::NameValueType
And then there's this lil guy hanging out at the bottom, doing absolutely nothing but vibing:
sub initialize {
my $self = shift;
return 1;
}
β¨ SLOTS, ATTRIBUTES, AND ASSOCIATIONS β¨
okay bestie, so in the Perl implementation of MAGE-OM classes there are literally three flavors of class data members and you gotta know which is which: "slots", "attributes", and "associations". that's the whole vibe check. let's go π«Ά
π SLOTS π
so this API uses the word "slot" for a data member of the class that was NOT in the UML model β it's mainly for internal purposes. like, only touch these if you genuinely understand the inner workings of the API, fr fr. most of the time slots get used by generic methods, like the ones hanging out in the XML writing and reading classes. iykyk π
slots are implemented with unified getter/setter methods:
$var = $obj->slot_name();β retrieves the current value of the slot. cute, simple, no notes β¨$new_var = $obj->slot_name($new_var);β stores$new_varin the slot. and the return value? also$new_var. it's giving mirror energy πͺ@names = $obj->get_slot_names()β returns the list of all slots in the class. the whole roster, bestie π
DATA CHECKING: no data type checking is made for these methods. none. zero. the vibes are unguarded π
π ATTRIBUTES AND ASSOCIATIONS π
the terms "attribute" and "association" mean data members of the class that were specified directly from the UML model β so these are the real main characters, not the internal side quests. π
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. (yes, a whole ref. not the list itself. pay attention bestie π)
DATA CHECKING: ensure that no argument is provided. like, don't hand it anything, okay? hands off π
set*β sets the current value, replacing any existing value. it's a full takeover, no survivors, periodt. π
NOTE: for associations, if the association has list cardinality, the argument must be an array reference. and because of that little detail, you probably should be using the add* methods instead. trust. π«Ά
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. yes it's specific. yes it matters. no you cannot freestyle this one π€
add*β
NOTE: only present in associations with list cardinality. if it's not there, that's why, don't panic π§
appends a list of objects to any values that may already be stored in the association. it's additive, it's generous, it's stacking the collection πβ¨
DATA CHECKING: ensure that all arguments are of the correct MAGE-OM class. all of them. every single one. no strays π¨
π§ 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. one base class to rule them all, iconic behavior 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. (go read it, bestie, it's right there π)
π BUGS π
please send bug reports to the project mailing list: (mged-mage 'at' lists 'dot' sf 'dot' net)
not me asking you to email a mailing list in 2020s but okay, the classics ate π
π AUTHOR π
Jason E. Stewart (jasons 'at' cpan 'dot' org)
the founder. the originator. the blueprint. we stan π
π SEE ALSO π
that's it. that's the list. sometimes the family tree is just one leaf π
π POD ERRORS π
hey! the above document had some coding errors, which are explained below. the docs are a little messy, it's fine, we love them anyway π
- Around line 283:
'=item' outside of any '=over'
- Around line 368:
You forgot a '=back' before '=head2'
- Around line 612:
Expected '=item 2'
- Around line 617:
Expected '=item 3'
- Around line 622:
Expected '=item 4'
and that's a wrap on this whole page, bestie!! πβ¨ this was perl v5.32.0 doing its thing, dated 2020-11-27, and it's the MAGE::...mation(3pm) page from the user contributed perl documentation. slay, stay safe, and always check your cardinality before you set* anything π
π¦π
π¦ 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