[Biopython] Bio.Phylo: writing newick trees with internal node names

Eric Talevich eric.talevich at gmail.com
Wed Apr 18 01:37:50 UTC 2012


On Thu, Mar 22, 2012 at 7:29 PM, Eric Talevich <eric.talevich at gmail.com> wrote:
> On Wed, Mar 21, 2012 at 6:12 AM, Tanya Golubchik
> <golubchi at stats.ox.ac.uk> wrote:
>> Also, the 'is_aligned' sequence property disappears when a tree is saved
>> in phyloxml format and then read back using Phylo.read:
>>
>>>>> print tree
>> Phylogeny(rooted=True, branch_length_unit='SNV')
>>    Clade(branch_length=0.0, name='N1')
>>        Clade(branch_length=0.0, name='C00000761')
>>            BranchColor(blue=0, green=128, red=0)
>>            Sequence(type='dna')
>>                MolSeq(value='CCTTTCTATGTTCTGGACTGACGTTAAACGA',
>> is_aligned=True)
>>        Clade(branch_length=0.0, name='C00000763')
>>            BranchColor(blue=0, green=0, red=255)
>>            Sequence(type='dna')
>>                MolSeq(value='CCTTTcTATGTtCTGGACTGACGTTAAACGA',
>> is_aligned=True)
>>
>>>>> Phylo.write(tree, myfile, 'phyloxml')
>> 1
>>>>> tree2 = Phylo.read(myfile, 'phyloxml')
>>>>> print tree2
>> Phylogeny(rooted=True, branch_length_unit='SNV')
>>    Clade(branch_length=0.0, name='N1')
>>        Clade(branch_length=0.0, name='C00000761')
>>            BranchColor(blue=0, green=128, red=0)
>>            Sequence(type='dna')
>>                MolSeq(value='CCTTTCTATGTTCTGGACTGACGTTAAACGA')
>>        Clade(branch_length=0.0, name='C00000763')
>>            BranchColor(blue=0, green=0, red=255)
>>            Sequence(type='dna')
>>                MolSeq(value='CCTTTcTATGTtCTGGACTGACGTTAAACGA')
>>
>
> This looks like a bug, too. (Thanks for finding these!) I don't
> immediately see the cause of the problem, I'll try to take a crack at
> it soon.

I finally had a chance to look at this again. It's fixed in the trunk,
so if you're working off the development build of Biopython from
GitHub, the is_aligned property should be written properly now.




More information about the Biopython mailing list