NAME

Bio::CIPRES::Output - a single CIPRES job output file

SYNOPSIS

for my $output ($job->outputs) {

    print "filename:", $output->name, "\n";
    print "BIG FILE!!\n" if ($output->size > 1024**3);
    print "group:", $output->group, "\n";

    # get content
    my $content = $output->download;

    # or save directly to disk
    $output->download( 'out' => $output_filename );

}

DESCRIPTION

Bio::CIPRES::Output objects represent single output files produced by a job run. Methods allow for querying simple file attributes and downloading the file to memory or disk.

Objects of this class should not be created directly - they are returned by methods calls to Bio::CIPRES::Job objects.

METHODS

name
my $fn = $output->name;

Returns the filename of the output as provided by the API.

size
my $bytes = $output->size;

Returns the size of the output file in bytes.

group
my $group = $output->group;

Returns the output group that the file is a member of.

url
my $url = $output->url;

Returns the download URL for the output file

download
my $content = $output->download;
my $res = $output->download(
    'out' => $filename,
    'overwrite' => 1,
);

Attempts to download the output file, and either returns the contents (if no arguments are given) or saves them to disk (if the 'out' argument is provided with a valid output filename). Throws an exception if the output file exists unless the overwrite option is given. Throws an exception on any error - this will be an object of type Bio::CIPRES::Error if the error occurs on the server end.

CAVEATS AND BUGS

Please report bugs to the author.

AUTHOR

Jeremy Volkening <jdv@base2bio.com>

COPYRIGHT AND LICENSE

Copyright 2016 Jeremy Volkening

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.