Skip to content

Commit

Permalink
deploy: ff6767d
Browse files Browse the repository at this point in the history
  • Loading branch information
jordibc committed May 31, 2024
1 parent 75a9cf7 commit 191431d
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 149 deletions.
137 changes: 79 additions & 58 deletions _modules/ete4/gtdb_taxonomy/gtdbquery.html

Large diffs are not rendered by default.

18 changes: 11 additions & 7 deletions _modules/ete4/ncbi_taxonomy/ncbiquery.html
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ <h1>Source code for ete4.ncbi_taxonomy.ncbiquery</h1><div class="highlight"><pre
<div class="viewcode-block" id="NCBITaxa.annotate_tree">
<a class="viewcode-back" href="../../../reference/reference_taxonomy.html#ete4.NCBITaxa.annotate_tree">[docs]</a>
<span class="k">def</span> <span class="nf">annotate_tree</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">t</span><span class="p">,</span> <span class="n">taxid_attr</span><span class="o">=</span><span class="s2">&quot;name&quot;</span><span class="p">,</span> <span class="n">tax2name</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">tax2track</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">tax2rank</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="n">tax2track</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">tax2rank</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">ignore_unclassified</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Annotate a tree containing taxids as leaf names.</span>

<span class="sd"> The annotation adds the properties: &#39;taxid&#39;, &#39;sci_name&#39;,</span>
Expand Down Expand Up @@ -595,14 +595,18 @@ <h1>Source code for ete4.ncbi_taxonomy.ncbiquery</h1><div class="highlight"><pre
<span class="n">rank</span> <span class="o">=</span> <span class="s1">&#39;Unknown&#39;</span><span class="p">,</span>
<span class="n">named_lineage</span> <span class="o">=</span> <span class="p">[])</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">lineage</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_common_lineage</span><span class="p">([</span><span class="n">lf</span><span class="o">.</span><span class="n">props</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;lineage&#39;</span><span class="p">)</span> <span class="k">for</span> <span class="n">lf</span> <span class="ow">in</span> <span class="n">n2leaves</span><span class="p">[</span><span class="n">n</span><span class="p">]])</span>
<span class="k">if</span> <span class="n">ignore_unclassified</span><span class="p">:</span>
<span class="n">vectors</span> <span class="o">=</span> <span class="p">[</span><span class="n">lf</span><span class="o">.</span><span class="n">props</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;lineage&#39;</span><span class="p">)</span> <span class="k">for</span> <span class="n">lf</span> <span class="ow">in</span> <span class="n">n2leaves</span><span class="p">[</span><span class="n">n</span><span class="p">]</span> <span class="k">if</span> <span class="n">lf</span><span class="o">.</span><span class="n">props</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;lineage&#39;</span><span class="p">)]</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">vectors</span> <span class="o">=</span> <span class="p">[</span><span class="n">lf</span><span class="o">.</span><span class="n">props</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;lineage&#39;</span><span class="p">)</span> <span class="k">for</span> <span class="n">lf</span> <span class="ow">in</span> <span class="n">n2leaves</span><span class="p">[</span><span class="n">n</span><span class="p">]]</span>
<span class="n">lineage</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_common_lineage</span><span class="p">(</span><span class="n">vectors</span><span class="p">)</span>
<span class="n">ancestor</span> <span class="o">=</span> <span class="n">lineage</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
<span class="n">n</span><span class="o">.</span><span class="n">add_props</span><span class="p">(</span><span class="n">sci_name</span> <span class="o">=</span> <span class="n">tax2name</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">ancestor</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">ancestor</span><span class="p">)),</span>
<span class="n">common_name</span> <span class="o">=</span> <span class="n">tax2common_name</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">ancestor</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">),</span>
<span class="n">taxid</span> <span class="o">=</span> <span class="n">ancestor</span><span class="p">,</span>
<span class="n">lineage</span> <span class="o">=</span> <span class="n">lineage</span><span class="p">,</span>
<span class="n">rank</span> <span class="o">=</span> <span class="n">tax2rank</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">ancestor</span><span class="p">,</span> <span class="s1">&#39;Unknown&#39;</span><span class="p">),</span>
<span class="n">named_lineage</span> <span class="o">=</span> <span class="p">[</span><span class="n">tax2name</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">tax</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">tax</span><span class="p">))</span> <span class="k">for</span> <span class="n">tax</span> <span class="ow">in</span> <span class="n">lineage</span><span class="p">])</span>
<span class="n">common_name</span> <span class="o">=</span> <span class="n">tax2common_name</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">ancestor</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">),</span>
<span class="n">taxid</span> <span class="o">=</span> <span class="n">ancestor</span><span class="p">,</span>
<span class="n">lineage</span> <span class="o">=</span> <span class="n">lineage</span><span class="p">,</span>
<span class="n">rank</span> <span class="o">=</span> <span class="n">tax2rank</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">ancestor</span><span class="p">,</span> <span class="s1">&#39;Unknown&#39;</span><span class="p">),</span>
<span class="n">named_lineage</span> <span class="o">=</span> <span class="p">[</span><span class="n">tax2name</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">tax</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">tax</span><span class="p">))</span> <span class="k">for</span> <span class="n">tax</span> <span class="ow">in</span> <span class="n">lineage</span><span class="p">])</span>

