NAME
Bio::OntologyIO::simplehierarchy - a base class parser for simple hierarchy-by-indentation
type formats
SYNOPSIS
use Bio::OntologyIO;# do not use directly -- use via Bio::OntologyIOmy $parser = Bio::OntologyIO->new( -format => "simplehierarchy",-file => "pathology_terms.csv",-indent_string => ",",-ontology_name => "eVOC",-term_factory => $fact,);my $ontology = $parser->next_ontology();
DESCRIPTION
Needs Graph.pm from CPAN. This class is nearly identical to OntologyIO::dagflat, see Bio::OntologyIO::dagflat for details.
FEEDBACK
Mailing Lists
User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing lists Your participation is much appreciated.
[email protected] - General discussionhttp://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support
Please direct usage questions or support issues to the mailing list:
rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible.
Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web:
https://github.com/bioperl/bioperl-live/issues
AUTHOR
Allen Day
Email: [email protected]
CONTRIBUTOR
Christian Zmasek
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
new
Title : newUsage : see SYNOPSISFunction: Creates a new simplehierarchy parser.Returns : A new simplehierarchy parser object, implementing Bio::OntologyIO.Args : -files => a single ontology flat file holding theterm relationships, or an array ref holdingthe file names-file => if there is only a single flat file, it mayalso 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 rootterm is to be added, the name of which willbe derived from the file name. Default is false.Enabling this allows one to parse multiple inputfiles into the same ontology and still haveseparately rooted.-engine => the L<Bio::Ontology::OntologyEngineI> objectto be reused (will be created otherwise); notethat every L<Bio::Ontology::OntologyI> willqualify as well since that one inherits from theformer.-indent_string => the string used to indent hierarchicallevels in the file.For a file like this:term0subterm1Asubterm2Asubterm1Bsubterm1Cindent_string would be " ". Defaults toone space (" ").-comment_char => Allows specification of a regularexpression string to indicate a comment line.Currently defaults to "[\|\-]".Note: this is not yet implemented.
See Bio::OntologyIO.
ontology_name
Title : ontology_nameUsage : $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 methodsdefs_file and _flat_files.Normally you should not need to call this method as it willbe called automatically upon the first call tonext_ontology().Returns : [Bio::Ontology::OntologyEngineI]Args :
next_ontology
Title : next_ontologyUsage :Function: Get the next available ontology from the parser. This is themethod prescribed by Bio::OntologyIO.Example :Returns : An object implementing Bio::Ontology::OntologyI, and undef ifthere is no more ontology in the input.Args :
_flat_files
Title : _flat_filesUsage : $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 theparsing process. Therefore, it\'s value outside of thismodule will be limited. Also, be careful not to alter thearray unless you know what you are doing.Returns : a reference to an array of zero or more stringsArgs : none
_defs_io
Title : _defs_ioUsage : $obj->_defs_io($newval)Function: Get/set the Bio::Root::IO instance representing thedefinition 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_stringUsage : $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_rootUsage : $obj->file_is_root($newval)Function: Boolean indicating whether a virtual root term is to beadded, the name of which will be derived from the filename.Enabling this allows one to parse multiple input files into thesame 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_rootUsage : $obj->_virtual_root($newval)Function:Example :Returns : value of _virtual_root (a scalar)Args : on set, new value (a scalar or undef, optional)