<div dir="ltr"><div><div class="gmail_extra"><div class="gmail_quote">On Tue, Oct 7, 2014 at 8:34 AM, Tiago Antao <span dir="ltr">&lt;<a href="mailto:tra@popgen.net" target="_blank">tra@popgen.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
Sorry for the convoluted email, but the 3 topics of Bio.Phylo, Python 3<br>
and Notebooks are related.<br>
<br>
So, Biopython currently does not support Python3 completely because of<br>
Bio.Phylo dependency on networkx, which itself depends on either<br>
pygraphviz or pydot. Neither of which supports Python3. The pygraphviz<br>
version on github (not released) currently supports Python3 and it is<br>
good enough to at least run the cookbook. I am going to contact the<br>
pygraphviz developers with an encouragement to release whenever<br>
possible. So, that problem is probably be solved soon.<br>
<br>
I am trying to wrap up the notebook of Bio.Phylo (which is a copy of<br>
the chapter cookbook with a few adaptations). I have stumbled on a few<br>
problems. This will be used for reference:<br>
<br>
<br>
<a href="http://nbviewer.ipython.org/github/tiagoantao/biopython-notebook/blob/master/notebooks/13%20-%20Phylogenetics%20with%20Bio.Phylo.ipynb" target="_blank">http://nbviewer.ipython.org/github/tiagoantao/biopython-notebook/blob/master/notebooks/13%20-%20Phylogenetics%20with%20Bio.Phylo.ipynb</a><br>
<br></blockquote><div><br></div><div>Hi Tiago,<br><br></div><div>First off, I love this idea of converting the tutorial chapter/demo into a notebook. Thanks for doing this.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
1. Input 13 on the notebook above: There seems to be a Python3 problem<br>
(the typical str/bytes issue)? Potential P3 bug?<br></blockquote><div><br></div><div>I suppose so. ElementTree compatibility with Python 3 strings/bytes has always been weird. It might be as simple as a hard-coded version flag that was only needed for Py3.1-3.3.<br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

2. 14: Do you know where I can find the file other_trees.xml ? Could<br>
not find it<br></blockquote><div><br></div><div>As Peter noted, that file is generated in the previous steps:<br>1. Parse data/phyloxml_examples.xml;<br>2. Write the first tree in that iterator to tree1.xml;<br>3. Write the remaining trees in the iterator to other_trees.xml.<br><br></div><div>Does IPython Notebook allow files to persist like that? If not, maybe a StringIO object could take the place of the file outputs for this demo.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

3. 15: The same from tree1.dnd<br></blockquote><div><br></div><div>I don&#39;t see any line that generates that file, so maybe it was edited out at some point. You could replace Line 15 with:<br><br><pre><span>Phylo</span><span>.</span><span>convert</span><span>(</span><span>&quot;data/tree1.xml&quot;</span><span>,</span> <span>&quot;phyloxml&quot;</span><span>,</span> <span>&quot;data/tree1.nexml&quot;</span><span>,</span> <span>&quot;nexml&quot;</span><span>)</span><br> <br></pre>Or:<br><br><pre><span>Phylo</span><span>.</span><span>convert</span><span>(</span><span>&quot;data/int_node_labels.nwk&quot;</span><span>,</span> <span>&quot;newick&quot;</span><span>,</span> <span>&quot;data/tree1.nexml&quot;</span><span>,</span> <span>&quot;nexml&quot;</span><span>)</span><br></pre> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

4. 42: It seems that paml is not generating a &#39;lnL max&#39; (just see the<br>
full dictionary appended there)? Potential cookbook bug?<br></blockquote><div><br></div><div>Dunno. PAML versions vary in their output. Which version are you using?<br><br></div><div>Cheers,<br>Eric<br></div></div></div></div></div>