[Biopython-dev] [Biopython - Bug #3333] PhyloXML writer fails to include is_aligned attribute with mol_seq elements

redmine at redmine.open-bio.org redmine at redmine.open-bio.org
Wed Apr 18 01:29:29 UTC 2012

Issue #3333 has been updated by Eric Talevich.

The answer is: I'm an idiot. The mol_seq attribute was first defined as a complex attribute in the writer (via _handle_complex), but then further down redefined as a simple attribute.

Bug #3333: PhyloXML writer fails to include is_aligned attribute with mol_seq elements

Author: Eric Talevich
Status: New
Priority: Normal
Assignee: Biopython Dev Mailing List
Category: Main Distribution
Target version: 

First reported here:

Steps to reproduce:

1. Load a tree, convert to PhyloXML
from Bio import Phylo
from StringIO import StringIO
tree = Phylo.read(StringIO('(a,(b,c));'), 'newick').as_phyloxml()

2. Add a sequence
from Bio.Phylo import PhyloXML as PX
tree.clade[0].sequences = [PX.Sequence(type='dna', mol_seq=PX.MolSeq('AAA', is_aligned=False))]

3. Verify that the sequence information has been set -- mol_seq has is_aligned set
print tree

Clade(branch_length=1.0, name='a')
        MolSeq(value='AAA', is_aligned=False)

4. View the PhyloXML representation -- mol_seq is missing the is_aligned attribute!
print tree.format('phyloxml')

  <phy:sequence type="dna">

You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here and login: http://redmine.open-bio.org

More information about the Biopython-dev mailing list