Bio::D...eTypeI(3pm)

πŸ“¦
version 1.7.8 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– NAME πŸ’–

Bio::Das::FeatureTypeI β€” it's a simple interface to Sequence Ontology feature types, bestie. That's the whole vibe. 🧬✨


🌸 SYNOPSIS 🌸

Okay so here's how you actually use this thing, no cap:

# Get a Bio::Das::FeatureTypeI object from somewhere
$term = $db->fetch....

# Get the name of the term
$definition = $term->name;

# Get the accession of the term
$accession = $term->accession;

# Get the definition of the term
$definition = $term->definition;

# Get the parents of the term, optionally filtered by relationship
@parents = $term->parents($relationship);

# Get the children of the term, optionally filtered by relationship
@children = $term->children($relationship);

# Given a parent and child, returns their relationship, or undef if
# not directly related
$relationship = $parent->relationship($child);

# Return true if two terms are identical
$match = $term1->equals($term2);

# Return true if $term2 is a descendent of $term1, optionally
# filtering by relationship ("isa" assumed)
$match = $term1->is_descendent($term2,$relationship);

# Return true if $term2 is a parent of $term1, optionally
# filtering by relationship ("isa" assumed)
$match = $term1->is_parent($term2,$relationship);

# Return true if $term2 is equal to $term1 or if $term2 descends
# from term 1 via the "isa" relationship
$match = $term1->match($term2);

# Create a new term de novo
$term = Bio::Das::FeatureTypeI->new(-name       => $name,
                                    -accession  => $accession,
                                    -definition => $definition);

# Add a child to a term
$term1->add_child($term2,$relationship);

# Delete a child from a term
$term1->delete_child($term2);

