MAGE::...ocation(3pm)
π NAME π
okay bestie, welcome to the MAGE::...ocation(3pm) page from the User Contributed Perl Documentation. This one is all about Bio::MAGE::BioSequence::SeqFeatureLocation β Class for the MAGE-OM API. no cap, it's giving very Perl, very bio-sequence, very slay. π§¬β¨
β¨ SYNOPSIS β¨
Here's the tea, bestie β this is how you use it:
use Bio::MAGE::BioSequence::SeqFeatureLocation
# creating an empty instance
my $seqfeaturelocation = Bio::MAGE::BioSequence::SeqFeatureLocation->new();
# creating an instance with existing data
my $seqfeaturelocation = Bio::MAGE::BioSequence::SeqFeatureLocation->new(
strandType=>$strandtype_val,
subregions=>\@seqfeaturelocation_list,
propertySets=>\@namevaluetype_list,
coordinate=>$sequenceposition_ref,
);
# 'strandType' attribute
my $strandType_val = $seqfeaturelocation->strandType(); # getter
$seqfeaturelocation->strandType($value); # setter
# 'subregions' association
my $seqfeaturelocation_array_ref = $seqfeaturelocation->subregions(); # getter
$seqfeaturelocation->subregions(\@seqfeaturelocation_list); # setter
# 'propertySets' association
my $namevaluetype_array_ref = $seqfeaturelocation->propertySets(); # getter
$seqfeaturelocation->propertySets(\@namevaluetype_list); # setter
# 'coordinate' association
my $sequenceposition_ref = $seqfeaturelocation->coordinate(); # getter
$seqfeaturelocation->coordinate($sequenceposition_ref); # setter
πΈ DESCRIPTION πΈ
From the MAGE-OM documentation for the SeqFeatureLocation class, and I quote:
The location of the SeqFeature annotation.
That's literally it. Short, sweet, iconic. π
π¦ INHERITANCE π¦
Bio::MAGE::BioSequence::SeqFeatureLocation has the following superclasses:
Bio::MAGE::Extendable
So it's getting that inherited energy from Bio::MAGE::Extendable. π
π CLASS METHODS π
The following methods can all be called without first having an instance of the class via the Bio::MAGE::BioSequence::SeqFeatureLocation->methodname() syntax. So yes, class methods, no object required. slay.
π
new() π
π
new(%args) π
The object constructor new() accepts the following optional named-value style arguments:
strandTypeβ Sets the value of thestrandTypeattributepropertySetsβ Sets the value of thepropertySetsassociation (this association was inherited from classBio::MAGE::Extendable).
The value must be of type: array of Bio::MAGE::NameValueType.
subregionsβ Sets the value of thesubregionsassociation
The value must be of type: array of Bio::MAGE::BioSequence::SeqFeatureLocation.
coordinateβ Sets the value of thecoordinateassociation
The value must be of type: instance of Bio::MAGE::BioSequence::SequencePosition.
π $obj = class->new(%parameters) π
The new() method is the class constructor. It's the main character of constructors, honestly.
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.
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.
π« INSTANCE METHODS π«
$obj_copy = $obj->new()β okay so listen, when you callnew()on an actual object reference (not on a class name), it stops being a constructor and becomes a copy constructor β¨. The new object's initial values are justβ¦ the old object's values. Instant clone, no cap.
Parameters: nope, none. The copy constructor doesn't take any input parameters β the initial values come 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. π
$obj->set_slots(%parameters)$obj->set_slots(\@name_list, \@value_list)β theset_slots()method sets a whole bunch of slots at once, because doing them one by one is giving slow. It's got two whole invocation styles: the first one takes a named parameter list, and the second takes two array references. Pick your fighter π
Return value: none. πΆ
Side effects: it will call croak() if you use a slot_name that the class doesn't define. So don't be out here inventing slots, bestie, it will yell at you. π
@obj_list = $obj->get_slots(@name_list)β theget_slots()method grabs the values of a bunch of slots all at the same time. Bulk mode activated. π¦
Return value: a list of instance objects.
Side effects: none, it's a good girl. β¨
$val = $obj->set_slot($name,$val)β theset_slot()method sets the slot$nameto the value$val. One slot, one value, so simple, so iconic.
Return value: the new value of the slot, i.e. $val. So it hands you back what you just gave it. π
Side effects: none.
$val = $obj->get_slot($name)β theget_slot()method is used to get the values of a number of slots at the same time. (Yes, that's literally what it says. We're just reporting the lore here, bestie. π)
Return value: a single slot value, or undef if the slot has not been initialized. undef is giving "no thoughts, head empty" energy. π«
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 setting, one for getting, no crossover, we stay disciplined in this house. π
Bio::MAGE::BioSequence::SeqFeatureLocation has the following attribute accessor methods:
strandType
Methods for the strandType attribute. πΈ
From the MAGE-OM documentation:
Indicates the direction and/or type of the SeqFeature, i.e. whether it is in the 5' or 3' direction, is double stranded, etc.
$val = $seqfeaturelocation->setStrandType($val)β the restricted setter method for thestrandTypeattribute. π₯
Input parameters: the value to which the strandType attribute will be set.
Return value: the current value of the strandType attribute.
Side effects: none.
Exceptions: will call croak() if no input parameters are specified, or if too many input parameters are specified. Zero or too many and it's over for you. π
$val = $seqfeaturelocation->getStrandType()β the restricted getter method for thestrandTypeattribute. π
Input parameters: none.
Return value: the current value of the strandType attribute.
Side effects: none.
Exceptions: will call croak() if any input parameters are specified. Hands off the getter, it takes no arguments. π
π 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::BioSequence::SeqFeatureLocation 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 = $seqfeaturelocation->setPropertySets($array_ref)β the restricted setter method for thepropertySetsassociation. π
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. Wrong type? Croak. No input? Croak. Too much input? Croak. It is not flexible about this. π
$array_ref = $seqfeaturelocation->getPropertySets()β the restricted getter method for thepropertySetsassociation. π¦
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 = $seqfeaturelocation->addPropertySets(@vals)β because thepropertySetsassociation has list cardinality, it may store more than one value. This method adds the current list of objects in thepropertySetsassociation. The more the merrier, bestie. π
Input parameters: the list of values @vals to add to the propertySets association. NOTE: submitting a single value is permitted. Yes, just one is fine too, no judgement. π«Ά
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. Vibe check on every single item, fr fr.
subregions
Methods for the subregions association. πΈ
From the MAGE-OM documentation:
Regions within the SeqFeature.
$array_ref = $seqfeaturelocation->setSubregions($array_ref)β the restricted setter method for thesubregionsassociation. π
Input parameters: the value to which the subregions association will be set : a reference to an array of objects of type Bio::MAGE::BioSequence::SeqFeatureLocation.
Return value: the current value of the subregions association : a reference to an array of objects of type Bio::MAGE::BioSequence::SeqFeatureLocation.
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::BioSequence::SeqFeatureLocation instances. So specific about types and honestly? Respect. π
$array_ref = $seqfeaturelocation->getSubregions()β the restricted getter method for thesubregionsassociation. π¦
Input parameters: none.
Return value: the current value of the subregions association : a reference to an array of objects of type Bio::MAGE::BioSequence::SeqFeatureLocation.
Side effects: none.
Exceptions: will call croak() if any input parameters are specified. π
$val = $seqfeaturelocation->addSubregions(@vals)β because thesubregionsassociation has list cardinality, it may store more than one value. This method adds the current list of objects in thesubregionsassociation. β¨
Input parameters: the list of values @vals to add to the subregions 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::BioSequence::SeqFeatureLocation. π
coordinate
Methods for the coordinate association. π₯
From the MAGE-OM documentation:
At which base pairs or amino acid this SeqFeature begins and ends.
$val = $seqfeaturelocation->setCoordinate($val)β the restricted setter method for thecoordinateassociation. π
Input parameters: the value to which the coordinate association will be set : one of the accepted enumerated values.
Return value: the current value of the coordinate 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::BioSequence::SequencePosition. Croak, croak, and also croak. π
$val = $seqfeaturelocation->getCoordinate()β the restricted getter method for thecoordinateassociation. π
Input parameters: none.
Return value: the current value of the coordinate association : an instance of type Bio::MAGE::BioSequence::SequencePosition.
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 so in the Perl implementation of MAGE-OM classes, there are three types of class data members, and you need to know all three:
slotsattributesassociations
let's get into it π
π SLOTS
so this API uses the term "slot" to mean a data member of the class that was not present in the UML model and is used for mainly internal purposes. like, only touch these if you genuinely understand the inner workings of the API, bestie. no cap. most of the time slots get used by generic methods, like the ones in the XML writing and reading classes.
slots are implemented using unified getter/setter methods:
$var = $obj->slot_name();
Retrieves the current value of the slot.
$new_var = $obj->slot_name($new_var);
Store $new_var in the slot β the return value is also $new_var.
@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. π
π¦ ATTRIBUTES AND ASSOCIATIONS
the terms "attribute" and "association" mean data members of the class that were specified directly from the UML model.
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: Ensure that no argument is provided.
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.
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:
$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)
π 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 332:
'=item' outside of any '=over'
- Around line 417:
- You forgot a
'=back'before'=head2'
- You forgot a
- Around line 517:
- Expected
'=item 2'
- Expected
- Around line 522:
- Expected
'=item 3'
- Expected
- Around line 527:
- Expected
'=item 4'
- Expected
and that's a wrap, bestie!! π«Ά this iconic little page came to you from perl v5.32.0, dated 2020-11-27, and it's filed under MAGE::...ocation(3pm). slay π
β¨
π¦ 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