Skip to content

Commit

Permalink
fix names
Browse files Browse the repository at this point in the history
  • Loading branch information
pirovc committed Mar 28, 2021
1 parent 9164e6c commit e53e7f7
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 46 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Python library that provides a common interface to obtain, parse and interact wi

### conda

conda install multitax
conda install -c bioconda multitax

### local

Expand Down Expand Up @@ -91,7 +91,7 @@ tax.rank_lineage("g__Escherichia")
tax.lineage("g__Escherichia", root_node="p__Proteobacteria", ranks=["phylum", "class", "family", "genus"])
# ['p__Proteobacteria', 'c__Gammaproteobacteria', 'f__Enterobacteriaceae', 'g__Escherichia']

# Pre-build lineages in memory for faster access
# Build lineages in memory for faster access
tax.build_lineages()

# Get leaf nodes
Expand Down
30 changes: 15 additions & 15 deletions docs/multitax.html
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,9 @@ <h5>Inherited Members</h5>
<li><strong>undefined_node</strong> <em>[str]</em>: Define a default return value for undefined nodes</li>
<li><strong>undefined_name</strong> <em>[str]</em>: Define a default return value for undefined names</li>
<li><strong>undefined_rank</strong> <em>[str]</em>: Define a default return value for undefined ranks</li>
<li><strong>build_node_children</strong> <em>[bool]</em>: Pre-build node,children dict (otherwise it will be created on first use)</li>
<li><strong>build_name_nodes</strong> <em>[bool]</em>: Pre-build name,nodes dict (otherwise it will be created on first use)</li>
<li><strong>build_rank_nodes</strong> <em>[bool]</em>: Pre-build rank,nodes dict (otherwise it will be created on first use)</li>
<li><strong>build_node_children</strong> <em>[bool]</em>: Build node,children dict (otherwise it will be created on first use)</li>
<li><strong>build_name_nodes</strong> <em>[bool]</em>: Build name,nodes dict (otherwise it will be created on first use)</li>
<li><strong>build_rank_nodes</strong> <em>[bool]</em>: Build rank,nodes dict (otherwise it will be created on first use)</li>
</ul>

<p>Example:</p>
Expand Down Expand Up @@ -639,9 +639,9 @@ <h5>Inherited Members</h5>
<li><strong>undefined_node</strong> <em>[str]</em>: Define a default return value for undefined nodes</li>
<li><strong>undefined_name</strong> <em>[str]</em>: Define a default return value for undefined names</li>
<li><strong>undefined_rank</strong> <em>[str]</em>: Define a default return value for undefined ranks</li>
<li><strong>build_node_children</strong> <em>[bool]</em>: Pre-build node,children dict (otherwise it will be created on first use)</li>
<li><strong>build_name_nodes</strong> <em>[bool]</em>: Pre-build name,nodes dict (otherwise it will be created on first use)</li>
<li><strong>build_rank_nodes</strong> <em>[bool]</em>: Pre-build rank,nodes dict (otherwise it will be created on first use)</li>
<li><strong>build_node_children</strong> <em>[bool]</em>: Build node,children dict (otherwise it will be created on first use)</li>
<li><strong>build_name_nodes</strong> <em>[bool]</em>: Build name,nodes dict (otherwise it will be created on first use)</li>
<li><strong>build_rank_nodes</strong> <em>[bool]</em>: Build rank,nodes dict (otherwise it will be created on first use)</li>
</ul>

<p>Example:</p>
Expand Down Expand Up @@ -826,9 +826,9 @@ <h5>Inherited Members</h5>
<li><strong>undefined_node</strong> <em>[str]</em>: Define a default return value for undefined nodes</li>
<li><strong>undefined_name</strong> <em>[str]</em>: Define a default return value for undefined names</li>
<li><strong>undefined_rank</strong> <em>[str]</em>: Define a default return value for undefined ranks</li>
<li><strong>build_node_children</strong> <em>[bool]</em>: Pre-build node,children dict (otherwise it will be created on first use)</li>
<li><strong>build_name_nodes</strong> <em>[bool]</em>: Pre-build name,nodes dict (otherwise it will be created on first use)</li>
<li><strong>build_rank_nodes</strong> <em>[bool]</em>: Pre-build rank,nodes dict (otherwise it will be created on first use)</li>
<li><strong>build_node_children</strong> <em>[bool]</em>: Build node,children dict (otherwise it will be created on first use)</li>
<li><strong>build_name_nodes</strong> <em>[bool]</em>: Build name,nodes dict (otherwise it will be created on first use)</li>
<li><strong>build_rank_nodes</strong> <em>[bool]</em>: Build rank,nodes dict (otherwise it will be created on first use)</li>
</ul>

