dandelion.tools.generate_network¶
-
dandelion.tools.
generate_network
(self, key=None, clone_key=None, min_size=2, downsample=None, verbose=True, **kwargs)[source]¶ Generates a Levenshtein distance network based on full length VDJ sequence alignments for heavy and light chain(s). The distance matrices are then combined into a singular matrix.
- Parameters
data (Dandelion, DataFrame, str) – Dandelion object, pandas DataFrame in changeo/airr format, or file path to changeo/airr file after clones have been determined.
key (str, optional) – column name for distance calulations. None defaults to ‘sequence_alignment_aa’.
clone_key (str, optional) – column name to build network on.
min_size (int) – For visualization purposes, two graphs are created where one contains all cells and a trimmed second graph. This value specifies the minimum number of edges required otherwise node will be trimmed in the secondary graph.
downsample (int, optional) – whether or not to downsample the number of cells prior to construction of network. If provided, cells will be randomly sampled to the integer provided. A new Dandelion class will be returned.
verbose (bool) – whether or not to print the progress bars.
**kwargs – additional kwargs passed to options specified in networkx.drawing.layout.spring_layout.
- Returns
- Return type
Dandelion object with .distance, .edges, .layout, .graph initialized.