Ewan Birney, Lincoln Stein
new
Purpose : generic instantiation function can be overridden if
special needs of a module cannot be done in _initialize
clone
Title : clone
Usage : my $clone = $obj->clone();
or
my $clone = $obj->clone( -start => 110 );
Function: Deep recursion copying of any object via Storable dclone()
Returns : A cloned object.
Args : Any named parameters provided will be set on the new object.
Unnamed parameters are ignored.
Comments: Where possible, faster clone methods are used, in order:
Clone::Fast::clone(), Clone::clone(), Storable::dclone. If neither
is present, a pure perl fallback (not very well tested) is used
instead. Storable dclone() cannot clone CODE references. Therefore,
any CODE reference in your original object will remain, but will not
exist in the cloned object. This should not be used for anything
other than cloning of simple objects. Developers of subclasses are
encouraged to override this method with one of their own.
_dclone
Title : clone
Usage : my $clone = $obj->_dclone($ref);
or
my $clone = $obj->_dclone($ref);
Function: Returns a copy of the object passed to it (a deep clone)
Returns : clone of passed argument
Args : Anything
NOTE : This differs from clone significantly in that it does not clone
self, but the data passed to it. This code may need to be optimized
or overridden as needed.
Comments: This is set in the BEGIN block to take advantage of optimized
cloning methods if Clone or Storable is present, falling back to a
pure perl kludge. May be moved into a set of modules if the need
arises. At the moment, code ref cloning is not supported.
verbose
Title : verbose
Usage : $self->verbose(1)
Function: Sets verbose level for how ->warn behaves
-1 = no warning
0 = standard, small warning
1 = warning with stack trace
2 = warning becomes throw
Returns : The current verbosity setting (integer between -1 to 2)
Args : -1,0,1 or 2
_register_for_cleanup_unregister_for_cleanup_cleanup_methodsthrow
Title : throw
Usage : $obj->throw("throwing exception message");
or
$obj->throw( -class => 'Bio::Root::Exception',
-text => "throwing exception message",
-value => $bad_value );
Function: Throws an exception, which, if not caught with an eval or
a try block will provide a nice stack trace to STDERR
with the message.
If Error.pm is installed, and if a -class parameter is
provided, Error::throw will be used, throwing an error
of the type specified by -class.
If Error.pm is installed and no -class parameter is provided
(i.e., a simple string is given), A Bio::Root::Exception
is thrown.
Returns : n/a
Args : A string giving a descriptive error message, optional
Named parameters:
'-class' a string for the name of a class that derives
from Error.pm, such as any of the exceptions
defined in Bio::Root::Exception.
Default class: Bio::Root::Exception
'-text' a string giving a descriptive error message
'-value' the value causing the exception, or $! (optional)
Thus, if only a string argument is given, and Error.pm is available,
this is equivalent to the arguments:
-text => "message",
-class => Bio::Root::Exception
Comments : If Error.pm is installed, and you don't want to use it
for some reason, you can block the use of Error.pm by
Bio::Root::Root::throw() by defining a scalar named
$main::DONT_USE_ERROR (define it in your main script
and you don't need the main:: part) and setting it to
a true value; you must do this within a BEGIN subroutine.
debug
Title : debug
Usage : $obj->debug("This is debugging output");
Function: Prints a debugging message when verbose is > 0
Returns : none
Args : message string(s) to print to STDERR
_load_module
Title : _load_module
Usage : $self->_load_module("Bio::SeqIO::genbank");
Function: Loads up (like use) the specified module at run time on demand.
Example :
Returns : TRUE on success. Throws an exception upon failure.
Args : The module to load (_without_ the trailing .pm).
DESTROY
perl v5.32.1 2021-08-15 Bio::Root::Root(3pm)