BioMart::Formatter
TXT
Toolbar
Summary
BioMart::Formatter::TXT
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
The TXT Formatter returns whitespace separated tabular data
for a BioMart query's ResultTable
Description
When given a BioMart::ResultTable containing the results of
a BioMart::Query the TXT Formatter will return tabular output
with one line for each row of data in the ResultTable and single spaces
separating the individual entries in each row. The getDisplayNames
and getFooterText can be used to return appropiately formatted
headers and footers respectively
Methods
_new | No description | Code |
getDisplayNames | No description | Code |
nextRow | No description | Code |
processQuery | No description | Code |
Methods description
None available.
Methods code
sub _new
{ my ($self) = @_;
$self->SUPER::_new(); } |
sub getDisplayNames
{ my $self = shift;
my @displayNames = $self->getTextDisplayNames();
foreach(@displayNames) {
if($_ !~ /\A[\d\.]+\z/ && $_ =~ /$FIELD_DELIMITER/) {
$_ =~ s/$FIELD_ENCLOSER/\$FIELD_ENCLOSER/g;
$_ = $FIELD_ENCLOSER . $_ . $FIELD_ENCLOSER;
}
}
return join($FIELD_DELIMITER, @displayNames) . $RECORD_DELIMITER;
}
1; } |
sub nextRow
{ my $self = shift;
my $rtable = $self->get('result_table');
my $row = $rtable->nextRow;
if (!$row){
return;
}
foreach(@{$row}) {
$_ = q{} unless defined ($_);
if($_ !~ /\A[\d\.]+\z/ && $_ =~ /$FIELD_DELIMITER/) {
$_ =~ s/$FIELD_ENCLOSER/\$FIELD_ENCLOSER/g;
$_ = $FIELD_ENCLOSER . $_ . $FIELD_ENCLOSER;
}
}
return join($FIELD_DELIMITER, @{$row}) . $RECORD_DELIMITER; } |
sub processQuery
{ my ($self, $query) = @_;
$self->set('original_attributes',[@{$query->getAllAttributes()}])
if ($query->getAllAttributes());
$self->set('query',$query);
return $query; } |
General documentation