<p>Example:</p>
Expand Down Expand Up @@ -1102,9 +1102,9 @@ <h5>Inherited Members</h5>
<li><strong>undefined_node</strong> <em>[str]</em>: Define a default return value for undefined nodes</li>
<li><strong>undefined_name</strong> <em>[str]</em>: Define a default return value for undefined names</li>
<li><strong>undefined_rank</strong> <em>[str]</em>: Define a default return value for undefined ranks</li>
<li><strong>build_node_children</strong> <em>[bool]</em>: Pre-build node,children dict (otherwise it will be created on first use)</li>
<li><strong>build_name_nodes</strong> <em>[bool]</em>: Pre-build name,nodes dict (otherwise it will be created on first use)</li>
<li><strong>build_rank_nodes</strong> <em>[bool]</em>: Pre-build rank,nodes dict (otherwise it will be created on first use)</li>
<li><strong>build_node_children</strong> <em>[bool]</em>: Build node,children dict (otherwise it will be created on first use)</li>
<li><strong>build_name_nodes</strong> <em>[bool]</em>: Build name,nodes dict (otherwise it will be created on first use)</li>
<li><strong>build_rank_nodes</strong> <em>[bool]</em>: Build rank,nodes dict (otherwise it will be created on first use)</li>
</ul>

<p>Example:</p>
Expand Down Expand Up @@ -1335,9 +1335,9 @@ <h5>Inherited Members</h5>
<li><strong>undefined_node</strong> <em>[str]</em>: Define a default return value for undefined nodes</li>
<li><strong>undefined_name</strong> <em>[str]</em>: Define a default return value for undefined names</li>
<li><strong>undefined_rank</strong> <em>[str]</em>: Define a default return value for undefined ranks</li>
<li><strong>build_node_children</strong> <em>[bool]</em>: Pre-build node,children dict (otherwise it will be created on first use)</li>
<li><strong>build_name_nodes</strong> <em>[bool]</em>: Pre-build name,nodes dict (otherwise it will be created on first use)</li>
<li><strong>build_rank_nodes</strong> <em>[bool]</em>: Pre-build rank,nodes dict (otherwise it will be created on first use)</li>
<li><strong>build_node_children</strong> <em>[bool]</em>: Build node,children dict (otherwise it will be created on first use)</li>
<li><strong>build_name_nodes</strong> <em>[bool]</em>: Build name,nodes dict (otherwise it will be created on first use)</li>
<li><strong>build_rank_nodes</strong> <em>[bool]</em>: Build rank,nodes dict (otherwise it will be created on first use)</li>
</ul>

<p>Example:</p>
Expand Down
46 changes: 23 additions & 23 deletions docs/multitax/multitax.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ <h1 class="modulename">
<span class="sd"> * **undefined_node** *[str]*: Define a default return value for undefined nodes</span>
<span class="sd"> * **undefined_name** *[str]*: Define a default return value for undefined names</span>
<span class="sd"> * **undefined_rank** *[str]*: Define a default return value for undefined ranks</span>
<span class="sd"> * **build_node_children** *[bool]*: Pre-build node,children dict (otherwise it will be created on first use)</span>
<span class="sd"> * **build_name_nodes** *[bool]*: Pre-build name,nodes dict (otherwise it will be created on first use)</span>
<span class="sd"> * **build_rank_nodes** *[bool]*: Pre-build rank,nodes dict (otherwise it will be created on first use)</span>
<span class="sd"> * **build_node_children** *[bool]*: Build node,children dict (otherwise it will be created on first use)</span>
<span class="sd"> * **build_name_nodes** *[bool]*: Build name,nodes dict (otherwise it will be created on first use)</span>
<span class="sd"> * **build_rank_nodes** *[bool]*: Build rank,nodes dict (otherwise it will be created on first use)</span>
<span class="sd"> </span>
<span class="sd"> Example:</span>

Expand Down Expand Up @@ -393,7 +393,7 @@ <h1 class="modulename">
<span class="sd"> If ranks is provide, returns only nodes annotated with such ranks.</span>
<span class="sd"> If root_node is provided, use it instead of default root of tree.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># If lineages were pre-built and no special subset is required</span>
<span class="c1"># If lineages were built and no special subset is required</span>
<span class="k">if</span> <span class="n">node</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lineages</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lineages</span><span class="p">[</span><span class="n">node</span><span class="p">]</span>
<span class="k">else</span><span class="p">:</span>
Expand Down Expand Up @@ -505,7 +505,7 @@ <h1 class="modulename">

<span class="k">def</span> <span class="nf">clear_lineages</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Clear pre-built lineages.</span>
<span class="sd"> Clear built lineages.</span>

