MAGE::...rmation(3pm)
β¨ NAME β¨
Bio::MAGE::DesignElement::FeatureInformation β bestie, this is the class for the MAGE-OM API π
(and yeah, it's living in the MAGE::...rmation(3pm) page from the User Contributed Perl Documentation, iykyk)
πΈ SYNOPSIS πΈ
okay so here's the whole vibe, copy-paste ready:
use Bio::MAGE::DesignElement::FeatureInformation
# creating an empty instance
my $featureinformation = Bio::MAGE::DesignElement::FeatureInformation->new();
# creating an instance with existing data
my $featureinformation = Bio::MAGE::DesignElement::FeatureInformation->new(
propertySets=>\@namevaluetype_list,
mismatchInformation=>\@mismatchinformation_list,
feature=>$feature_ref,
);
# 'propertySets' association
my $namevaluetype_array_ref = $featureinformation->propertySets(); # getter
$featureinformation->propertySets(\@namevaluetype_list); # setter
# 'mismatchInformation' association
my $mismatchinformation_array_ref = $featureinformation->mismatchInformation(); # getter
$featureinformation->mismatchInformation(\@mismatchinformation_list); # setter
# 'feature' association
my $feature_ref = $featureinformation->feature(); # getter
$featureinformation->feature($feature_ref); # setter
look at those getters and setters, they're literally serving π
π DESCRIPTION π
straight from the MAGE-OM documentation for the "FeatureInformation" class, no notes:
As part of the map information, allows the association of one or more differences in the BioMaterial on a feature from the BioMaterial of the Reporter. Useful for control purposes such as in Affymetrix probe pairs.
fr fr, it's the little guy that holds onto mismatch deets so your Affymetrix probe pairs behave π§β¨
π¦ INHERITANCE π¦
Bio::MAGE::DesignElement::FeatureInformation has the following superclasses (its ancestry, its bloodline, its main character lineage π):
Bio::MAGE::Extendable
π CLASS METHODS π
okay so the way that these all work? you can call every single one of them without ever having an instance first, using the Bio::MAGE::DesignElement::FeatureInformation->methodname() syntax. no object needed, we're going straight to class, periodt π
new()
new(%args)
The object constructor "new()" accepts the following optional named-value style arguments β and yes bestie, they're all optional:
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".
mismatchInformationβ sets the value of the"mismatchInformation"association.
The value must be of type: array of "Bio::MAGE::DesignElement::MismatchInformation".
featureβ sets the value of the"feature"association.
The value must be of type: instance of "Bio::MAGE::DesignElement::Feature".
$obj = class->new(%parameters)
The "new()" method is the class constructor. it makes objects. that's its whole thing π
- 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. iconic behavior honestly.
- 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 @ me, that's just how it is π
- Return value: a list of the names of all slots defined for this class.
- Side effects: none. clean. immaculate. no cap.
@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 so that's part 1, and we are so not done yet β more parts are coming, don't go anywhere bestie π«Ά
π INSTANCE METHODS π
Okay bestie, this is where it gets hands-on β these are the methods you call on an actual object, not on the class. Periodt.
πΈ $obj_copy = $obj->new()
So when you call new() on an existing object reference instead of a class name, it pulls double duty as a copy constructor β the new object's initial values get set to be exactly those of the existing object. It's giving "twin but make it data" π
Parameters: nope, no input parameters are used in the copy constructor β the initial values are taken directly from the object to be copied. Zero arguments, zero drama.
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 girl for setting a bunch of slots at the same time. It has two different invocation methods, which, iconic:
- the first takes a named parameter list, and
- the second takes two array references.
Return value: none π
Side effects: it will call croak() if a slot_name is used that the class does not define. So like, don't make up slots, bestie.
π¦ @obj_list = $obj->get_slots(@name_list)
The get_slots() method is used to get 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.
β $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.
Return value: a single slot value, or undef if 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.
Bio::MAGE::DesignElement::FeatureInformation 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. So here's the vibe check on cardinality, bestie:
- 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::FeatureInformation 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 = $featureinformation->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 = $featureinformation->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 = $featureinformation->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
π§ mismatchInformation
Methods for the mismatchInformation association.
From the MAGE-OM documentation:
Differences in how the feature matches the reporter's sequence, typical examples is the Affymetrix probe pair where one of the features is printed with a mismatch to the other feature's perfect match.
π $array_ref = $featureinformation->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 = $featureinformation->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 = $featureinformation->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
π feature
Methods for the feature association.
From the MAGE-OM documentation:
The feature the FeatureInformation is supplying information for.
π¦ $val = $featureinformation->setFeature($val)
The restricted setter method for the feature association.
Input parameters: the value to which the feature association will be set : one of the accepted enumerated values.
Return value: the current value of the feature 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::Feature
πΈ $val = $featureinformation->getFeature()
The restricted getter method for the feature association.
Input parameters: none
Return value: the current value of the feature association : an instance of type Bio::MAGE::DesignElement::Feature.
Side effects: none
Exceptions: will call croak() if any input parameters are specified
sub initialize {
my $self = shift;
return 1;
}
β¨ SLOTS, ATTRIBUTES, AND ASSOCIATIONS β¨
okay bestie, listen up, because in the Perl implementation of MAGE-OM classes there are literally three kinds of class data members and you need to know which is which: slots, attributes, and associations. that's the whole trio. π«Ά
π SLOTS
so this API uses the word slot to mean a data member of the class that was not in the UML model, and it's there mostly for internal purposes β so like, only touch these if you genuinely understand the inner workings of the API, no cap. most of the time slots are 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 "one method, two jobs" energy:
$var = $obj->slot_name();
Retrieves the current value of the slot.
$new_var = $obj->slot_name($new_var);
Store $new_var in the slot β and the return value is also $new_var. yes, it hands it right back to you. iconic behavior.
@names = $obj->get_slot_names()
Returns the list of all slots in the class.
DATA CHECKING: No data type checking is made for these methods. π literally zero vibe check, it just trusts you completely, so be normal about it.
πΈ 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 official ones, the main characters, not the internal side-quest slots.
in the Perl implementation of MAGE-OM classes, association and attribute accessors are implemented using three separate methods. three! because one method could never:
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. like, don't pass it anything, bestie. hands off.
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. Because of this, you probably should be using the add* methods.
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, provides a set of generic methods that will operate on slots, attributes, and associations. one base class, three data member types, zero stress:
$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)
like, actually send them, don't just complain in the group chat. π
π 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. not me exposing the doc's messy era but okay, transparency queen:
- Around line 323:
'=item' outside of any '=over'
- Around line 408:
You forgot a '=back' before '=head2'
- Around line 436:
Expected '=item 2'
- Around line 441:
Expected '=item 3'
- Around line 446:
Expected '=item 4'
and that's the whole page, bestie π this gem is perl v5.32.0, dated 2020-11-27, and it lives under the name MAGE::...rmation(3pm) β go forth and manipulate your MAGE-OM objects with main character energy, slay, periodt π
β¨
π¦ 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