MAGE::...equence(3pm)
π NAME π
okay bestie, listen β Bio::MAGE::BioSequence is the container module for all the classes in the MAGE package that live under BioSequence. it's the group chat, and these are its members π«Ά
β¨ SYNOPSIS β¨
use Bio::MAGE::BioSequence;
that's it. that's the whole vibe. π
π¦ DESCRIPTION π¦
so this is a package module, which is a fancy way of saying it's the mom friend that holds a whole bunch of classes together in the Bio::MAGE hierarchy. all these classes are part of the BioSequence package of the MAGE-OM object model. iconic behavior, honestly.
πΈ CLASSES πΈ
the Bio::MAGE::BioSequence module contains these Bio::MAGE classes, no cap:
SeqFeatureSeqFeatureLocationBioSequenceSequencePosition
π CLASS METHODS π
@class_list = Bio::MAGE::BioSequence::classes();β hands you back a list of class names from this package, and bestie they are not fully qualified (meaning: noBio::MAGE::prefix up front, they're just the short names, iykyk).$obj = class->new(%parameters)β the class constructor, the birth of a whole new object π«- Parameters: if you pass it a list of name/value pairs, the matching slots, attributes, or associations get their initial values set right there by the constructor.
- Return value: a reference to an object of the class.
- Side effects: it invokes the
initialize()method if the class defines one.
@names = class->get_slot_names()β used to grab the names of every slot defined in a given class.
NOTE: this list of names does not include attribute names or association names. those are separate things, don't @ me.
- 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 of the package that contains this class, meaning it has nonamespace::on it. just the clean base name.%assns = associations()β returns the association meta-information as a hash. the keys are the association names, and the values areAssociationobjects that carry the meta-information for that association. very demure, very mindful. π
π INSTANCE METHODS π
$obj_copy = $obj->new()β when you callnew()on an existing object reference instead of a class name, it acts as a copy constructor β the new object's initial values get set to whatever the existing object had. cloning, but make it Perl π§- Parameters: no input parameters are used in the copy constructor, the initial values are taken directly from the object being copied.
- 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)β sets a whole bunch of slots at the same time. it's got two different invocation methods: the first one takes a named parameter list, the second takes two array references. pick your fighter π- Return value: none.
- Side effects: will call
croak()if you use a slot_name that the class doesn't define. so like, know your slots.
@obj_list = $obj->get_slots(@name_list)β gets the values of a bunch of slots all at once.- Return value: a list of instance objects.
- Side effects: none.
$val = $obj->set_slot($name,$val)β sets the slot$nameto the value$val.- Return value: the new value of the slot, i.e.
$val. - Side effects: none.
- Return value: the new value of the slot, i.e.
$val = $obj->get_slot($name)β 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.
- Return value: a single slot value, or
$val = $biosequence->xml_lists()$inval = $biosequence->xml_lists($inval)β the unified setter/getter method for the xml_lists slot.- If
$invalis specified, the setter method is invoked; with no parameters, the getter method is invoked. - Input parameters: the optional
$invalwill invoke the setter method. - Return value: for both setter and getter, the current value of the xml_lists slot.
- Side effects: none.
- Exceptions: none.
- If
$val = $biosequence->tagname()$inval = $biosequence->tagname($inval)β the unified setter/getter method for the tagname slot.- If
$invalis specified, the setter method is invoked; with no parameters, the getter method is invoked. - Input parameters: the optional
$invalwill invoke the setter method. - Return value: for both setter and getter, the current value of the tagname slot.
- Side effects: none.
- Exceptions: none.
- If
$val = $biosequence->biosequence_list()$inval = $biosequence->biosequence_list($inval)β the unified setter/getter method for the biosequence_list slot.- If
$invalis specified, the setter method is invoked; with no parameters, the getter method is invoked. - Input parameters: the optional
$invalwill invoke the setter method. - Return value: for both setter and getter, the current value of the biosequence_list slot.
- Side effects: none.
- Exceptions: none.
- If
$array_ref = $biosequence->getBioSequence_list()β handles the list for theBio::MAGE::BioSequence::BioSequenceclass. it returns a reference to an array of the class objects that have been associated with the package instance. super handy when you're pulling data out of a parsed MAGE-ML file π₯$biosequence->addBioSequence(@vals)β the interface for addingBio::MAGE::BioSequence::BioSequenceobjects to thebiosequence_listlist. it's generally used by generic methods like the ones in the XMLWriter.- Input parameters: the list of values
@valsto add to the owner association. NOTE: submitting a single value is permitted, bestie, you don't have to give it a whole list. - Return value: none.
- Side effects: none.
- Exceptions: will call
croak()if no input parameters are specified, or if any of the objects in@valsis not a subclass of classBio::MAGE::BioSequence::BioSequence. β οΈ
- Input parameters: the list of values
$biosequence->obj2xml($writer)β writes out this object, and all its sub-objects, as XML, using the supplied$writerto actually do the XML formatting. delegating, as one does π- Input parameters:
$writermust be an XML writer, e.g. an instance ofBio::MAGE::XML::Writer. It must have the methods:write_start_tag(),write_end_tag(), andobj2xml(). - Return value: none.
- Side effects: all writing is delegated to the
$writerβ itswrite_start_tag()andwrite_end_tag()methods are invoked with the appropriate data, and all class sub-objects of theBio::MAGE::BioSequenceinstance will have theirobj2xml()methods invoked in turn. by letting the$writerdo the actual formatting of the output XML, it lets you precisely control the format. you're the main character of your own output β¨ - Exceptions: will call
croak()if no identifier has been set for theBio::MAGE::BioSequenceinstance. π¬
- Input parameters:
$biosequence->register($obj)β stores an object for later writing as XML.- Input parameters: the object to be added to the list of registered objects.
- Return value: none.
- Side effects: if
$objneeds to be stored by this class, a reference will be stored in the correct XML list for this class. - Exceptions: none.
π SLOTS, ATTRIBUTES, AND ASSOCIATIONS π
in the Perl implementation of MAGE-OM classes, there are three types of class data members: slots, attributes, and associations. three flavors, all valid.
π SLOTS
this API uses the term slot for a data member of the class that was not present in the UML model, and it's used mainly for internal purposes β so like, only touch it if you understand the inner workings of the API, fr fr. most of the time, slots are used by generic methods such as those 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);β stores$new_varin the slot, and 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. none. zero. it simply does not care. π
π¦ ATTRIBUTES AND ASSOCIATIONS
the terms attribute and association indicate 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 instead. 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*β appends a list of objects to any values that may already be stored in the association.
NOTE: only present in associations with list cardinality. 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 on this page for a detailed description of these methods. they're all up there, bestie, scroll up π«Ά
π BUGS π
please send bug reports to the project mailing list: (mged-mage 'at' lists 'dot' sf 'dot' net). they want to hear from you, genuinely.
π AUTHOR π
Jason E. Stewart (jasons 'at' cpan 'dot' org)
π SEE ALSO π
and that's the whole page, bestie β written for perl v5.32.0, dated 2020-11-27. go forth and sequence responsibly, you absolute icon πβ¨π
π¦ 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