[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
Tue Apr 17 21:29:29 EDT 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.

Fix:
https://github.com/biopython/biopython/commit/a93c9892268274c4969131a1d401bb8ee235524a
----------------------------------------
Bug #3333: PhyloXML writer fails to include is_aligned attribute with mol_seq elements
https://redmine.open-bio.org/issues/3333

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


First reported here:
http://lists.open-bio.org/pipermail/biopython/2012-March/007847.html

Steps to reproduce:

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

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

3. Verify that the sequence information has been set -- mol_seq has is_aligned set
<pre>
print tree
</pre>

<pre>
Clade(branch_length=1.0, name='a')
    Sequence(type='dna')
        MolSeq(value='AAA', is_aligned=False)
</pre>

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

<pre>
...
<phy:clade>
  <phy:name>c</phy:name>
  <phy:branch_length>1.0</phy:branch_length>
  <phy:sequence type="dna">
    <phy:mol_seq>AAA</phy:mol_seq>
  </phy:sequence>
</phy:clade>
...
</pre>


-- 
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