[Bioperl-l] Bio::Taxonomy::Tree

Qiang TU tuqiang at mail.shcnc.ac.cn
Fri Apr 4 23:05:34 EST 2003


Hi Heikki,

Yes, those strange characters may cause trouble. Besides, another problem
is single branch at several levels may cause many brackets, e.g. (((a,b)),c); 
and these continuous brackets are illegal for the draw tree softwares. So, I 
add a condition in the sub _write_tree_Helper in newick.pm to prevent 
outputting these extra nodes:

209,211c209,213
<       $data[0] = "(" . $data[0];
<       $data[-1] .= ")";
<       $data[-1] .= ":". $node->branch_length if( $node->branch_length);
---
>       if (scalar($node->each_Descendent()) > 1) {
>           $data[0] = "(" . $data[0];
>           $data[-1] .= ")";
>           $data[-1] .= ":". $node->branch_length if( $node->branch_length);
>       }


Now it works for my problem. But I am not sure if it is a right way to draw 
trees. Or maybe we can add an option to let user to choice?

Thanks.

Qiang Tu

BTW: I am using bioperl 1.2.

---Original Message---
From: Heikki Lehvaslaiho<heikki at ebi.ac.uk>
Subject: Re: [Bioperl-l] Bio::Taxonomy::Tree
 
>Quing Tu,
>
>I found this from
>http://evolution.genetics.washington.edu/phylip/newicktree.html :
>
>"A name can be any string of printable characters except blanks,
> colons, semicolons, parentheses, and square brackets.
>
> Because you may want to include a blank in a name, it is assumed that
> an underscore character ("_") stands for a blank; any of these in a
> name will be converted to a blank when it is read in."
>
>
>I am adding the conversion into Bio::Tree::Node::id.
>The method will print a warning, too, if $node->verbose >=0
>
>Check the CVS after a while.
>
>	-Heikki
>
>On Thu, 2003-04-03 at 17:02, Heikki Lehvaslaiho wrote:
>> Your tree looks OK. I did not try to it with any program, so this is
>> just a wild guess, but try removing spaces from the tree and try again.
>> 
>> 	-Heikki
>> 
>> 
>> 
>> On Thu, 2003-04-03 at 14:02, Qiang Tu wrote:
>> > Hello all,
>> > 
>> > I want to build a taxonomy tree of the complete genomes. In the program I 
>> > built a Bio::Taxonomy::Taxon object at first, then use 'set_root_node' method
>> > to built a Bio::Taxonomy::Tree objxect by the taxon, then write the tree to a file 
>> > by Bio::TreeIO object. The 'tabtree' method works, but the output files of 
>> > 'newick' and 'nhx' methods can not be opened by other draw-tree software, 
>> > such as treeview. The error message is: Extra pair of parentheses "()".
>> > The tree file is attached.
>> > 
>> > Has anyone ever made such a taxonomy tree? Could you give me some samples
>> > so that I can find out the solution of my problem? Thanks. 
>> >  
>> > Qiang Tu
>> > Institute of Biochemistry and Cell Biology
>> > Chinese Academy of Sciences
>> > 
>> > ______________________________________________________________________
>> > 
>> > _______________________________________________
>> > Bioperl-l mailing list
>> > Bioperl-l at bioperl.org
>> > http://bioperl.org/mailman/listinfo/bioperl-l
>-- 
>______ _/      _/_____________________________________________________
>      _/      _/                      http://www.ebi.ac.uk/mutations/
>     _/  _/  _/  Heikki Lehvaslaiho          heikki at ebi.ac.uk
>    _/_/_/_/_/  EMBL Outstation, European Bioinformatics Institute
>   _/  _/  _/  Wellcome Trust Genome Campus, Hinxton
>  _/  _/  _/  Cambs. CB10 1SD, United Kingdom
>     _/      Phone: +44 (0)1223 494 644   FAX: +44 (0)1223 494 468
>___ _/_/_/_/_/________________________________________________________
>
>

 
---End of Message---

 
Qiang Tu
Institute of Biochemistry and Cell Biology
Chinese Academy of Sciences
Email: tuqiang at mail.shcnc.ac.cn, tuqiang_cn at yahoo.com
  



More information about the Bioperl-l mailing list