class Object

Public Instance Methods

getTreeObjFromNwkString(nwk_str) click to toggle source
# File lib/bio/nwk.rb, line 188
def getTreeObjFromNwkString(nwk_str)
  nwk = Bio::Newick.new(nwk_str)
  tree = nwk.tree
  return(tree)
end
getTreeObjs(tree_file, num=1000000) click to toggle source
# File lib/bio/nwk.rb, line 174
def getTreeObjs(tree_file, num=1000000)
  trees = Array.new
  treeio = Bio::FlatFile.open(Bio::Newick, tree_file=='-' ? $stdin : tree_file)
  while newick = treeio.next_entry
    tree = newick.tree
    tree.options[:bootstrap_style] = :traditional
    next if tree.nodes.empty?
    trees << tree
    break if trees.size >= num
  end
  return(trees)
end