[BioRuby-cvs] bioruby/lib/bio phylogenetictree.rb,1.1,1.2

Naohisa Goto ngoto at dev.open-bio.org
Wed Dec 13 15:46:30 UTC 2006


Update of /home/repository/bioruby/bioruby/lib/bio
In directory dev.open-bio.org:/tmp/cvs-serv8064

Modified Files:
	phylogenetictree.rb 
Log Message:


NHX (New Hampshire eXtended) input is supported by Bio::Newick class.
Bio::PhylogeneticTree supports NHX output (as a string) by #output(:NHX).

When outputs tree, indention can be specified by options.

Many attributes are added to support Bio::PhylogeneticTree::Node and 
Bio::PhylogeneticTree::Edge.

Node order in original Newick data is stored to 
Bio::PhylogeneticTree::Node#order_number.


Index: phylogenetictree.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/phylogenetictree.rb,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** phylogenetictree.rb	5 Oct 2006 13:38:21 -0000	1.1
--- phylogenetictree.rb	13 Dec 2006 15:46:28 -0000	1.2
***************
*** 74,77 ****
--- 74,101 ----
          @distance_string.to_s
        end
+ 
+       #---
+       # methods for NHX (New Hampshire eXtended) and/or PhyloXML
+       #+++
+ 
+       # log likelihood value (:L in NHX)
+       attr_accessor :log_likelihood
+ 
+       # width of the edge
+       # (<branch width="w"> of PhyloXML, or :W="w" in NHX)
+       attr_accessor :width
+ 
+       # Other NHX parameters. Returns a Hash.
+       # Note that :L and :W
+       # are not stored here but stored in the proper attributes in this class.
+       # However, if you force to set these parameters in this hash,
+       # the parameters in this hash are preferred when generating NHX.
+       # In addition, If the same parameters are defined at Node object,
+       # the parameters in the node are preferred.
+       def nhx_parameters
+         @nhx_parameters ||= {}
+         @nhx_parameters
+       end
+ 
      end #class Edge
  
***************
*** 165,168 ****
--- 189,229 ----
          @name.to_s
        end
+ 
+       # the order of the node
+       # (lower value, high priority)
+       attr_accessor :order_number
+ 
+       #---
+       # methods for NHX (New Hampshire eXtended) and/or PhyloXML
+       #+++
+ 
+       # Phylogenetic events.
+       # Returns an Array of one (or more?) of the following symbols
+       #   :gene_duplication
+       #   :speciation
+       def events
+         @events ||= []
+         @events
+       end
+ 
+       # EC number (EC_number in PhyloXML, or :E in NHX)
+       attr_accessor :ec_number
+ 
+       # scientific name (scientific_name in PhyloXML, or :S in NHX)
+       attr_accessor :scientific_name
+ 
+       # taxonomy identifier (taxonomy_identifier in PhyloXML, or :T in NHX)
+       attr_accessor :taxonomy_id
+ 
+       # Other NHX parameters. Returns a Hash.
+       # Note that :D, :E, :S, and :T
+       # are not stored here but stored in the proper attributes in this class.
+       # However, if you force to set these parameters in this hash,
+       # the parameters in this hash are preferred when generating NHX.
+       def nhx_parameters
+         @nhx_parameters ||= {}
+         @nhx_parameters
+       end
+ 
      end #class Node
  




More information about the bioruby-cvs mailing list