pymaid.delete_tags¶
- pymaid.delete_tags(node_list, tags, node_type, remote_instance=None)[source]¶
Remove tag(s) for a list of node(s) or connector(s).
Works by getting existing tags, removing given tag(s) and then using pymaid.add_tags() to push updated tags back to CATMAID.
Danger
Use this with EXTREME caution as this is irreversible!
- Parameters:
node_list (list) – Node or connector IDs to delete tags from.
tags (list) – Tags(s) to delete from provided nodes/connectors. Use
tags=None
and to remove all tags from a set of nodes.node_type ('NODE' | 'CONNECTOR') – Set which node type of IDs you have provided as they use different API endpoints!
remote_instance (CatmaidInstance, optional) – If not passed directly, will try using global.
- Returns:
Confirmation from Catmaid server.
- Return type:
str
See also
add_tags()
Function to add tags to nodes.
Examples
Remove end-related tags from non-end nodes
>>> # Load neuron >>> n = pymaid.get_neuron(16) >>> # Get non-end nodes >>> non_leaf_nodes = n.nodes[n.nodes.type != 'end'] >>> # Define which tags to remove >>> tags_to_remove = ['ends', 'uncertain end', 'uncertain continuation', ... 'TODO'] >>> # Remove tags >>> resp = pymaid.delete_tags(non_leaf_nodes.node_id.values, ... tags_to_remove, 'NODE')