<span class="k">return</span> <span class="n">tax2name</span><span class="p">,</span> <span class="n">tax2track</span><span class="p">,</span> <span class="n">tax2rank</span></div>

Expand Down
8 changes: 4 additions & 4 deletions _modules/ete4/phylo/phylotree.html
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ <h1>Source code for ete4.phylo.phylotree</h1><div class="highlight"><pre>

<div class="viewcode-block" id="PhyloTree.annotate_ncbi_taxa">
<a class="viewcode-back" href="../../../reference/reference_phylo.html#ete4.PhyloTree.annotate_ncbi_taxa">[docs]</a>
<span class="k">def</span> <span class="nf">annotate_ncbi_taxa</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">taxid_attr</span><span class="o">=</span><span class="s1">&#39;species&#39;</span><span class="p">,</span> <span class="n">tax2name</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">tax2track</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">tax2rank</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dbfile</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">annotate_ncbi_taxa</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">taxid_attr</span><span class="o">=</span><span class="s1">&#39;species&#39;</span><span class="p">,</span> <span class="n">tax2name</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">tax2track</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">tax2rank</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dbfile</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">ignore_unclassified</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Add NCBI taxonomy annotation to all descendant nodes. Leaf nodes are</span>
<span class="sd"> expected to contain a feature (name, by default) encoding a valid taxid</span>
<span class="sd"> number.</span>
Expand Down Expand Up @@ -780,14 +780,14 @@ <h1>Source code for ete4.phylo.phylotree</h1><div class="highlight"><pre>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="n">ncbi</span> <span class="o">=</span> <span class="n">NCBITaxa</span><span class="p">(</span><span class="n">dbfile</span><span class="o">=</span><span class="n">dbfile</span><span class="p">)</span>
<span class="k">return</span> <span class="n">ncbi</span><span class="o">.</span><span class="n">annotate_tree</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">taxid_attr</span><span class="o">=</span><span class="n">taxid_attr</span><span class="p">,</span> <span class="n">tax2name</span><span class="o">=</span><span class="n">tax2name</span><span class="p">,</span> <span class="n">tax2track</span><span class="o">=</span><span class="n">tax2track</span><span class="p">,</span> <span class="n">tax2rank</span><span class="o">=</span><span class="n">tax2rank</span><span class="p">)</span></div>
<span class="k">return</span> <span class="n">ncbi</span><span class="o">.</span><span class="n">annotate_tree</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">taxid_attr</span><span class="o">=</span><span class="n">taxid_attr</span><span class="p">,</span> <span class="n">tax2name</span><span class="o">=</span><span class="n">tax2name</span><span class="p">,</span> <span class="n">tax2track</span><span class="o">=</span><span class="n">tax2track</span><span class="p">,</span> <span class="n">tax2rank</span><span class="o">=</span><span class="n">tax2rank</span><span class="p">,</span> <span class="n">ignore_unclassified</span><span class="o">=</span><span class="n">ignore_unclassified</span><span class="p">)</span></div>


<div class="viewcode-block" id="PhyloTree.annotate_gtdb_taxa">
<a class="viewcode-back" href="../../../reference/reference_phylo.html#ete4.PhyloTree.annotate_gtdb_taxa">[docs]</a>
<span class="k">def</span> <span class="nf">annotate_gtdb_taxa</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">taxid_attr</span><span class="o">=</span><span class="s1">&#39;species&#39;</span><span class="p">,</span> <span class="n">tax2name</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">tax2track</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">tax2rank</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dbfile</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">annotate_gtdb_taxa</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">taxid_attr</span><span class="o">=</span><span class="s1">&#39;species&#39;</span><span class="p">,</span> <span class="n">tax2name</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">tax2track</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">tax2rank</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dbfile</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">ignore_unclassified</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="n">gtdb</span> <span class="o">=</span> <span class="n">GTDBTaxa</span><span class="p">(</span><span class="n">dbfile</span><span class="o">=</span><span class="n">dbfile</span><span class="p">)</span>
<span class="k">return</span> <span class="n">gtdb</span><span class="o">.</span><span class="n">annotate_tree</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">taxid_attr</span><span class="o">=</span><span class="n">taxid_attr</span><span class="p">,</span> <span class="n">tax2name</span><span class="o">=</span><span class="n">tax2name</span><span class="p">,</span> <span class="n">tax2track</span><span class="o">=</span><span class="n">tax2track</span><span class="p">,</span> <span class="n">tax2rank</span><span class="o">=</span><span class="n">tax2rank</span><span class="p">)</span></div>
<span class="k">return</span> <span class="n">gtdb</span><span class="o">.</span><span class="n">annotate_tree</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">taxid_attr</span><span class="o">=</span><span class="n">taxid_attr</span><span class="p">,</span> <span class="n">tax2name</span><span class="o">=</span><span class="n">tax2name</span><span class="p">,</span> <span class="n">tax2track</span><span class="o">=</span><span class="n">tax2track</span><span class="p">,</span> <span class="n">tax2rank</span><span class="o">=</span><span class="n">tax2rank</span><span class="p">,</span> <span class="n">ignore_unclassified</span><span class="o">=</span><span class="n">ignore_unclassified</span><span class="p">)</span></div>


