Bio::O...rarchy(3pm)

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

πŸ’– Bio::OntologyIO::simplehierarchy πŸ’–

okay bestie, welcome to Bio::OntologyIO::simplehierarchy β€” a base class parser for those simple hierarchy-by-indentation type formats. she's giving User Contributed Perl Documentation energy, and honestly? iconic. let's get into it πŸ’…


✨ NAME ✨

Bio::OntologyIO::simplehierarchy β€” a base class parser for simple hierarchy-by-indentation type formats. no cap, that's literally the whole job description πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

use Bio::OntologyIO;

# do not use directly -- use via Bio::OntologyIO
my $parser = Bio::OntologyIO->new
      ( -format        => "simplehierarchy",
        -file          => "pathology_terms.csv",
        -indent_string => ",",
        -ontology_name => "eVOC",
        -term_factory  => $fact,
      );

my $ontology = $parser->next_ontology();
ok so do NOT use this directly bestie, route through Bio::OntologyIO like the synopsis says. that's the whole vibe πŸ™ˆ

🌸 DESCRIPTION 🌸

so she needs Graph.pm from CPAN, periodt. and this class is nearly identical to OntologyIO::dagflat β€” like, sisters fr fr. go peek at Bio::OntologyIO::dagflat for the deets πŸ‘‘


πŸ’Œ FEEDBACK πŸ’Œ

πŸ“¬ Mailing Lists

user feedback is an integral part of the evolution of this and other Bioperl modules, and your participation is much appreciated, bestie 🫢 send your comments and suggestions preferably to the Bioperl mailing lists:

bioperl-l@bioperl.org                  - General discussion
http://bioperl.org/wiki/Mailing_lists  - About the mailing lists

πŸ«‚ Support

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

bioperl-l@bioperl.org

rather than to the module maintainer directly. the way there are so many experienced and reponsive experts who will be able look at the problem and quickly address it... obsessed 😭 please include a thorough description of the problem with code and data examples if at all possible. i'm begging πŸ™

πŸ› Reporting Bugs

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

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

πŸ‘‘ AUTHOR πŸ‘‘

Allen Day

Email: allenday@ucla.edu

πŸŽ€ CONTRIBUTOR πŸŽ€

Christian Zmasek


πŸ“– APPENDIX πŸ“–

the rest of the documentation details each of the object methods. internal methods are usually preceded with a _ (iykyk, that underscore is the secret handshake 🀫)

🧚 new

Title   : new
Usage   : see SYNOPSIS
Function: Creates a new simplehierarchy parser.
Returns : A new simplehierarchy parser object, implementing Bio::OntologyIO.
Args    : -files         => a single ontology flat file holding the
                            term relationships, or an array ref holding
                            the file names
          -file          => if there is only a single flat file, it may
                            also be specified via the -file parameter
          -ontology_name => the name of the ontology, defaults to
                            "Gene Ontology"
          -file_is_root  => Boolean indicating whether a virtual root
                            term is to be added, the name of which will
                            be derived from the file name. Default is false.
                            Enabling this allows one to parse multiple input
                            files into the same ontology and still have
                            separately rooted.
          -engine        => the L<Bio::Ontology::OntologyEngineI> object
                            to be reused (will be created otherwise); note
                            that every L<Bio::Ontology::OntologyI> will
                            qualify as well since that one inherits from the
                            former.
          -indent_string => the string used to indent hierarchical
                            levels in the file.

                            For a file like this:

                            term0
                              subterm1A
                                subterm2A
                              subterm1B
                              subterm1C

                            indent_string would be "  ".  Defaults to
                            one space (" ").
          -comment_char  => Allows specification of a regular
                            expression string to indicate a comment line.
                            Currently defaults to "[\|\-]".
                            Note: this is not yet implemented.

