nomenclature_network

besca.pl.nomenclature_network(config_file: str, selected_roots=[], root_term='None', font_size=7, node_size=200, node_color='tan', alpha=0.8, figsize=(7, 7))[source]

Plot a nomenclature network based on annotation config file.

This function plots the relations between celltypes as described within an annotation config file, as the one provided with besca. It displays parent - child term relation as a directed graph G ( V, E); Subsetting of such graph is possible using selected_roots argument.

Parameters:
  • config_file (str) – config file from besca, expects a path to a tab separated file containing Parent and Term columns

  • selected_roots (list) – if list contained terms, will only display the hierarchy starting from those terms.

  • root_term (str) – the string indicating in the config file that a term does not have a parent term.

  • figsize ((width, height) or None | default = (7,7)) – optional parameter to define the figure size of the plot that is to be generated

Returns:

A matplotlib plt object containing the generated plot.

Return type:

Figure

Example

>>> import besca as bc
>>> import pkg_resources
>>> config_file = pkg_resources.resource_filename('besca', 'datasets/genesets/CellNames_scseqCMs6_config.tsv')
>>> plt = bc.pl.nomenclature_network(config_file)
>>> plt.show()
>>> plt = bc.pl.nomenclature_network(config_file, selected_roots = ['Epithelial', 'Tcell'])
>>> plt.show()