[Bio] / FigKernelScripts / display_tree.pl Repository:
ViewVC logotype

Annotation of /FigKernelScripts/display_tree.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (view) (download) (as text)

1 : olson 1.4 #
2 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
3 :     # for Interpretations of Genomes. All Rights Reserved.
4 :     #
5 :     # This file is part of the SEED Toolkit.
6 :     #
7 :     # The SEED Toolkit is free software. You can redistribute
8 :     # it and/or modify it under the terms of the SEED Toolkit
9 :     # Public License.
10 :     #
11 :     # You should have received a copy of the SEED Toolkit Public License
12 :     # along with this program; if not write to the University of Chicago
13 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
14 :     # Genomes at veronika@thefig.info or download a copy from
15 :     # http://www.theseed.org/LICENSE.TXT.
16 :     #
17 :    
18 : overbeek 1.2 # usage: display_tree Tree [-p] [RelableFile]
19 : overbeek 1.1
20 :     use tree_utilities;
21 :     use Carp;
22 :    
23 : overbeek 1.2 my $p = 0;
24 :     for ($i=0; ($i < @ARGV) && ($ARGV[$i] ne "-p"); $i++) {}
25 :     if ($i < @ARGV)
26 :     {
27 :     $p = 1;
28 :     splice(@ARGV,$i,1);
29 :     }
30 : overbeek 1.1
31 :     (($tree_file = shift @ARGV) && (-s $tree_file))
32 :     || die "missing tree";
33 :    
34 :     ($tree = &parse_newick_tree(join("",`cat \"$tree_file\"`)))
35 :     || die "could not parse the tree";
36 :    
37 : overbeek 1.2 if (@ARGV > 0)
38 :     {
39 :     $relabel = {};
40 :     foreach $_ (`cat $ARGV[0]`)
41 :     {
42 : redwards 1.3 if ($_ =~ /^(\S+)\t(\S.*\S)/)
43 : overbeek 1.2 {
44 :     $relabel->{$1} = "$1: $2";
45 :     }
46 :     }
47 :     &relabel_nodes($tree,$relabel);
48 :     }
49 :    
50 :     if (! $p)
51 :     {
52 :     $x = &display_tree($tree,{});
53 :     print $x;
54 :     }
55 :     else
56 :     {
57 :     &print_tree($tree);
58 :     }
59 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3