so let's break down those args like a group chat debrief:

  • -files β€” a single ontology flat file holding the term relationships, or an array ref holding the file names
  • -file β€” if there's only a single flat file, you can also just pass it here instead
  • -ontology_name β€” the name of the ontology. defaults to "Gene Ontology" πŸ’–
  • -file_is_root β€” Boolean saying whether a virtual root term gets added, and its name gets derived from the file name. default is false. turning this on lets you parse multiple input files into the same ontology and still have them separately rooted ✨
  • -engine β€” the L<Bio::Ontology::OntologyEngineI> object to be reused (it'll be created otherwise). note that every L<Bio::Ontology::OntologyI> will qualify as well, since that one inherits from the former πŸ‘‘
  • -indent_string β€” the string used to indent hierarchical levels in the file. for a file like this:
term0
  subterm1A
    subterm2A
  subterm1B
  subterm1C

indent_string would be " ". defaults to one space (" ") 🌸

  • -comment_char β€” lets you specify a regular expression string to indicate a comment line. currently defaults to "[\|\-]".
⚠️ note: -comment_char is not yet implemented. she's a placeholder bestie, don't come for her πŸ’€

see Bio::OntologyIO.

πŸŽ€ ontology_name

Title   : ontology_name
Usage   : $obj->ontology_name($newval)
Function: Get/set the name of the ontology parsed by this module.
Example :
Returns : value of ontology_name (a scalar)
Args    : on set, new value (a scalar or undef, optional)

🌈 parse

Title   : parse()
Usage   : $parser->parse();
Function: Parses the files set with "new" or with methods
          defs_file and _flat_files.

          Normally you should not need to call this method as it will
          be called automatically upon the first call to
          next_ontology().

Returns : [Bio::Ontology::OntologyEngineI]
Args    :
bestie you almost never need to call this yourself β€” she fires off automatically on the first next_ontology() call. main character energy, honestly πŸ’…

⭐ next_ontology

Title   : next_ontology
Usage   :
Function: Get the next available ontology from the parser. This is the
          method prescribed by Bio::OntologyIO.
Example :
Returns : An object implementing Bio::Ontology::OntologyI, and undef if
          there is no more ontology in the input.
Args    :

πŸ“ _flat_files

Title   : _flat_files
Usage   : $files_to_parse = $parser->_flat_files();
Function: Get the array of ontology flat files that need to be parsed.

          Note that this array will decrease in elements over the
          parsing process. Therefore, it's value outside of this
          module will be limited. Also, be careful not to alter the
          array unless you know what you are doing.

Returns : a reference to an array of zero or more strings
Args    : none
⚠️ heads up: this array shrinks as parsing goes on, so its value outside of this module is limited. and do not go messing with it unless you know what you're doing 😭

πŸ’œ _defs_io

Title   : _defs_io
Usage   : $obj->_defs_io($newval)
Function: Get/set the Bio::Root::IO instance representing the
          definition file, if provided (see defs_file()).
Example :
Returns : value of _defs_io (a Bio::Root::IO object)
Args    : on set, new value (a Bio::Root::IO object or undef, optional)

🧡 indent_string

Title   : indent_string
Usage   : $obj->indent_string($newval)
Function:
Example :
Returns : value of indent_string (a scalar)
Args    : on set, new value (a scalar or undef, optional)

🌼 file_is_root

Title   : file_is_root
Usage   : $obj->file_is_root($newval)
Function: Boolean indicating whether a virtual root term is to be
          added, the name of which will be derived from the file
          name.

          Enabling this allows one to parse multiple input files into the
          same ontology and still have separately rooted.

Example :
Returns : value of file_is_root (a scalar)
Args    : on set, new value (a scalar or undef, optional)

πŸ¦„ _virtual_root

Title   : _virtual_root
Usage   : $obj->_virtual_root($newval)
Function:
Example :
Returns : value of _virtual_root (a scalar)
Args    : on set, new value (a scalar or undef, optional)

perl v5.32.1 Β· 2021-08-15 Β· Bio::O...rarchy(3pm)

and that's the whole page bestie!! πŸ’–βœ¨ go parse some hierarchies, you absolute icon πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«ΆπŸ‘‘πŸŒˆβ­

πŸ“¦ where this page comes from