<span class="sd"> Returns: None</span>
<span class="sd"> &quot;&quot;&quot;</span>
Expand All @@ -531,7 +531,7 @@ <h1 class="modulename">
<span class="sd"> Filters taxonomy given a list of nodes.</span>
<span class="sd"> By default keep all the ancestors of the given nodes.</span>
<span class="sd"> If desc=True, keep all descendants instead.</span>
<span class="sd"> Deletes pre-built lineages.</span>
<span class="sd"> Deletes built lineages.</span>

<span class="sd"> Returns: None</span>

Expand Down Expand Up @@ -697,9 +697,9 @@ <h1 class="modulename">
<span class="sd"> * **undefined_node** *[str]*: Define a default return value for undefined nodes</span>
<span class="sd"> * **undefined_name** *[str]*: Define a default return value for undefined names</span>
<span class="sd"> * **undefined_rank** *[str]*: Define a default return value for undefined ranks</span>
<span class="sd"> * **build_node_children** *[bool]*: Pre-build node,children dict (otherwise it will be created on first use)</span>
<span class="sd"> * **build_name_nodes** *[bool]*: Pre-build name,nodes dict (otherwise it will be created on first use)</span>
<span class="sd"> * **build_rank_nodes** *[bool]*: Pre-build rank,nodes dict (otherwise it will be created on first use)</span>
<span class="sd"> * **build_node_children** *[bool]*: Build node,children dict (otherwise it will be created on first use)</span>
<span class="sd"> * **build_name_nodes** *[bool]*: Build name,nodes dict (otherwise it will be created on first use)</span>
<span class="sd"> * **build_rank_nodes** *[bool]*: Build rank,nodes dict (otherwise it will be created on first use)</span>
<span class="sd"> </span>
<span class="sd"> Example:</span>

Expand Down Expand Up @@ -937,7 +937,7 @@ <h1 class="modulename">
<span class="sd"> If ranks is provide, returns only nodes annotated with such ranks.</span>
<span class="sd"> If root_node is provided, use it instead of default root of tree.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># If lineages were pre-built and no special subset is required</span>
<span class="c1"># If lineages were built and no special subset is required</span>
<span class="k">if</span> <span class="n">node</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lineages</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lineages</span><span class="p">[</span><span class="n">node</span><span class="p">]</span>
<span class="k">else</span><span class="p">:</span>
Expand Down Expand Up @@ -1049,7 +1049,7 @@ <h1 class="modulename">

<span class="k">def</span> <span class="nf">clear_lineages</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Clear pre-built lineages.</span>
<span class="sd"> Clear built lineages.</span>

<span class="sd"> Returns: None</span>
<span class="sd"> &quot;&quot;&quot;</span>
Expand All @@ -1075,7 +1075,7 @@ <h1 class="modulename">
<span class="sd"> Filters taxonomy given a list of nodes.</span>
<span class="sd"> By default keep all the ancestors of the given nodes.</span>
<span class="sd"> If desc=True, keep all descendants instead.</span>
<span class="sd"> Deletes pre-built lineages.</span>
<span class="sd"> Deletes built lineages.</span>

<span class="sd"> Returns: None</span>

Expand Down Expand Up @@ -1247,9 +1247,9 @@ <h1 class="modulename">
<span class="sd"> * **undefined_node** *[str]*: Define a default return value for undefined nodes</span>
<span class="sd"> * **undefined_name** *[str]*: Define a default return value for undefined names</span>
<span class="sd"> * **undefined_rank** *[str]*: Define a default return value for undefined ranks</span>
<span class="sd"> * **build_node_children** *[bool]*: Pre-build node,children dict (otherwise it will be created on first use)</span>
<span class="sd"> * **build_name_nodes** *[bool]*: Pre-build name,nodes dict (otherwise it will be created on first use)</span>
<span class="sd"> * **build_rank_nodes** *[bool]*: Pre-build rank,nodes dict (otherwise it will be created on first use)</span>
<span class="sd"> * **build_node_children** *[bool]*: Build node,children dict (otherwise it will be created on first use)</span>
<span class="sd"> * **build_name_nodes** *[bool]*: Build name,nodes dict (otherwise it will be created on first use)</span>
<span class="sd"> * **build_rank_nodes** *[bool]*: Build rank,nodes dict (otherwise it will be created on first use)</span>
<span class="sd"> </span>
<span class="sd"> Example:</span>

