Nodes
taxidTools.Node.Node
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 number
-
name
(Optional[str]
, default:None
) –Node name
-
rank
(Optional[str]
, default:None
) –Node rank
-
parent
(Optional[_BaseNode]
, default:None
) –The parent Node object
Notes
The children
property will be dynamically populated when children Nodes
declare a Node as parent.
Attributes:
Examples:
children: list
property
writable
Children nodes
name: str
property
writable
Name of the taxonomic node
node_info: str
property
Node information
parent: str
property
writable
Parent node
rank: str
property
writable
Rank of the taxonomic node
taxid: str
property
writable
Taxonomic identification number
isAncestorOf(node)
Test if the object is an ancestor of another Node.
Parameters:
-
node
(Node
) –Putative descendant node
Examples:
isDescendantOf(node)
Test if the object is an ancestor of another Node.
Parameters:
-
node
(Node
) –Putative ancestor node
Examples:
taxidTools.Node.DummyNode
Bases: _BaseNode
A placeholder for a non-existing Node.
Will be assigned a random hash id in place of a taxid upon creation. Can be inserted between two existing nodes.
Parameters:
-
taxid
(Optional[Union[str, int]]
, default:None
) –Taxonomic identification number
-
name
(Optional[str]
, default:None
) –Node name
-
rank
(Optional[str]
, default:None
) –Node rank
-
parent
(Optional[_BaseNode]
, default:None
) –The parent Node object
Attributes:
children: list
property
writable
Children nodes
name: str
property
writable
Name of the taxonomic node
node_info: str
property
Node information
parent: str
property
writable
Parent node
rank: str
property
writable
Rank of the taxonomic node
taxid: str
property
writable
Taxonomic identification number
insertNode(parent, child)
Insert the dummy node between parent and child
Parameters:
-
parent
(_BaseNode
) –Upstream node
-
child
(_BaseNode
) –Downstream node
Returns:
-
None
–
isAncestorOf(node)
Test if the object is an ancestor of another Node.
Parameters:
-
node
(Node
) –Putative descendant node
Examples:
isDescendantOf(node)
Test if the object is an ancestor of another Node.
Parameters:
-
node
(Node
) –Putative ancestor node
Examples:
taxidTools.Node.MergedNode
Simple class linking to an instance of (a subclass of) _BaseNode
Represents a taxonomic node that has been merged with another node and is therefore not part of the taxonomy anymore. This is not a subclass of _BaseNode.
Parameters:
-
taxid
(Union[str, int]
) –Taxonomic identification number
-
new_node
(Union[str, int]
) –Taxid of node this node has been merged with
-
*args
–ignored
-
**kwargs
–ignored
Attributes:
Note
new_node
is provided as a taxid and not as an instance of a Node class.
An Error will be raised upon trying to access a MergedNode from Taxonomy object if it is linked to a non-existing Node.
new_node: str
property
writable
Node this node has been merged with
taxid: str
property
writable
Taxonomic identification number