MAGE::...eLayout(3pm)
MAGE::...eLayout (3pm) π
okay bestie, this is a page from the User Contributed Perl Documentation and it's giving Bio::MAGE::ArrayDesign::ZoneLayout energy. It's long so we're doing it in 3 parts β this is part 1, don't go anywhere π
β¨ NAME β¨
Bio::MAGE::ArrayDesign::ZoneLayout β Class for the MAGE-OM API π§¬
β¨ SYNOPSIS β¨
use Bio::MAGE::ArrayDesign::ZoneLayout
# creating an empty instance
my $zonelayout = Bio::MAGE::ArrayDesign::ZoneLayout->new();
# creating an instance with existing data
my $zonelayout = Bio::MAGE::ArrayDesign::ZoneLayout->new(
numFeaturesPerRow=>$numfeaturesperrow_val,
spacingBetweenRows=>$spacingbetweenrows_val,
numFeaturesPerCol=>$numfeaturespercol_val,
spacingBetweenCols=>$spacingbetweencols_val,
propertySets=>\@namevaluetype_list,
distanceUnit=>$distanceunit_ref,
);
# 'numFeaturesPerRow' attribute
my $numFeaturesPerRow_val = $zonelayout->numFeaturesPerRow(); # getter
$zonelayout->numFeaturesPerRow($value); # setter
# 'spacingBetweenRows' attribute
my $spacingBetweenRows_val = $zonelayout->spacingBetweenRows(); # getter
$zonelayout->spacingBetweenRows($value); # setter
# 'numFeaturesPerCol' attribute
my $numFeaturesPerCol_val = $zonelayout->numFeaturesPerCol(); # getter
$zonelayout->numFeaturesPerCol($value); # setter
# 'spacingBetweenCols' attribute
my $spacingBetweenCols_val = $zonelayout->spacingBetweenCols(); # getter
$zonelayout->spacingBetweenCols($value); # setter
# 'propertySets' association
my $namevaluetype_array_ref = $zonelayout->propertySets(); # getter
$zonelayout->propertySets(\@namevaluetype_list); # setter
# 'distanceUnit' association
my $distanceunit_ref = $zonelayout->distanceUnit(); # getter
$zonelayout->distanceUnit($distanceunit_ref); # setter
β¨ DESCRIPTION β¨
Straight from the MAGE-OM documentation for the ZoneLayout class, no edits, no notes:
Specifies the layout of features in a rectangular grid. π
like. a grid. features. arranged. iconic behaviour honestly π
β¨ INHERITANCE β¨
Bio::MAGE::ArrayDesign::ZoneLayout has the following superclasses:
Bio::MAGE::Extendable
so yeah, it's got that Extendable DNA in it π§¬β¨
β¨ CLASS METHODS β¨
The following methods can all be called without first having an instance of the class via the Bio::MAGE::ArrayDesign::ZoneLayout->methodname() syntax. no object needed, just vibes π«Ά
new()
new(%args)
The object constructor new() accepts the following optional named-value style arguments:
numFeaturesPerRowβ Sets the value of thenumFeaturesPerRowattributespacingBetweenRowsβ Sets the value of thespacingBetweenRowsattributenumFeaturesPerColβ Sets the value of thenumFeaturesPerColattributespacingBetweenColsβ Sets the value of thespacingBetweenColsattributepropertySetsβ Sets the value of thepropertySetsassociation (this association was inherited from classBio::MAGE::Extendable).
The value must be of type: array of Bio::MAGE::NameValueType.
distanceUnitβ Sets the value of thedistanceUnitassociation
The value must be of type: instance of Bio::MAGE::Measurement::DistanceUnit.
$obj = class->new(%parameters)
The new() method is the class constructor. it makes objects. that's the whole 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. bestie don't get caught out by this one π
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.
@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.
ok so that's part 1, and there's more coming π don't close the tab yet π¦
β¨ INSTANCE METHODS β¨
bestie these are the methods you call on an actual object, not the class. we love an instance moment π
πΈ $obj_copy = $obj->new() πΈ
okay so when you call new() on an existing object reference instead of on a class name, it pulls a copy-constructor move β the brand new object starts out with all the same initial values as the old one. twin energy fr fr π«Ά
- Parameters: none, bestie. the copy constructor takes no input parameters, the initial values are just lifted straight off the object you're copying.
- Return value: a reference to an object of the class.
- Side effects: it invokes the
initialize()method if the class defines one. slay.
π $obj->set_slots(%parameters) π
π $obj->set_slots(\@name_list, \@value_list) π
set_slots() is the "set a bunch of slots at once" girlie. she has two different invocation methods: the first one takes a named parameter list, and the second takes two array references. pick your fighter π
- 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 slots, she will notice π
π¦ @obj_list = $obj->get_slots(@name_list) π¦
get_slots() gets you the values of a number of slots at the same time. bulk grab, no cap.
- Return value: a list of instance objects.
- Side effects: none. clean. β¨
π $val = $obj->set_slot($name,$val) π
set_slot() 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) π
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. (theundefis giving "she's not ready yet" π) - 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 each, iconic behaviour tbh.
Bio::MAGE::ArrayDesign::ZoneLayout has the following attribute accessor methods:
π numFeaturesPerRow π
Methods for the numFeaturesPerRow attribute.
From the MAGE-OM documentation:
The number of features from left to right.
$val = $zonelayout->setNumFeaturesPerRow($val)
The restricted setter method for the numFeaturesPerRow attribute.
- Input parameters: the value to which the
numFeaturesPerRowattribute will be set - Return value: the current value of the
numFeaturesPerRowattribute - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified
$val = $zonelayout->getNumFeaturesPerRow()
The restricted getter method for the numFeaturesPerRow attribute.
- Input parameters: none
- Return value: the current value of the
numFeaturesPerRowattribute - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
π§ spacingBetweenRows π§
Methods for the spacingBetweenRows attribute.
From the MAGE-OM documentation:
Spacing between the rows.
$val = $zonelayout->setSpacingBetweenRows($val)
The restricted setter method for the spacingBetweenRows attribute.
- Input parameters: the value to which the
spacingBetweenRowsattribute will be set - Return value: the current value of the
spacingBetweenRowsattribute - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified
$val = $zonelayout->getSpacingBetweenRows()
The restricted getter method for the spacingBetweenRows attribute.
- Input parameters: none
- Return value: the current value of the
spacingBetweenRowsattribute - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
πΈ numFeaturesPerCol πΈ
Methods for the numFeaturesPerCol attribute.
From the MAGE-OM documentation:
The number of features from top to bottom of the grid.
$val = $zonelayout->setNumFeaturesPerCol($val)
The restricted setter method for the numFeaturesPerCol attribute.
- Input parameters: the value to which the
numFeaturesPerColattribute will be set - Return value: the current value of the
numFeaturesPerColattribute - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified
$val = $zonelayout->getNumFeaturesPerCol()
The restricted getter method for the numFeaturesPerCol attribute.
- Input parameters: none
- Return value: the current value of the
numFeaturesPerColattribute - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
π spacingBetweenCols π
Methods for the spacingBetweenCols attribute.
From the MAGE-OM documentation:
Spacing between the columns.
$val = $zonelayout->setSpacingBetweenCols($val)
The restricted setter method for the spacingBetweenCols attribute.
- Input parameters: the value to which the
spacingBetweenColsattribute will be set - Return value: the current value of the
spacingBetweenColsattribute - Side effects: none
- Exceptions: will call
croak()if no input parameters are specified, or if too many input parameters are specified
$val = $zonelayout->getSpacingBetweenCols()
The restricted getter method for the spacingBetweenCols attribute.
- Input parameters: none
- Return value: the current value of the
spacingBetweenColsattribute - 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. let's break it down:
- 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::ArrayDesign::ZoneLayout 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 = $zonelayout->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_refis not a reference to an array classBio::MAGE::NameValueTypeinstances
$array_ref = $zonelayout->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 = $zonelayout->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 thepropertySetsassociation. 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
π« distanceUnit π«
Methods for the distanceUnit association.
From the MAGE-OM documentation:
Unit of the ZoneLayout attributes.
$val = $zonelayout->setDistanceUnit($val)
The restricted setter method for the distanceUnit association.
- Input parameters: the value to which the
distanceUnitassociation will be set : one of the accepted enumerated values. - Return value: the current value of the
distanceUnitassociation : 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::Measurement::DistanceUnit
$val = $zonelayout->getDistanceUnit()
The restricted getter method for the distanceUnit association.
- Input parameters: none
- Return value: the current value of the
distanceUnitassociation : an instance of typeBio::MAGE::Measurement::DistanceUnit. - Side effects: none
- Exceptions: will call
croak()if any input parameters are specified
and then, plot twist, there's literally this just chillin' at the end of the association section, no cap:
sub initialize {
my $self = shift;
return 1;
}
she's short, she's simple, she returns 1. main character energy π
π SLOTS, ATTRIBUTES, AND ASSOCIATIONS π
okay bestie, so in the Perl implementation of MAGE-OM classes there are literally three flavours of class data members, and you gotta know which is which: "slots", "attributes", and "associations". π
β¨ SLOTS β¨
so this API uses the word "slot" for a data member of the class that wasn't in the UML model and exists mostly for internal reasons. ngl: use only if you understand the inner workings of the API. π Most of the time slots are the ones the generic methods reach for, like the stuff in the XML writing and reading classes.
slots are implemented with unified getter/setter methods, like:
$var = $obj->slot_name();
retrieves 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 the slots in the class. π
DATA CHECKING: fr fr, no data type checking is made for these methods. π
πΈ ATTRIBUTES AND ASSOCIATIONS πΈ
the terms "attribute" and "association" mean data members of the class that came directly from the UML model. the real ones. π
in the Perl implementation of MAGE-OM classes, association and attribute accessors are built from 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. periodt.
set*β sets the current value, replacing any existing value.
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. iykyk π
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.
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, hands you a whole set of generic methods that will operate on slots, attributes, and associations. it's giving 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 π
please send bug reports to the project mailing list: (mged-mage 'at' lists 'dot' sf 'dot' net) β we're nice, we promise π«Ά
π AUTHOR π
Jason E. Stewart (jasons 'at' cpan 'dot' org) β iconic behaviour, no cap β
π SEE ALSO π
π POD ERRORS π
hey! π the above document had some coding errors, which are explained below:
- Around line 326:
'=item' outside of any '=over'
- Around line 411:
- You forgot a
'=back'before a'=head2'
- You forgot a
- Around line 727:
- Expected
'=item 2'
- Expected
- Around line 732:
- Expected
'=item 3'
- Expected
- Around line 737:
- Expected
'=item 4'
- Expected
okay that's the whole page bestie, we ate and left no crumbs π this one's perl v5.32.0, dated 2020-11-27, and it's MAGE::...eLayout(3pm) β go forth and slay your MAGE-OM objects πβ¨π§
π¦ 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