class Bio::PhyloXML::BranchColor
Description¶ ↑
This indicates the color of a node when rendered (the color applies to the whole node and its children unless overwritten by the color(s) of sub clades).
Attributes
blue[R]
Integer
green[R]
Integer
red[R]
Integer
Public Instance Methods
blue=(str)
click to toggle source
# File lib/bio-phyloxml/phyloxml_elements.rb 760 def blue=(str) 761 @blue = str.to_i 762 end
green=(str)
click to toggle source
# File lib/bio-phyloxml/phyloxml_elements.rb 756 def green=(str) 757 @green = str.to_i 758 end
red=(str)
click to toggle source
# File lib/bio-phyloxml/phyloxml_elements.rb 752 def red=(str) 753 @red = str.to_i 754 end
to_xml()
click to toggle source
Converts elements to xml representation. Called by PhyloXML::Writer
class.
# File lib/bio-phyloxml/phyloxml_elements.rb 765 def to_xml 766 #@todo add unit test 767 if @red == nil 768 raise "Subelement red of BranchColor element should not be nil" 769 elsif @green == nil 770 raise "Subelement green of BranchColor element should not be nil" 771 elsif @blue == nil 772 raise "Subelement blue of BranchColor element should not be nil" 773 end 774 775 c = LibXML::XML::Node.new('branch_color') 776 PhyloXML::Writer.generate_xml(c, self, [ 777 [:simple, 'red', @red], 778 [:simple, 'green', @green], 779 [:simple, 'blue', @blue]]) 780 return c 781 end