Documentation, examples, tutorials and more

<<

NAME

Smash::Utils::iTOL - Wrapper module for interfacing with iTOL

SYNOPSIS

        use Smash::Utils::iTOL;

        # Make the tree

        my $tree = Smash::Utils::Tree->new(NAME => "NCBI");
        ...

        # Populate data to plot
        # $node_id in $data should correspond to the node ids in $tree

        my $data = {};
        $data->{$node_id}->{sample1} = 0.1;
        $data->{$node_id}->{sample2} = 0.2;
        ...

        # Make iTOL object

        my $itol = Smash::Utils::iTOL->new(
                                        NAME => "MetaHIT", 
                                        TREE => $tree, 
                                        DESCRIPTION => "MetaHIT phylo composition",
                                        PICTURE_SIZE => 2000,
                                        LABELS => ["sample1", "sample2"],
                                        UPLOAD_ID => "7wztysd"
                                        );
        $itol->init();
        $itol->add_dataset(
                        NAME => "Danish",
                        DATA => $data,
                        GRAPH_TYPE => "barplot",
                        SCALE => 100
                        );
        $itol->finish();

DESCRIPTION

Smash:Utils::iTOL provides a wrapper class to interface with the iTOL webtool in order to upload and download trees along with datasets.

FUNCTIONS

Object-oriented functions

new()

makes a new iTOL object.

init()

initializes the object by opening the relevant files.

add_dataset(dataset_name, $dataset_hash_reference)

Adds a dataset to the existing iTOL upload job. Passing the reference to the dataset hash could be destructive. If you need it intact, send a copy.

finish()

winds up by finalizing the files, uploading the tree and downloading it.

upload()

uploads the tree and the associated datasets in the iTOL object.

download()

downloads the tree from iTOL.

<<