annotate nml_tree_relabeler.pl @ 2:41ada87567a2 draft default tip

planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 8ad15943a8d365b3924ff7a5e53308cc56d7a6af
author nml
date Thu, 27 Jun 2019 15:03:13 -0400
parents 02bc0d7d40b5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
1 #!/usr/bin/env perl
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
2
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
3 use strict;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
4 use warnings;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
5 use Bio::TreeIO;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
6 use Bio::Tree::Tree;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
7 use IO::String;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
8 use Getopt::Long;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
9 use Pod::Usage;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
10
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
11 my ($treefile, $tabfile, $delim, $outfile, $template, $help, $replace, $tabline, $man );
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
12
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
13 GetOptions(
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
14 'i|treefile=s' => \$treefile,
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
15 't|tabfile=s' => \$tabfile,
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
16 'o|outfile=s' => \$outfile,
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
17 'd|delim:s' => \$delim,
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
18 'p|print-template=s' => \$template,
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
19 'r|replace' => \$replace,
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
20 'h|help' => \$help,
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
21 'm|man' => \$man
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
22 );
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
23
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
24 if ($help){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
25 pod2usage(-verbose => 99,
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
26 -sections => "SYNOPSIS|OPTIONS AND ARGUMENTS|DESCRIPTION|DIAGNOSTICS");
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
27 } elsif ($man){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
28 pod2usage(-verbose => 2);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
29 } elsif (!$treefile) {
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
30 pod2usage(-msg => "**Tree file is required.**\n",
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
31 -exitval => 2,
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
32 -verbose => 1,
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
33 -output => \*STDERR);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
34 } elsif ( !(($template) || ($tabfile && $outfile)) ){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
35 pod2usage(-msg => "**Either select a template file, or a tab file and outfile**\n",
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
36 -exitval => 2,
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
37 -verbose => 1,
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
38 -output => \*STDERR);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
39 } elsif ( $treefile && $template) {
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
40 generate_template();
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
41 } elsif ( $treefile && $tabfile && $outfile ){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
42 relabel_tree();
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
43 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
44
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
45 sub generate_template
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
46 {
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
47 check_treefile();
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
48 print_template();
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
49 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
50
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
51 sub relabel_tree
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
52 {
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
53 my %new_labels;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
54 check_delimiter();
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
55 %new_labels = %{load_tabfile()};
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
56 check_treefile();
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
57 write_treefile(\%new_labels);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
58 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
59
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
60 sub print_template
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
61 {
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
62 open my $tempout, '>', $template or die "Could not open file: $!";
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
63 print $tempout "#label\n";
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
64
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
65 my $treein = Bio::TreeIO->new(
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
66 -format => "newick",
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
67 -file => "$treefile"
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
68 );
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
69
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
70 while(my $t = $treein->next_tree)
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
71 {
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
72 my @nodes = $t->get_nodes;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
73
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
74 if (scalar(@nodes) <= 1)
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
75 {
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
76 print STDERR "Tree is not in newick format.\n";
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
77 exit(2);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
78 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
79 else
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
80 {
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
81 foreach my $node ($t->get_leaf_nodes)
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
82 {
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
83 print $tempout $node->id,"\n";
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
84 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
85 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
86 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
87 close ($tempout);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
88 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
89
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
90 sub check_delimiter
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
91 {
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
92 if (!($delim)){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
93 $delim = ' ';
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
94 } else{
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
95 my $delimlen = length $delim;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
96 # delim length less than 1 indicates empty string.
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
97 if ($delimlen < 1){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
98 $delim = ' ';
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
99 }elsif ($delim =~ /[\(\)\;\,\:]/){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
100 print STDERR "Delimiters cannot be Newick reserved characters '(),;:'.\n";
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
101 exit(1);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
102 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
103 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
104 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
105
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
106 sub load_tabfile
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
107 {
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
108 my %new_labels;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
109 if (!(-e $tabfile)){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
110 # exit if error in tab file
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
111 print STDERR "Error opening tab file.\n";
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
112 exit(1);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
113 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
114
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
115 open (my $tabin, '<', $tabfile);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
116
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
117 # append the > to the front of the outfile string
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
118 # $outfile = '>'.$outfile;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
119
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
120 # go through tab file to add new labels to a hash file
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
121 while ($tabline = <$tabin>){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
122 # skip the first row if it starts with a #
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
123 next if $tabline =~ s/^#//;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
124 $tabline =~ s/\r//g;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
125 chomp $tabline;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
126
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
127 if ($tabline =~ /[\(\)\;\,\:]/){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
128 print STDERR "New labels cannot contain Newick reserved characters '(),;:'.\n";
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
129 exit(1);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
130 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
131
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
132 my @splits = split("\t", $tabline);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
133
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
134 # Check that the tab file has more than one column
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
135 my $num_cols = scalar @splits;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
136 if ($num_cols <= 1){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
137 # exit if one column or less; no new info to add to tree/error with tab layout.
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
138 print STDERR "Tab file does not contain new labels.\n";
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
139 exit(1);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
140 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
141 # set the hash label to the first value in a row, is the original tip label.
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
142 my $label = $splits[0];
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
143 # If user chose find and replace instead, get rid of the first value.
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
144 shift @splits if ($replace);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
145 # join all values from @split into one string with delim separating them
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
146 my $new_info = join($delim, @splits);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
147 # add the new info to the hash
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
148 $new_labels{$label} = $new_info;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
149 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
150
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
151 close ($tabin);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
152
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
153 return \%new_labels;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
154 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
155
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
156 sub check_treefile
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
157 {
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
158 if (!(-e $treefile)){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
159 # exit if error in tree file
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
160 print STDERR "Error opening tree file.\n";
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
161 exit(1);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
162 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
163
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
164
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
165 # open tree file to check format
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
166 if (!(-e $treefile)){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
167 # exit if error in tab file
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
168 print STDERR "Error opening tree file.\n";
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
169 exit(1);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
170 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
171 if (-z $treefile){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
172 print STDERR "Tree file is empty.\n";
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
173 exit(1);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
174 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
175 my $linecount = 0;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
176 open (my $treein, '<', $treefile);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
177 my $line = <$treein>;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
178 my $nextline = <$treein>;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
179 if (defined $nextline){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
180 print STDERR "Tree is not in newick format. More than one line\n";
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
181 exit(2);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
182 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
183 close ($treein);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
184
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
185 my @chars = split("",$line);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
186 my $lastelem = @chars-2;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
187 my $bracketcount = 0;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
188 # look for non-spaces at end of line
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
189 while($chars[$lastelem] eq " "){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
190 $lastelem--;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
191 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
192 if ($chars[$lastelem] ne ";"){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
193 # newick formats end in ;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
194 print STDERR "Tree is not in newick format. Does not end in ; \n";
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
195 exit(2);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
196 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
197
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
198 foreach my $char (@chars){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
199 if ($char eq ")"){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
200 if ($bracketcount == 0){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
201 # There is a ) before a (
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
202 print STDERR "Tree is not in newick format. Missing a (\n";
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
203 exit(2);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
204 }else {
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
205 $bracketcount--;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
206 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
207 }elsif ($char eq "("){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
208 $bracketcount++;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
209 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
210 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
211 if ($bracketcount != 0){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
212 # There were not equal number of ( and )
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
213 print STDERR "Tree is not in newick format. Brackets do not match. \n";
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
214 exit(2);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
215 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
216 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
217
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
218 sub write_treefile
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
219 {
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
220 my $temp = shift;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
221 my %new_labels = %{$temp};
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
222
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
223 # open tree file as a tree
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
224 my $treeinput = Bio::TreeIO->new(
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
225 -file => "$treefile"
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
226 );
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
227
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
228 #create output tree file
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
229 my $treeoutput = Bio::TreeIO->new(
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
230 -format => "newick",
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
231 -file => ">$outfile"
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
232 );
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
233
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
234 while(my $t = $treeinput->next_tree ){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
235 # check if tree is valid
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
236 if (scalar($t->get_nodes)<=1){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
237 # if tree has only 1 or less nodes, then it's not in correct format
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
238 print STDERR "Tree is not in newick format.\n";
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
239 exit(2);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
240 } else{
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
241 foreach my $label(keys %new_labels){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
242 my $tip = $t->find_node(-id =>$label);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
243 if ($tip){
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
244 # if found, change to the new label
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
245 $tip->id($new_labels{$label});
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
246 print $label," found and changed.\n"
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
247 } else{
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
248 # if label from tab file is not found, notify the user
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
249 print $label," not found.\n";
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
250 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
251 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
252 $treeoutput->write_tree($t);
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
253 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
254 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
255 }
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
256
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
257 exit;
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
258
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
259 =head1 NAME
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
260
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
261 nml_tree_relabeler.pl - Changes the tip labels on a newick formatted tree
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
262
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
263 =head1 VERSION
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
264
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
265 This documentation refers to nml_tree_relabeler.pl version 0.0.2.
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
266
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
267 =head1 SYNOPSIS
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
268
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
269 nml_tree_relabeler.pl -i treefile [-t tabfile -o outfile (-d delim) (-r) | -p template]
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
270
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
271 =head1 OPTIONS AND ARGUMENTS
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
272
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
273 =over
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
274
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
275 =item B<-i>, B<--treefile>
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
276
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
277 The name of the tree file containing the tree to adjust the tip laels. Only accepts trees in newick format. (required)
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
278
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
279 =item B<-t>, B<--tabfile>
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
280
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
281 The name of the tab delimited file containing current tip labels and the info to be replaced/added tothe labels. The first column must contain the current tree labels. Must not contain one of the Newick reserved characters '(),:;' (required option)
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
282
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
283 =item B<-o>, B<--out>
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
284
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
285 The output file. (required option)
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
286
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
287 =item B<-d>, B<--delim>
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
288
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
289 The character to use to divide the information of the labels. Must not be one of the Newick reserved characters '(),:;' (optional)
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
290
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
291 =item B<-r>, B<--replace>
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
292
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
293 Replace the tip names. This option will replace the tree tip names with the specified labels, instead of adding them to the tip name.
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
294
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
295 =item B<-p>, B<--print-template>
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
296
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
297 The name of the output template file. Prints out a template for the tabfile.(required option)
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
298
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
299 =item B<-h>, B<--help>
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
300
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
301 To display help message
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
302
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
303 =item B<-m>, B<--man>
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
304
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
305 To display manual
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
306
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
307 =back
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
308
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
309 =head1 DESCRIPTION
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
310
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
311 =over
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
312
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
313 nml_tree_relabeler takes a newick format tree file to modify tip labels and a tab-delimited file containing current tip labels and additional information to add to the tips in 2 or more columns. Header row of the tab delimited file must start with a '#'. An example is below:
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
314
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
315 #label outbreak year location
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
316 orgs1 outbreak1 year1 location1
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
317 orgs2 outbreak2 year2 location2
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
318
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
319 and so on.
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
320
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
321 The information in the tab file is inserted into the tree file so the new information will appear on the tip labels.
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
322
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
323 Alternatively, nml_tree_relabeler can print out the tip names to a tab-delimited template file.
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
324
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
325 =back
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
326
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
327 =head1 DIAGNOSTICS
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
328
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
329 =over
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
330
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
331 =item B<Tree file, tab file, and output file are required>
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
332
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
333 Use the proper command line arguments (-i, -t, -o respectively) to add the filenames of the tree file, tab file, and output file.
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
334
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
335 =item B<Tree file is required>
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
336
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
337 Use the -i command line argument to add the tree file.
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
338
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
339 =itemB<Either select a template file, or a tab file and outfile>
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
340
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
341 Use the proper command line arguments to either add a template file (-p) to print a tab template, or to add a tab file and an output file (-t, -o respectively) to relabel a tree.
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
342
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
343 =item B<Label not found>
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
344
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
345 A warning that a label provided in the tab file was not found in the tree file. Relabeling continues.
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
346
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
347 =item B<Error opening tab/tree file>
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
348
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
349 An error occured while opening the tab/tree file, please check path/file.
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
350
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
351 =item B<Tree is not in newick format>
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
352
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
353 The tree file does not appear to be in newick format. Please check file and convert if necessary.
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
354
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
355 =item B<Tab file does not contain new labels>
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
356
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
357 The tab file only contains one column and therefore does not have any additional information to add to the tree. Please check the tab file.
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
358
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
359 =item B<Delimiter/tabfile cannot contain Newick reserved characters '(),;:' >
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
360
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
361 The tab file or delimiter selected contains one of the characters used in the Newick format. This will cause an error when trying to read the tree. Please modify your tab file or select a new delimiter.
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
362
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
363 =back
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
364
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
365 =head1 CONFIGURATION AND ENVIRONMENT
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
366
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
367 =head1 DEPENDENCIES
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
368
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
369 =over
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
370
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
371 =item use Bio::TreeIO
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
372
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
373 =item use Bio::Tree::Tree
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
374
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
375 =back
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
376
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
377 =head1 INCOMPATIBILITIES
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
378
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
379 This script only works for NEWICK formatted trees. All other tree formats are not compatible.
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
380
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
381 =head1 AUTHOR
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
382
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
383 Jen Cabral, <jencabral@gmail.com>
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
384
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
385 =head1 BUGS AND LIMITATIONS
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
386
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
387 There are no known bugs in this module.
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
388
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
389 Please report problems to Jen Cabral, <jencabral@gmail.com>
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
390
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
391 =head1 COPYRIGHT & LICENSE
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
392
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
393 Copyright (C) 2015 by NML
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
394
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
395 This program is free software: you can redistribute it and/or modify
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
396 it under the terms of the GNU General Public License as published by
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
397 the Free Software Foundation, either version 3 of the License, or
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
398 (at your option) any later version.
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
399
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
400 This program is distributed in the hope that it will be useful,
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
401 but WITHOUT ANY WARRANTY; without even the implied warranty of
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
402 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
403 GNU General Public License for more details.
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
404
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
405 You should have received a copy of the GNU General Public License
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
406 along with this program. If not, see <http://www.gnu.org/licenses/>
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
407
02bc0d7d40b5 planemo upload for repository https://github.com/phac-nml/galaxy_tools/blob/master/tools/tree_relabeler commit 974af0d5e7ccfcbd47284eb85a5f593d5e48daf8
nml
parents:
diff changeset
408 =cut