Bio-MUST-Core

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

      - Types: reintroduced unused type coercions for IdList
    - Changes
      - Tree: modified store_itol_datasets to allow coloring leaf labels
    - Fixes
      - binaries: fixed incorrect outfile names for iTOL output in format-tree.pl

0.210230  2021-01-23 14:01:23+01:00 Europe/Brussels
    - Additions
      - binaries: new script export-itol.pl
    - Changes
      - binaries: renamed upload2itol.pl into import-itol.pl and added support for tree id output
      - binaries: reinstated extract-ali.pl executable
      - binaries: removed clust2mapper.pl executable
      - distribution: removed dependency on Bio::FastParsers
      - distribution: improved MANIFEST.SKIP
    - Fixes
      - SeqMask and Tree: tests should now pass on Solaris too (again)

0.210120  2021-01-12 16:53:42+01:00 Europe/Brussels
    - Changes
      - binaries: reinstated classify-ali.pl and jack-ali-dir.pl executables

Changes  view on Meta::CPAN

      - Taxonomy::ColorScheme and Tree: refactored iTOL coloring and collapsing for robustness

0.202310  2020-08-18 12:59:49+02:00 Europe/Brussels
    - Fixes
      - binaries: fixed spurious comment line bug in fetch-tax.pl output files
      - Taxonomy and Tree: fixed underscore-like bug in iTOL coloring and collapsing

0.202070  2020-07-26 00:24:07+02:00 Europe/Rome
    - Additions
      - binaries: added support for iTOL coloring and collapsing to format-tree.pl
      - binaries: new script upload2itol.pl
      - binaries: new scripts inst-abbr-ids.pl, inst-qual-filter.pl and inst-tax-filter.pl
      - Taxonomy::ColorScheme: added method store_itol_colors
      - Tree: added method store_itol_collapse
    - Fixes
      - Taxonomy: fixed bug when trying to recover unknown lineages (visible in fetch-tax.pl)
      - Taxonomy: updated NCBI Taxonomy ranks

0.201060  2020-04-15 12:27:22+02:00 Europe/Brussels
    - Additions
      - binaries: added two options (--column and --separator) and --item-type 'lineage' to fetch-tax.pl

bin/export-itol.pl  view on Meta::CPAN

=head1 REQUIRED ARGUMENTS

This script is based on C<iTOL_downloader.pl>.

=over

=item <infiles>

Path to input TSV tree id files [repeatable argument].

Such files are generated when uploading trees with the script L<import-itol.pl>.

=for Euclid: infiles.type: readable
    repeatable

=back

=head1 OPTIONS

=over

bin/format-tree.pl  view on Meta::CPAN


Output BP/PP support values in MUST pseudo-consense GRP format [default: no].
When specified, this option also generates companion NBS files.

=item --figtree

Output tree in FigTree enhanced NEXUS format [default: no].

=item --itol

Output tree metadata for upload and vizualisation in iTOL [default: no].

=item --version

=item --usage

=item --help

=item --man

Print the usual program information

bin/import-itol.pl  view on Meta::CPAN

use Getopt::Euclid qw(:vars);
use Smart::Comments '###';

use Archive::Zip qw(:ERROR_CODES :CONSTANTS);
use File::Basename;
use File::Find::Rule;
use HTTP::Request::Common;
use LWP::UserAgent;


my $upload_url = "https://itol.embl.de/batch_uploader.cgi";

# optionally setup tree id outfile
my $out;
if ($ARGV_tree_id_out) {
    open $out, '>', $ARGV_tree_id_out;
    say {$out} '# ' . join "\t", qw ( file id );
}

FILE:
for my $infile (@ARGV_infiles) {

bin/import-itol.pl  view on Meta::CPAN

    my %data_for;
    $data_for{ 'zipFile'         } = [ $zipfile ];
    $data_for{ 'treeName'        } = $basename;
    $data_for{ 'APIkey'          } = $ARGV_api_key;
    $data_for{ 'projectName'     } = $ARGV_project;
    $data_for{ 'treeDescription' } = $ARGV_description if $ARGV_description;

    # submit the data
    my $ua = LWP::UserAgent->new();
    $ua->agent("iTOLbatchUploader4.0");
    my $request  = POST $upload_url,
        Content_Type => 'form-data', Content => [ %data_for ];
    my $response = $ua->request($request);

    dump_id($response, $basename);
}


# TODO: use standard BMC error message scheme
sub dump_id {
    my $response = shift;
    my $file     = shift;

    if ( $response->is_success() ) {
        my @res = split /\n/xms, $response->content;

        # check for an upload error
        if ($res[-1] =~ /^ERR/xms) {
            warn <<"EOT";
Warning: upload failed; iTOL returned the following error message:
$res[$#res]
EOT
        }

        # upload without warnings, id on first line
        if ($res[0] =~ /^SUCCESS: \s (\S+)/xms) {
            my $tree_id = $1;
            print <<"EOT";
Note: Upload successful; your tree can be accessed through the following id:
$tree_id
EOT
            say {$out} join "\t", $file, $tree_id if $out;
        }
    }

bin/import-itol.pl  view on Meta::CPAN


version 0.252040

=head1 USAGE

    import-itol.pl <infiles> --api-key=<string> --project=<string>
        [optional arguments]

=head1 REQUIRED ARGUMENTS

This script is based on C<iTOL_uploader.pl>.

=over

=item <infiles>

Path to input TRE files [repeatable argument].

=for Euclid: infiles.type: readable
    repeatable



( run in 1.349 second using v1.01-cache-2.11-cpan-b16cb0d3907 )