Expand Down Expand Up @@ -1329,9 +1329,9 @@ <h1 class="modulename">
<li><strong>undefined_node</strong> <em>[str]</em>: Define a default return value for undefined nodes</li>
<li><strong>undefined_name</strong> <em>[str]</em>: Define a default return value for undefined names</li>
<li><strong>undefined_rank</strong> <em>[str]</em>: Define a default return value for undefined ranks</li>
<li><strong>build_node_children</strong> <em>[bool]</em>: Pre-build node,children dict (otherwise it will be created on first use)</li>
<li><strong>build_name_nodes</strong> <em>[bool]</em>: Pre-build name,nodes dict (otherwise it will be created on first use)</li>
<li><strong>build_rank_nodes</strong> <em>[bool]</em>: Pre-build rank,nodes dict (otherwise it will be created on first use)</li>
<li><strong>build_node_children</strong> <em>[bool]</em>: Build node,children dict (otherwise it will be created on first use)</li>
<li><strong>build_name_nodes</strong> <em>[bool]</em>: Build name,nodes dict (otherwise it will be created on first use)</li>
<li><strong>build_rank_nodes</strong> <em>[bool]</em>: Build rank,nodes dict (otherwise it will be created on first use)</li>
</ul>

<p>Example:</p>
Expand Down Expand Up @@ -1635,7 +1635,7 @@ <h1 class="modulename">
<span class="sd"> If ranks is provide, returns only nodes annotated with such ranks.</span>
<span class="sd"> If root_node is provided, use it instead of default root of tree.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># If lineages were pre-built and no special subset is required</span>
<span class="c1"># If lineages were built and no special subset is required</span>
<span class="k">if</span> <span class="n">node</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lineages</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_lineages</span><span class="p">[</span><span class="n">node</span><span class="p">]</span>
<span class="k">else</span><span class="p">:</span>
Expand Down Expand Up @@ -1881,7 +1881,7 @@ <h1 class="modulename">
<summary>View Source</summary>
<div class="codehilite"><pre><span></span> <span class="k">def</span> <span class="nf">clear_lineages</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Clear pre-built lineages.</span>
<span class="sd"> Clear built lineages.</span>

<span class="sd"> Returns: None</span>
<span class="sd"> &quot;&quot;&quot;</span>
Expand All @@ -1890,7 +1890,7 @@ <h1 class="modulename">

</details>

<div class="docstring"><p>Clear pre-built lineages.</p>
<div class="docstring"><p>Clear built lineages.</p>

<p>Returns: None</p>
</div>
Expand Down Expand Up @@ -1947,7 +1947,7 @@ <h1 class="modulename">
<span class="sd"> Filters taxonomy given a list of nodes.</span>
<span class="sd"> By default keep all the ancestors of the given nodes.</span>
<span class="sd"> If desc=True, keep all descendants instead.</span>
<span class="sd"> Deletes pre-built lineages.</span>
<span class="sd"> Deletes built lineages.</span>

<span class="sd"> Returns: None</span>

Expand Down Expand Up @@ -2016,7 +2016,7 @@ <h1 class="modulename">
<div class="docstring"><p>Filters taxonomy given a list of nodes.
By default keep all the ancestors of the given nodes.
If desc=True, keep all descendants instead.
Deletes pre-built lineages.</p>
Deletes built lineages.</p>

<p>Returns: None</p>

Expand Down
12 changes: 6 additions & 6 deletions multitax/multitax.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def __init__(self,
* **undefined_node** *[str]*: Define a default return value for undefined nodes
* **undefined_name** *[str]*: Define a default return value for undefined names
* **undefined_rank** *[str]*: Define a default return value for undefined ranks
* **build_node_children** *[bool]*: Pre-build node,children dict (otherwise it will be created on first use)
* **build_name_nodes** *[bool]*: Pre-build name,nodes dict (otherwise it will be created on first use)
* **build_rank_nodes** *[bool]*: Pre-build rank,nodes dict (otherwise it will be created on first use)
* **build_node_children** *[bool]*: Build node,children dict (otherwise it will be created on first use)
* **build_name_nodes** *[bool]*: Build name,nodes dict (otherwise it will be created on first use)
* **build_rank_nodes** *[bool]*: Build rank,nodes dict (otherwise it will be created on first use)
Example:
Expand Down Expand Up @@ -277,7 +277,7 @@ def lineage(self, node: str, root_node: str=None, ranks: list=None):
If ranks is provide, returns only nodes annotated with such ranks.
If root_node is provided, use it instead of default root of tree.
"""
# If lineages were pre-built and no special subset is required
# If lineages were built and no special subset is required
if node in self._lineages:
return self._lineages[node]
else:
Expand Down Expand Up @@ -389,7 +389,7 @@ def build_lineages(self, root_node: str=None, ranks: list=None):

def clear_lineages(self):
"""
Clear pre-built lineages.
Clear built lineages.
Returns: None
"""
Expand All @@ -415,7 +415,7 @@ def filter(self, nodes: list, desc: bool=False):
Filters taxonomy given a list of nodes.
By default keep all the ancestors of the given nodes.
If desc=True, keep all descendants instead.
Deletes pre-built lineages.
Deletes built lineages.
Returns: None
Expand Down

0 comments on commit e53e7f7

Please sign in to comment.