taxidTools.Node module¶
Node objects definition. Should be used internally only.
- class taxidTools.Node.DummyNode(taxid=None, name=None, rank=None, parent=None)[source]¶
Bases:
_BaseNode
A placeholder for a non-existing Node.
Will be assigned a random hash id in place of a taxid upon creation.
- property children: list¶
Children nodes
- property name: str¶
Name of the taxonomic node
- property node_info: str¶
Node information
- property parent: str¶
Parent node
- property rank: str¶
Rank of the taxonomic node
- property taxid: str¶
Taxonomic identification number
- class taxidTools.Node.Node(taxid, name=None, rank=None, parent=None)[source]¶
Bases:
_BaseNode
Taxonomic Node
Create a Node object contining taxonomic information as well as a link to parent and children nodes.
- Parameters:
taxid (
Union
[str
,int
]) – Taxonomic identification numbername (
Optional
[str
]) – Node namerank (
Optional
[str
]) – Node rankparent (
Optional
[str
]) – The parent Node object
Notes
The children property will be dynamically populated when children Nodes declare a Node as parent.
Examples
>>> root = Node(1, "root", "root") >>> child = Node(2, "child", "child_rank", root)
>>> child.taxid '2' >>> child.rank 'child_rank' >>> child.name 'child'
>>> child.parent Node object: Taxid: 1 Name: root Rank: root Parent: None
>>> root.children [Node object: Taxid: 2 Name: child Rank: child_rank Parent: 1]
- property children: list¶
Children nodes
- property name: str¶
Name of the taxonomic node
- property node_info: str¶
Node information
- property parent: str¶
Parent node
- property rank: str¶
Rank of the taxonomic node
- property taxid: str¶
Taxonomic identification number