尽管这个问题与“BioPerl”有关,但我相信这个问题可能比这更笼统。
基本上我已经生成了一个Bio::Tree::TreeI对象,我正在尝试将其转换为字符串变量。
我可以接近将其转换为字符串变量的唯一方法是使用以下命令将该树写入流:
# a $tree = Bio::Tree::TreeI->new() (which I know is an actual tree as it prints to the terminal console)
my $treeOut = Bio::TreeIO->new(-format => 'newick')
$treeOut->write_tree($tree)
->write_tree 的输出是“将树写入流”,但是我如何在字符串变量中捕获它,因为我找不到从Bio::TreeIO中的任何函数返回字符串的另一种方法