(Yes the first snippet has a literal .... in it. We don't question it, we just respect it. 🫢)


πŸ¦‹ DESCRIPTION πŸ¦‹

So Bio::Das::FeatureTypeI is your little interface plug into the Gene Ontology Consortium's Sequence Ontology (SO). The SO, like all the other ontologies out there, is a directed acyclic graph β€” meaning a child node can have multiple parents, which honestly? Relatable. Main character energy with a whole support system. πŸ‘‘

The relationship between a parent and a child is one of a list of relationships. The SO currently recognizes exactly two: "isa" and "partof".

The whole intent of this interface is to play nice with older software that just uses bare strings to represent feature types. So for that reason, the interface overloads the stringify ("") and string equals (eq) operations. Slay. πŸ’…


πŸ’Œ FEEDBACK πŸ’Œ

🌈 Mailing Lists

User feedback is literally an integral part of the evolution of this and other Bioperl modules β€” so yes, your thoughts matter, bestie. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated. πŸ’–

bioperl-l@bio.perl.org

πŸŽ€ Support

Please direct usage questions or support issues to the mailing list:

bioperl-l@bioperl.org

...rather than to the module maintainer directly. There are so many experienced and reponsive experts who will be able to look at the problem and quickly address it. If at all possible, please include a thorough description of the problem with code and data examples. Give them the whole lore, not just the cliffnotes. πŸ“

πŸ› Reporting Bugs

Report bugs to the Bioperl bug tracking system so we can keep track of the bugs and their resolution. Bug reports can be submitted via the web:

https://github.com/bioperl/bioperl-live/issues

✨ AUTHOR - Lincoln Stein ✨

Email: lstein@cshl.org


πŸ‘‘ APPENDIX πŸ‘‘

The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _.

this is somehow FUBAR, implementation classes cannot successfully inherit from Bio::Das::FeatureTypeI

Yeah. We're just sitting with that information. πŸ’€


πŸ“ name

Title   : name
Usage   : $string = $term->name
Function: return the term for the type
Returns : a string
Args    : none
Status  : Public

πŸ“ accession

Title   : accession
Usage   : $string = $term->accession
Function: return the accession number for the term
Returns : a string
Args    : none
Status  : Public

πŸ“ definition

Title   : definition
Usage   : $string = $term->definition
Function: return the human-readable definition for the term
Returns : a string
Args    : none
Status  : Public

πŸ“ parents

Title   : parents
Usage   : @terms = $term->parents($relationship)
Function: return parent terms
Returns : list of Bio::Das::FeatureTypeI
Args    : none
Status  : Public

Returns the parents for the current term, empty if there are none. An optional relationship argument will return those parents that are related via the specified relationship type.

The relationship is one of "isa" or "partof".


πŸ“ children

Title   : children
Usage   : @terms = $term->children($relationship)
Function: return children terms
Returns : list of Bio::Das::FeatureTypeI
Args    : none
Status  : Public

Returns the children for the current term, empty if there are none. An optional relationship argument will return those children that are related via the specified relationship type.

The relationship is one of "isa" or "partof".


πŸ“ relationship

Title   : relationship
Usage   : $relationship = $parent->relationship($child)
Function: return the relationship between a parent and a child
Returns : one of "isa" or "partof"
Args    : none
Status  : Public

This method returns the relationship between a parent and one of its immediate descendents. It can return "isa", "partof", or undef if there is not a direct parent/child relationship.

kissing cousins are not recognized. 🫒

πŸ“ equals

Title   : equals
Usage   : $boolean = $term1->equals($term2)
Function: return true if $term1 and $term2 are the same
Returns : boolean
Args    : second term
Status  : Public

The two terms must be identical. In practice, this means that if term2 is a Bio::Das::FeatureI object, then its accession number must match the first term's accession number. Otherwise, if term2 is a bare string, then it must equal (in a case insensitive manner) the name of term1.

NOTE TO IMPLEMENTORS: This method is defined in terms of other methods, so does not need to be implemented. πŸ’…

πŸ“ is_descendent

Title   : is_descendent
Usage   : $boolean = $term1->is_descendent($term2 [,$relationship])
Function: return true of $term2 is a descendent of $term1
Returns : boolean
Args    : second term
Status  : Public

This method returns true if $term2 descends from $term1. The operation traverses the tree. The traversal can be limited to the relationship type ("isa" or "partof") if desired. $term2 can be a bare string, in which case the term names will be used as the basis for term matching (see equals()).

NOTE TO IMPLEMENTORS: this method is defined as the inverse of is_parent(). Do not implement it directly, but do implement is_parent().

πŸ“ is_parent

Title   : is_parent
Usage   : $boolean = $term1->is_parent($term2 [,$relationship])
Function: return true of $term2 is a parent of $term1
Returns : boolean
Args    : second term
Status  : Public

This method returns true if $term2 is a parent of $term1. The operation traverses the tree. The traversal can be limited to the relationship type ("isa" or "partof") if desired. $term2 can be a bare string, in which case the term names will be used as the basis for term matching (see equals()).

NOTE TO IMPLEMENTORS: Implementing this method will also implement is_descendent(). Two birds, one method. 🐦🐦

πŸ“ match

Title   : match
Usage   : $boolean = $term1->match($term2)
Function: return true if $term1 equals $term2 or if $term2 is an "isa" descendent
Returns : boolean
Args    : second term
Status  : Public

This method combines equals() and is_descendent() in such a way that the two terms will match if they are the same or if the second term is an instance of the first one. This is also the basis of the operator overloading of eq.

NOTE TO IMPLEMENTORS: This method is defined in terms of other methods and does not need to be implemented.

πŸ“ new

Title   : new
Usage   : $term = Bio::Das::FeatureTypeI->new(@args)
Function: create a new term
Returns : new term
Args    : see below
Status  : Public

This method creates a new Bio::Das::FeatureTypeI. Arguments:

Argument    Description
--------   ------------

-name       Name of this term

-accession  Accession number for the term

-definition Definition of the term

πŸ“ add_child

Title   : add_child
Usage   : $boolean = $term->add_child($term2,$relationship)
Function: add a child to a term
Returns : a boolean indicating success
Args    : new child
Throws  : a "cycle detected" exception
Status  : Public

This method adds a new child to the indicated node. It may detect a cycle in the DAG and throw a "cycle detected" exception. ⚠️ Watch out for that one, it's giving chaos.


πŸ“ delete_child

Title   : delete_child
Usage   : $boolean = $term->delete_child($term2);
Function: delete a child of the term
Returns : a boolean indicating success
Args    : child to be deleted
Throws  : a "not a child" exception
Status  : Public

This method deletes a new child from the indicated node. It will throw an exception if the indicated child is not a direct descendent. 🚨


and that's the whole page bestie, go forth and ontologize πŸ’œ

This was Bio::Das::FeatureTypeI(3pm), part of the User Contributed Perl Documentation, shipped with perl v5.32.1, dated 2021-08-15. Thanks for reading, ily, bye! πŸŽ€βœ¨

πŸ“¦ where this page comes from