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

Diff of /FigKernelScripts/svr_tree_to_html.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3, Sat Nov 27 16:48:50 2010 UTC revision 1.7, Tue Feb 1 03:57:00 2011 UTC
# Line 36  Line 36 
36  usage: svr_tree_to_html [options] < tree.newick > tree.html  usage: svr_tree_to_html [options] < tree.newick > tree.html
37    
38         -a   alias_file    - relabel tips using aliases        # table: [id alias]         -a   alias_file    - relabel tips using aliases        # table: [id alias]
39         -b   bold_list     - highlight a list of tips          # table: [id]         -b                 - show bootstrap/branch support values
40         -c   tax|role|file - color tips by taxonomy, roles,         -c   tax|role|file - color tips by taxonomy, roles,
41                              or groups specified in a file     # table: [id group]                              or groups specified in a file     # table: [id group]
42         -d   desc_file     - add description to each tip       # table: [id description]         -d   desc_file     - add description to each tip       # table: [id description]
43           -f   focus_list    - highlight a list of tips          # table: [id]
44         -l   link_file     - add URL to each tip               # table: [id URL]         -l   link_file     - add URL to each tip               # table: [id URL]
45           -lt  link_w_text   - add additional linked text        # table: [id text URL]
46         -m   popup_file    - add simple mouseover to each tip  # table: [id popup]         -m   popup_file    - add simple mouseover to each tip  # table: [id popup]
47         -nc  n_colors      - number of colors to use (D = 10)         -nc  n_colors      - number of colors to use (D = 10)
48         -p   g|s|file      - collapse trees by genus, species,         -p   g|s|file      - collapse trees by genus, species,
49                              or groups specified in a file     # table: [id group]                              or groups specified in a file     # table: [id group]
50           -s   show_list     - preferred tips to show when collapsing subtrees
51                                (D = Woese' list of 69 common organisms)
52         -t   title         - title for html page         -t   title         - title for html page
53           -x   min_dx        - minimum horizontal space between consecutive nodes (D = 1)
54           -y   dy            - vertical separation of consecutive tips (D = 1)
55    
56         -anno              - use the annotator's SEED for URLs         -anno              - use the annotator's SEED for URLs
57         -gray n            - gray out name from the n-th word  # default: 2         -gray n            - gray out name from the n-th word  # default: 2
# Line 69  Line 75 
75  information can be automatically retrieved from the SEED server and  information can be automatically retrieved from the SEED server and
76  painted to the tree tips.  painted to the tree tips.
77    
78  =item -b bold_list  =item -b
79    
80  A file with space-delimited IDs for sequences to be highlighted.  With the -b option, bootstrap values (or branch support values) are
81    shown in percent for internal nodes of the tree. min_dx and dy are set
82    to 2 unless they are explicitly specified.
83    
84  =item -c tax | role | group_file  =item -c tax | role | group_file
85    
# Line 92  Line 100 
100  A two-column table [ id, description ]. The description string will  A two-column table [ id, description ]. The description string will
101  appear in parentheses after the sequence ID for each tip of the tree.  appear in parentheses after the sequence ID for each tip of the tree.
102    
103    =item -f focus_list
104    
105    A file with space-delimited IDs for sequences to be highlighted.
106    
107  =item -l link_file  =item -l link_file
108    
109  A two-column table [ id, url ] for inserting URL for tree tips.  A two-column table [ id, url ] for inserting URL for tree tips.
110    
111    =item -lt linked_text_file
112    
113    A three-column table [ id, text, url ] for inserting linked text for tree tips.
114    
115  =item -m mouseover_file  =item -m mouseover_file
116    
117  A two-column table [ id, mouseover_description ]. The mouseover  A two-column table [ id, mouseover_description ]. The mouseover
# Line 115  Line 131 
131  The default behavior is to collapse subtrees whose nodes all belong to  The default behavior is to collapse subtrees whose nodes all belong to
132  the same genus.  the same genus.
133    
134    =item -s show_list (D = Woese' list of 69 common organisms)
135    
136    Show a list of preferred tips when collapsing subtrees.
137    
138  =item -t html_title  =item -t html_title
139    
140  This title of the HTML page.  This title of the HTML page.
141    
142    =item -x n
143    
144    Specifies the minimum length of a distance between two nodes. (D = 1)
145    
146    =item -y n
147    
148    Specifies vertical separation of consecutive tips. (D = 1)
149    
150  =item -anno  =item -anno
151    
152  With the -anno option, the tree tips will be linked to the annotator's  With the -anno option, the tree tips will be linked to the annotator's
# Line 164  Line 192 
192  usage: svr_tree_to_html [options] < tree.newick > tree.html  usage: svr_tree_to_html [options] < tree.newick > tree.html
193    
194         -a   alias_file    - relabel tips using aliases        # file: [id alias]         -a   alias_file    - relabel tips using aliases        # file: [id alias]
195         -b   bold_list     - highlight a list of tips          # file: [id]         -b                 - show bootstrap/branch support values
196         -c   tax|role|file - color tips by taxonomy, roles,         -c   tax|role|file - color tips by taxonomy, roles,
197                              or groups specified in a file     # file: [id group]                              or groups specified in a file     # file: [id group]
198         -d   desc_file     - add description to each tip       # file: [id description]         -d   desc_file     - add description to each tip       # file: [id description]
199           -f   focus_list    - highlight a list of tips          # file: [id]
200         -l   link_file     - add URL to each tip               # file: [id URL]         -l   link_file     - add URL to each tip               # file: [id URL]
201           -lt  link_w_text   - add additional linked text        # file: [id text URL]
202         -m   popup_file    - add simple mouseover to each tip  # file: [id popup]         -m   popup_file    - add simple mouseover to each tip  # file: [id popup]
203         -nc  n_colors      - number of colors to use (D = 10)         -nc  n_colors      - number of colors to use (D = 10)
204         -p   g|s|file      - collapse trees by genus, species,         -p   g|s|file      - collapse trees by genus, species,
205                              or groups specified in a file     # file: [id group]                              or groups specified in a file     # file: [id group]
206           -s   show_list     - preferred tips to show when collapsing subtrees
207                                (D = Woese' list of 69 common organisms)
208         -t   title         - title for html page         -t   title         - title for html page
209           -x   min_dx        - minimum horizontal space between consecutive nodes (D = 1)
210           -y   dy            - vertical separation of consecutive tips (D = 1)
211         -anno              - use the annotator's SEED for URLs         -anno              - use the annotator's SEED for URLs
212         -gray n            - gray out name from the n-th word  # default: 2         -gray n            - gray out name from the n-th word  # default: 2
213         -pseed             - use PSEED         -pseed             - use PSEED
# Line 182  Line 216 
216    
217  End_of_Usage  End_of_Usage
218    
219  my ($help, $url, $alias_file, $bold_file, $collapse_by,  my ($help, $url, $alias_file, $focus_file, $branch, $collapse_by, $show_file,
220      $desc_file, $link_file, $popup_file, $id_file, $title,      $desc_file, $link_file, $text_link, $popup_file, $id_file, $title,
221      $ncolor, $color_by, $anno, $gray, $pseed, $raw);      $min_dx, $dy, $ncolor, $color_by, $anno, $gray, $pseed, $raw);
222    
223  GetOptions("h|help"         => \$help,  GetOptions("h|help"         => \$help,
224             "a|alias=s"      => \$alias_file,             "a|alias=s"      => \$alias_file,
225             "b|bold=s"       => \$bold_file,             "b|branch"       => \$branch,
226             "c|color=s"      => \$color_by,             "c|color=s"      => \$color_by,
227             "d|desc=s"       => \$desc_file,             "d|desc=s"       => \$desc_file,
228               "f|focus=s"      => \$focus_file,
229             "i|id=s"         => \$id_file,             "i|id=s"         => \$id_file,
230             "l|link=s"       => \$link_file,             "l|link=s"       => \$link_file,
231               "lt=s"           => \$text_link,
232             "m|popup=s"      => \$popup_file,             "m|popup=s"      => \$popup_file,
233             "nc=i"           => \$ncolor,             "nc=i"           => \$ncolor,
234             "p|collapse=s"   => \$collapse_by,             "p|collapse=s"   => \$collapse_by,
235               "s|show=s"       => \$show_file,
236             "t|title=s"      => \$title,             "t|title=s"      => \$title,
237               "x|dx=i"         => \$min_dx,
238               "y|dy=i"         => \$dy,
239             "anno"           => \$anno,             "anno"           => \$anno,
240             "g|gray=i"       => \$gray,             "g|gray=i"       => \$gray,
241             "pseed"          => \$pseed,             "pseed"          => \$pseed,
# Line 206  Line 245 
245    
246  my $opts;  my $opts;
247    
248    $opts->{show_branch}   = $branch;
249  $opts->{color_by}    = $color_by;  $opts->{color_by}    = $color_by;
250  $opts->{collapse_by} = $collapse_by;  $opts->{collapse_by} = $collapse_by;
251    $opts->{focus_set}     = ffxtree::read_set($focus_file)    if $focus_file    && -s $focus_file;
252  $opts->{alias}       = ffxtree::read_hash($alias_file)  if $alias_file  && -s $alias_file;  $opts->{alias}       = ffxtree::read_hash($alias_file)  if $alias_file  && -s $alias_file;
 $opts->{bold_set}    = ffxtree::read_set($bold_file)    if $bold_file   && -s $bold_file;  
253  $opts->{color_by}    = ffxtree::read_hash($color_by)    if $color_by    && -s $color_by;  $opts->{color_by}    = ffxtree::read_hash($color_by)    if $color_by    && -s $color_by;
254  $opts->{collapse_by} = ffxtree::read_hash($collapse_by) if $collapse_by && -s $collapse_by;  $opts->{collapse_by} = ffxtree::read_hash($collapse_by) if $collapse_by && -s $collapse_by;
255    $opts->{collapse_show} = ffxtree::read_set($show_file)     if $show_file     && -s $show_file;
256  $opts->{desc}        = ffxtree::read_hash($desc_file)   if $desc_file   && -s $desc_file;  $opts->{desc}        = ffxtree::read_hash($desc_file)   if $desc_file   && -s $desc_file;
257  $opts->{popup}       = ffxtree::read_hash($popup_file)  if $popup_file  && -s $popup_file;  $opts->{popup}       = ffxtree::read_hash($popup_file)  if $popup_file  && -s $popup_file;
258  $opts->{link}        = ffxtree::read_hash($link_file)   if $link_file   && -s $link_file;  $opts->{link}        = ffxtree::read_hash($link_file)   if $link_file   && -s $link_file;
259    $opts->{text_link}     = ffxtree::read_hash($text_link)    if $text_link     && -s $text_link;
260  $opts->{tree}        = ffxtree::read_tree();  $opts->{tree}        = ffxtree::read_tree();
261  $opts->{ncolor}      = $ncolor || 10;  $opts->{ncolor}      = $ncolor || 10;
 $opts->{title}       = $title;  
262  $opts->{gray}        = $gray || 2;  $opts->{gray}        = $gray || 2;
263    $opts->{min_dx}        = $min_dx || $branch ? 2 : 1;
264    $opts->{dy}            = $dy     || $branch ? 2 : 1;
265    $opts->{title}         = $title;
266  $opts->{anno}        = $anno;  $opts->{anno}        = $anno;
267  $opts->{raw}         = $raw;  $opts->{raw}         = $raw;
268    
269  $opts->{color_by}    ||= $raw ? 'none' : 'taxonomy';  $opts->{color_by}    ||= $raw ? 'none' : 'taxonomy';
270  $opts->{collapse_by} ||= $raw ? 'none' : 'genus';  $opts->{collapse_by} ||= $raw ? 'none' : 'genus';
271  $opts->{color_by}      = undef if $opts->{color_by}    =~ /none/i;  $opts->{collapse_show} ||= $raw ? 'none' : 'woese';
272  $opts->{collapse_by}   = undef if $opts->{collapse_by} =~ /none/i;  
273    $opts->{color_by}      = 0 if $opts->{color_by}    =~ /none/i;
274    $opts->{collapse_by}   = 0 if $opts->{collapse_by} =~ /none/i;
275    $opts->{collapse_show} = 0 if $show_file           =~ /(none|0)/i;
276    
277  my $envParm = $ENV{SAS_SERVER};  my $envParm = $ENV{SAS_SERVER};
278    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.7

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3