dandelion.base.core.Dandelion.update_metadata
- Dandelion.update_metadata(retrieve=None, clone_key=None, retrieve_mode='split and merge', collapse_alleles=True, reinitialize=True, by_celltype=False, report_status_productive=True, genotyped_v_call=True, custom_isotype_dict=None)[source]
A Dandelion initialisation function to update and populate the .metadata slot.
- Parameters:
retrieve (list[str] | str | None, optional) – column name in .data slot to retrieve and update the metadata.
clone_key (str | None, optional) – column name of clone id. None defaults to ‘clone_id’.
retrieve_mode (Literal[“split and unique only”, “merge and unique only”, “split and merge”, “split and sum”, “split and average”, “split”, “merge”, “sum”, “average”, ], optional) –
- one of:
- split and unique only
returns the retrieval splitted into two columns, i.e. one for VDJ and one for VJ chains, separated by | for unique elements.
- merge and unique only
returns the retrieval merged into one column, separated by | for unique elements.
- split and merge
returns the retrieval splitted into two columns, i.e. one for VDJ and one for VJ chains, separated by | for every elements.
- split
returns the retrieval splitted into separate columns for each contig.
- merge
returns the retrieval merged into one columns for each contig, separated by | for unique elements.
- split and sum
returns the retrieval sum in the VDJ and VJ columns (separately).
- split and average
returns the retrieval averaged in the VDJ and VJ columns (separately).
- sum
returns the retrieval sum into one column for all contigs.
- average
returns the retrieval averaged into one column for all contigs.
collapse_alleles (bool, optional) – returns the V(D)J genes with allelic calls if False.
reinitialize (bool, optional) – whether or not to reinitialize the current metadata. useful when updating older versions of dandelion to newer version.
by_celltype (bool, optional) – whether to return the query/update by celltype.
report_status_productive (bool, optional) – whether to report the locus and chain status for only productive contigs.
genotyped_v_call (bool, optional) – whether or not to use genotyped v_call data to initialize metadata if available.
custom_isotype_dict (dict[str, str] | None, optional) – custom isotype dictionary to update the default isotype dictionary.
- Raises:
KeyError – if columns provided not found in Dandelion.data.
ValueError – if missing columns in Dandelion.data.
- Return type:
None