MAGE::...eDefect(3pm)
π MAGE::...eDefect(3pm) π
User Contributed Perl Documentation β¨ MAGE::...eDefect(3pm)
okay bestie, sit down, hydrate, and let me tell you about this lil Perl module π«Ά it's a whole class for the MAGE-OM API and it's lowkey iconic.
β¨ NAME β¨
Bio::MAGE::Array::ZoneDefect β Class for the MAGE-OM API π
πΈ SYNOPSIS πΈ
here's the vibe, fr fr:
use Bio::MAGE::Array::ZoneDefect
# creating an empty instance
my $zonedefect = Bio::MAGE::Array::ZoneDefect->new();
# creating an instance with existing data
my $zonedefect = Bio::MAGE::Array::ZoneDefect->new(
zone=>$zone_ref,
defectType=>$ontologyentry_ref,
propertySets=>\@namevaluetype_list,
positionDelta=>$positiondelta_ref,
);
# 'zone' association
my $zone_ref = $zonedefect->zone(); # getter
$zonedefect->zone($zone_ref); # setter
# 'defectType' association
my $ontologyentry_ref = $zonedefect->defectType(); # getter
$zonedefect->defectType($ontologyentry_ref); # setter
# 'propertySets' association
my $namevaluetype_array_ref = $zonedefect->propertySets(); # getter
$zonedefect->propertySets(\@namevaluetype_list); # setter
# 'positionDelta' association
my $positiondelta_ref = $zonedefect->positionDelta(); # getter
$zonedefect->positionDelta($positiondelta_ref); # setter
getters, setters, new objects β it's giving full package deal, no cap. π¦
π DESCRIPTION π
straight from the MAGE-OM documentation for the "ZoneDefect" class, and I quote:
Stores the defect information for a zone.
that's it. that's the whole lore. it stores defect info for a zone and honestly? it does it beautifully. π
π INHERITANCE π
Bio::MAGE::Array::ZoneDefect has the following superclasses, and yes this is its family tree, respect it:
Bio::MAGE::Extendable
π CLASS METHODS π
The following methods can all be called without first having an instance of the class via the Bio::MAGE::Array::ZoneDefect->methodname() syntax. no object required, she's independent like that. β¨
π new()
π new(%args)
The object constructor new() accepts the following optional named-value style arguments β it's a whole menu, pick your faves:
defectTypeβ Sets the value of the"defectType"association. The value must be of type: instance of"Bio::MAGE::Description::OntologyEntry". πzoneβ Sets the value of the"zone"association. The value must be of type: instance of"Bio::MAGE::ArrayDesign::Zone". πpropertySetsβ Sets the value of the"propertySets"association (heads up bestie, this association was inherited from class"Bio::MAGE::Extendable"). The value must be of type: array of"Bio::MAGE::NameValueType". β¨positionDeltaβ Sets the value of the"positionDelta"association. The value must be of type: instance of"Bio::MAGE::Array::PositionDelta". πΈ
π $obj = class->new(%parameters)
The "new()" method is the class constructor. the moment of creation, the birth of an object, main character energy. π§
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. just slots, okay?? slots only. don't come for her about attributes. π
Return value: A list of the names of all slots defined for this class.
Side effects: none. zero drama, we love to see it. π«Ά
π @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. meta-information about meta-information, we're going deeper bestie. π
β¨ part 1 done, but we're not done done β more parts coming, don't go anywhere π
π INSTANCE METHODS π
$obj_copy = $obj->new()
ok so when you call new() on an existing object reference instead of a class name? bestie it turns into a copy constructor πͺ the fresh object just gets handed all the initial values of the old one. like a twin. a clone. slay.
- 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() is the "let's do a bunch of slots at once" girlie π
she has two whole invocation methods, pick your fighter: the first one takes a named parameter list, the second one 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)
get_slots() is the matching vibe β grab the values of a whole bunch of slots in one go β¨
- Return value: a list of instance objects
- Side effects: none
$val = $obj->set_slot($name,$val)
set_slot() sets the slot $name to the value $val. no thoughts, just setting π
- Return value: the new value of the slot, i.e. $val
- Side effects: none
$val = $obj->get_slot($name)
get_slot() is used to get the values of a number of slots at the same time.
- 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. so like, one method to set it, one to get it, no drama π
Bio::MAGE::Array::ZoneDefect has the following attribute accessor methods:
π¦ 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:
- 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::Array::ZoneDefect has the following association accessor methods:
defectType
Methods for the defectType association.
From the MAGE-OM documentation:
Indicates the type of defect (e.g. a missing zone or a moved zone).
$val = $zonedefect->setDefectType($val)
The restricted setter method for the defectType association.
- Input parameters: the value to which the
defectTypeassociation will be set : one of the accepted enumerated values. - Return value: the current value of the
defectTypeassociation : 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 classBio::MAGE::Description::OntologyEntryπ
$val = $zonedefect->getDefectType()
The restricted getter method for the defectType association.
- Input parameters: none
- Return value: the current value of the
defectTypeassociation : an instance of typeBio::MAGE::Description::OntologyEntry. - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
zone
Methods for the zone association.
From the MAGE-OM documentation:
Reference to the Zone that was misprinted.
$val = $zonedefect->setZone($val)
The restricted setter method for the zone association.
- Input parameters: the value to which the
zoneassociation will be set : one of the accepted enumerated values. - Return value: the current value of the
zoneassociation : 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 classBio::MAGE::ArrayDesign::Zone
$val = $zonedefect->getZone()
The restricted getter method for the zone association.
- Input parameters: none
- Return value: the current value of the
zoneassociation : an instance of typeBio::MAGE::ArrayDesign::Zone. - Side effects: none
- Exceptions: will call
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 = $zonedefect->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 = $zonedefect->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 = $zonedefect->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. like, stacking them up, one after another, iconic behavior β¨
- 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 classBio::MAGE::NameValueType
positionDelta
Methods for the positionDelta association.
From the MAGE-OM documentation:
How the zone deviates in position from the ArrayDesign.
$val = $zonedefect->setPositionDelta($val)
The restricted setter method for the positionDelta association.
- Input parameters: the value to which the
positionDeltaassociation will be set : one of the accepted enumerated values. - Return value: the current value of the
positionDeltaassociation : 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 classBio::MAGE::Array::PositionDelta
$val = $zonedefect->getPositionDelta()
The restricted getter method for the positionDelta association.
- Input parameters: none
- Return value: the current value of the
positionDeltaassociation : an instance of typeBio::MAGE::Array::PositionDelta. - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
sub initialize {
sub initialize {
my $self = shift;
return 1;
}
β¨ SLOTS, ATTRIBUTES, AND ASSOCIATIONS β¨
okay bestie so in the Perl implementation of MAGE-OM classes, your class data members come in three flavors and we're gonna name them all: "slots", "attributes", and "associations". let's go π
π SLOTS
so this API uses the word "slot" for a data member of the class that wasn't in the UML model and exists mainly for internal purposes. translation: 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 chilling in the XML writing and reading classes. π§
slots are implemented with unified getter/setter methods, like this:
$var = $obj->slot_name();β grabs the current value of the slot.$new_var = $obj->slot_name($new_var);β stores$new_varin the slot, and the return value is also$new_var. cute, right?@names = $obj->get_slot_names()β hands you the list of all slots in the class.
DATA CHECKING: nope, zero data type checking for these methods. none. nada. π«Ά
πΈ ATTRIBUTES AND ASSOCIATIONS
the terms "attribute" and "association" are 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.
DATA CHECKING: make sure no argument is provided.
set*
sets the current value, replacing whatever value was already there.
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. just saying. π
DATA CHECKING: for attributes, make sure a single value is provided as the argument. for associations, if the association has list cardinality, make sure the argument is a reference to an array of instances of the correct MAGE-OM class β otherwise make sure there's 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: make sure 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 whole set of generic methods that 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. iykyk π
π BUGS
please send bug reports to the project mailing list: (mged-mage 'at' lists 'dot' sf 'dot' net)
π AUTHOR
Jason E. Stewart (jasons 'at' cpan 'dot' org)
π SEE ALSO
π POD ERRORS
hey! the above document had some coding errors, which are explained below:
- Around line 356:
- '=item' outside of any '=over'
- Around line 441:
- You forgot a '=back' before '=head2'
- Around line 469:
- Expected '=item 2'
- Around line 474:
- Expected '=item 3'
- Around line 479:
- Expected '=item 4'
and that's a wrap, bestie!! this whole thing is perl v5.32.0 from 2020-11-27, and yeah the page is literally titled MAGE::...eDefect(3pm). iconic of it, honestly. slay, go read your other manpages π
β¨π¦
π¦ 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