dandelion.Dandelion
- class dandelion.Dandelion(data=None, metadata=None, germline=None, layout=None, graph=None, initialize=True, library_type=None, **kwargs)[source]
Dandelion class object.
- __init__(data=None, metadata=None, germline=None, layout=None, graph=None, initialize=True, library_type=None, **kwargs)[source]
Init method for Dandelion.
- Parameters:
data (pd.DataFrame | Path | str | None, optional) – AIRR formatted data.
metadata (pd.DataFrame | None, optional) – AIRR data collapsed per cell.
germline (dict[str, str] | None, optional) – dictionary of germline gene:sequence records.
layout (tuple[dict[str, np.array], dict[str, np.array]] | None, optional) – node positions for computed graph.
graph (tuple[nx.Graph, nx.Graph] | None, optional) – networkx graphs for clonotype networks.
initialize (bool, optional) – whether or not to initialize .metadata slot.
library_type (Literal[“tr-ab”, “tr-gd”, “ig”] | None, optional) – One of “tr-ab”, “tr-gd”, “ig”.
**kwargs – passed to Dandelion.update_metadata.
Methods
__init__([data, metadata, germline, layout, ...])Init method for Dandelion.
add_cell_prefix(prefix[, sync, ...])Add prefix to cell_id and optionally to sequence_id.
add_cell_suffix(suffix[, sync, ...])Add prefix to cell_id and optionally to sequence_id.
add_sequence_prefix(prefix[, sync, ...])Add prefix to sequence_id and then apply to cell_id as well.
add_sequence_suffix(suffix[, sync, ...])Add suffix to sequence_id and then apply to cell_id as well.
copy()Performs a deep copy of all slots in Dandelion class.
Reset both IDs to their original values.
simplify(**kwargs)Disambiguate VDJ and C gene calls when there's multiple calls separated by commas and strip the alleles.
store_germline_reference([corrected, ...])Update germline reference with corrected sequences and store in Dandelion object.
update_metadata([retrieve, clone_key, ...])A Dandelion initialisation function to update and populate the .metadata slot.
update_plus([option])Retrieve additional data columns that are useful.
write([filename, compression, ...])Writes a Dandelion class to .h5ddl format.
write_10x([folder, filename_prefix, ...])Writes a Dandelion class to 10x formatted files so that it can be ingested for other tools.
write_airr([filename])Writes a Dandelion class to AIRR formatted .tsv format.
write_h5ddl([filename, compression, ...])Writes a Dandelion class to .h5ddl format.
write_pkl([filename])Writes a Dandelion class to .pkl format.
Attributes
dataOne-dimensional annotation of contig observations (pd.DataFrame).
data_namesNames of observations (alias for .data.index).
metadataOne-dimensional annotation of cell observations (pd.DataFrame).
metadata_namesNames of observations (alias for .metadata.index).