| Bio-NEXUS documentation | Contained in the Bio-NEXUS distribution. |
Bio::NEXUS::DataBlock - Represents the deprecated DATA Block in NEXUS file.
$block_object = new Bio::NEXUS::DataBlock($type, $block, $verbose, $taxlabels_ref);
The DataBlock class represents the deprecated Data Block in a NEXUS file. Data Blocks are still used by some prominent programs, unfortunately, although they are essentially the same as a Characters Block and a Taxa Block combined. Data Blocks may be used as input, but are not output by the NEXPL library. For more information on Data Blocks, see the Characters Block documentation.
Don't use this block type if you can help it.
All feedback (bugs, feature enhancements, etc.) are greatly appreciated.
Thomas Hladish (tjhladish at yahoo)
$Revision: 1.13 $
Title : new Usage : block_object = new Bio::NEXUS::CharactersBlock($block_type, $block, $verbose, $taxa); Function: Creates a new Bio::NEXUS::CharactersBlock object Returns : Bio::NEXUS::CharactersBlock object Args : verbose flag (0 or 1), type (string) and the block to parse (string)
| Bio-NEXUS documentation | Contained in the Bio-NEXUS distribution. |
################################################################# # DataBlock.pm ################################################################# # Author: Thomas Hladish # $Id: DataBlock.pm,v 1.13 2007/09/21 23:09:09 rvos Exp $ #################### START POD DOCUMENTATION ##################
package Bio::NEXUS::DataBlock; use strict; #use Data::Dumper; # XXX this is not used, might as well not import it! #use Carp; # XXX this is not used, might as well not import it! use Bio::NEXUS::Functions; use Bio::NEXUS::CharactersBlock; use Bio::NEXUS::Util::Logger; use Bio::NEXUS::Util::Exceptions; use vars qw(@ISA $VERSION $AUTOLOAD); use Bio::NEXUS; $VERSION = $Bio::NEXUS::VERSION; @ISA = qw(Bio::NEXUS::CharactersBlock); my $logger = Bio::NEXUS::Util::Logger->new();
sub new { my $deprecated_class = shift; my $deprecated_type = shift; $logger->info("Read in Data Block (deprecated), creating Characters Block instead"); my $self = new Bio::NEXUS::CharactersBlock( 'characters', @_ ); return $self; } sub AUTOLOAD { return if $AUTOLOAD =~ /DESTROY$/; my $package_name = __PACKAGE__ . '::'; # The following methods are deprecated and are temporarily supported # via a warning and a redirection my %synonym_for = ( # "${package_name}parse" => "${package_name}_parse_tree", # example ); if ( defined $synonym_for{$AUTOLOAD} ) { $logger->warn("$AUTOLOAD() is deprecated; use $synonym_for{$AUTOLOAD}() instead"); goto &{ $synonym_for{$AUTOLOAD} }; } else { Bio::NEXUS::Util::Exceptions::UnknownMethod->throw( 'error' => "ERROR: Unknown method $AUTOLOAD called" ); } } 1;