<div class="viewcode-block" id="PhyloTree.ncbi_compare">
Expand Down
32 changes: 6 additions & 26 deletions genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -926,20 +926,12 @@ <h2 id="G">G</h2>
</li>
<li><a href="reference/reference_smartview.html#ete4.smartview.renderer.draw_helpers.get_line_type">get_line_type() (in module ete4.smartview.renderer.draw_helpers)</a>
</li>
<li><a href="reference/reference_taxonomy.html#ete4.GTDBTaxa.get_lineage">get_lineage() (GTDBTaxa method)</a>

<ul>
<li><a href="reference/reference_taxonomy.html#ete4.NCBITaxa.get_lineage">(NCBITaxa method)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="reference/reference_taxonomy.html#ete4.GTDBTaxa.get_lineage_translator">get_lineage_translator() (GTDBTaxa method)</a>

<ul>
<li><a href="reference/reference_taxonomy.html#ete4.NCBITaxa.get_lineage_translator">(NCBITaxa method)</a>
<li><a href="reference/reference_taxonomy.html#ete4.NCBITaxa.get_lineage">get_lineage() (NCBITaxa method)</a>
</li>
<li><a href="reference/reference_taxonomy.html#ete4.NCBITaxa.get_lineage_translator">get_lineage_translator() (NCBITaxa method)</a>
</li>
</ul></li>
<li><a href="reference/reference_tree.html#ete4.Tree.get_midpoint_outgroup">get_midpoint_outgroup() (Tree method)</a>
</li>
<li><a href="reference/reference_tree.html#ete4.Tree.get_monophyletic">get_monophyletic() (Tree method)</a>
Expand All @@ -948,12 +940,8 @@ <h2 id="G">G</h2>
</li>
<li><a href="reference/reference_taxonomy.html#ete4.GTDBTaxa.get_name_lineage">get_name_lineage() (GTDBTaxa method)</a>
</li>
<li><a href="reference/reference_taxonomy.html#ete4.GTDBTaxa.get_name_translator">get_name_translator() (GTDBTaxa method)</a>

<ul>
<li><a href="reference/reference_taxonomy.html#ete4.NCBITaxa.get_name_translator">(NCBITaxa method)</a>
<li><a href="reference/reference_taxonomy.html#ete4.NCBITaxa.get_name_translator">get_name_translator() (NCBITaxa method)</a>
</li>
</ul></li>
<li><a href="reference/reference_smartview.html#ete4.smartview.gui.server.get_newick">get_newick() (in module ete4.smartview.gui.server)</a>
</li>
<li><a href="reference/reference_smartview.html#ete4.smartview.gui.server.get_next_available_port">get_next_available_port() (in module ete4.smartview.gui.server)</a>
Expand Down Expand Up @@ -1010,12 +998,8 @@ <h2 id="G">G</h2>
</li>
<li><a href="reference/reference_smartview.html#ete4.smartview.gui.server.get_stats">get_stats() (in module ete4.smartview.gui.server)</a>
</li>
<li><a href="reference/reference_taxonomy.html#ete4.GTDBTaxa.get_taxid_translator">get_taxid_translator() (GTDBTaxa method)</a>

<ul>
<li><a href="reference/reference_taxonomy.html#ete4.NCBITaxa.get_taxid_translator">(NCBITaxa method)</a>
<li><a href="reference/reference_taxonomy.html#ete4.NCBITaxa.get_taxid_translator">get_taxid_translator() (NCBITaxa method)</a>
</li>
</ul></li>
<li><a href="reference/reference_smartview.html#ete4.smartview.gui.server.get_tid">get_tid() (in module ete4.smartview.gui.server)</a>
</li>
<li><a href="reference/reference_smartview.html#ete4.smartview.renderer.layouts.context_layouts.LayoutGenomicContext.get_tooltip">get_tooltip() (LayoutGenomicContext method)</a>
Expand Down Expand Up @@ -1739,12 +1723,8 @@ <h2 id="T">T</h2>
</ul></li>
<li><a href="reference/reference_smartview.html#ete4.smartview.gui.server.touch_and_get">touch_and_get() (in module ete4.smartview.gui.server)</a>
</li>
<li><a href="reference/reference_taxonomy.html#ete4.GTDBTaxa.translate_to_names">translate_to_names() (GTDBTaxa method)</a>

<ul>
<li><a href="reference/reference_taxonomy.html#ete4.NCBITaxa.translate_to_names">(NCBITaxa method)</a>
<li><a href="reference/reference_taxonomy.html#ete4.NCBITaxa.translate_to_names">translate_to_names() (NCBITaxa method)</a>
</li>
</ul></li>
<li><a href="reference/reference_operations.html#ete4.core.operations.traverse">traverse() (in module ete4.core.operations)</a>

<ul>
Expand Down
Binary file modified objects.inv
Binary file not shown.
Loading

0 comments on commit 191431d

Please sign in to comment.